com.unboundid.directory.sdk.sync.types
Class ChangeRecord

java.lang.Object
  extended by com.unboundid.directory.sdk.sync.types.ChangeRecord

@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class ChangeRecord
extends java.lang.Object

This class represents the basis for a single change record. This is effectively a hint that a change happened, and some metadata about the change. A SyncSource implementation should create instances of this class based on changes detected in the source endpoint (either from a changelog table or some other change tracking mechanism). The resync process will also use instances of this class to identify source entries, which can then be fetched using the fetchEntry() method on the SyncSource extension.


Nested Class Summary
static class ChangeRecord.Builder
          This class is used to construct ChangeRecord instances.
 
Method Summary
 java.lang.String[] getChangedAttributes()
          Get the set of changed attributes for this change.
 long getChangeNumber()
          Get the change number that identifies this particular change.
 long getChangeTime()
          Get the time at which the change occurred.
 com.unboundid.ldap.sdk.ChangeType getChangeType()
          Get the change type (ADD/MODIFY/MOD-DN/DELETE).
 CompletionStatus getCompletionStatus()
          Gets the completion status for this change.
 com.unboundid.ldap.sdk.Entry getFullEntry()
          Get the full source entry (if it was set on this ChangeRecord when it was created).
 com.unboundid.ldap.sdk.DN getIdentifiableInfo()
          Get a DN that identifies the entry or record that changed (for example "accountID=123").
 java.lang.String getModifier()
          Get the user account name that made the change.
 java.lang.Object getProperty(java.lang.Object key)
          Get the property value (if one exists) for the given key.
 void setCompletionStatus(CompletionStatus status)
          This method is used by the Sync Pipe to indicate if the completion status of a synchronization operation.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getChangeNumber

public long getChangeNumber()
Get the change number that identifies this particular change. If a change number is not used by the source for change detection, this method will return a monotonically increasing sequence number for this change record, so that you can still identify the order in which changes were detected.

Returns:
the changeNumber

getChangeType

public com.unboundid.ldap.sdk.ChangeType getChangeType()
Get the change type (ADD/MODIFY/MOD-DN/DELETE). For resync operations, this will be null.

Returns:
the changeType

getIdentifiableInfo

public com.unboundid.ldap.sdk.DN getIdentifiableInfo()
Get a DN that identifies the entry or record that changed (for example "accountID=123"). If multiple attributes are part of the identifier, they will be represented as different RDN components of the DN (for example "accountID=123,groupID=5").

Returns:
an identifier DN for the entry that changed

getChangedAttributes

public java.lang.String[] getChangedAttributes()
Get the set of changed attributes for this change.

Returns:
an array of attribute names that were modified as part of the change

getModifier

public java.lang.String getModifier()
Get the user account name that made the change.

Returns:
the source user account

getChangeTime

public long getChangeTime()
Get the time at which the change occurred.

Returns:
the change time (in milliseconds since January 1, 1970 00:00:00.000 GMT)

getFullEntry

public com.unboundid.ldap.sdk.Entry getFullEntry()
Get the full source entry (if it was set on this ChangeRecord when it was created). Typically this will be null, but some extensions may opt to set the entry when the ChangeRecord is constructed in order to skip the fetchEntry() phase of processing.

Returns:
the full source entry, or null if it has not been set

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Get the property value (if one exists) for the given key.

Parameters:
key - the key for a given property to return
Returns:
the property value, or null if the key is null

setCompletionStatus

@InternalUseOnly
public void setCompletionStatus(CompletionStatus status)
This method is used by the Sync Pipe to indicate if the completion status of a synchronization operation. This is for internal use only and should not be called by extension code.

Parameters:
status - the completion status for this ChangeRecord

getCompletionStatus

public CompletionStatus getCompletionStatus()
Gets the completion status for this change. This will be null if the change has not finished processing yet.

Returns:
the CompletionStatus indicating whether this change completed successfully or else a reason why it failed

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object