Class ChangeRecord
- java.lang.Object
-
- 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 thefetchEntry()
method on the SyncSource extension.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ChangeRecord.Builder
This class is used to construct ChangeRecord instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.ChangeType
getChangeType()
Get the change type (ADD/MODIFY/MOD-DN/DELETE).CompletionStatus
getCompletionStatus()
Gets the completion status for this change.Entry
getFullEntry()
Get the full source entry (if it was set on this ChangeRecord when it was created).DN
getIdentifiableInfo()
Get a DN that identifies the entry or record that changed (for example "accountID=123").DN
getIdentifiableInfoAfterChange()
Get a DN that identifies the entry or record after the change is complete.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()
-
-
-
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 ChangeType getChangeType()
Get the change type (ADD/MODIFY/MOD-DN/DELETE). For resync operations, this will benull
.- Returns:
- the changeType
-
getIdentifiableInfo
public 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
-
getIdentifiableInfoAfterChange
public DN getIdentifiableInfoAfterChange()
Get a DN that identifies the entry or record after the change is complete. This DN will only differ from the result ofgetIdentifiableInfo()
if the change type was a Modify DN.- Returns:
- the DN for the entry after the change.
-
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 Entry getFullEntry()
Get the full source entry (if it was set on this ChangeRecord when it was created). Typically this will benull
, but some extensions may opt to set the entry when the ChangeRecord is constructed in order to skip thefetchEntry()
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 classjava.lang.Object
-
-