Interface SyncOperation
-
public interface SyncOperation
This interface represents a single synchronized change from the Sync Source to the Sync Destination. It exists from when a change is detected all the way through when the change is applied at the destination.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addModifiedDestinationAttribute(java.lang.String attributeName)
Add the name of a destination attribute that should be synchronized.void
addModifiedSourceAttribute(java.lang.String attributeName)
Add an additional source attribute that should be synchronized to the destination.java.lang.Object
getAttachment(java.lang.Object key)
Returns an attachment from the operation that was previously set with a call toputAttachment(java.lang.Object, java.lang.Object)
.ChangeLogEntry
getChangeLogEntry()
Return the original changelog entry that was detected for this operation.ChangeRecord
getChangeRecord()
Return the original change record that was detected for this operation.DatabaseChangeRecord
getDatabaseChangeRecord()
Return the DatabaseChangeRecord that was detected from a RDBMS.Entry
getDestinationEntryAfterChange()
Returns a representation of the target destination entry after it is modified or renamed.Entry
getDestinationEntryBeforeChange()
Returns a representation of the target destination entry before it is modified or renamed.java.lang.String
getIdentifiableInfo()
Return a String that can be used to correlate this change back to the source entry.java.util.Collection<java.lang.String>
getModifiedSourceAttributes()
Return the names of the attributes that were modified at the source.Entry
getSourceEntry()
Return the Entry that was fetched from the sync source.SyncClass
getSyncClass()
Return theSyncClass
for the operation being processed.java.lang.String
getSyncClassName()
Return the name of the Sync Class for the operation being processed.java.lang.String
getSyncPipeName()
Return the name of the Sync Pipe for the operation being processed.SyncOperationType
getType()
Return the type of this SynchronizationOperation.UnboundIDChangeLogEntry
getUnboundIDChangeLogEntry()
Return the original changelog entry that was detected for this operation.java.lang.String
getUniqueId()
Return a unique ID for thisSyncOperation
.java.util.List<java.lang.String>
getWarnings()
Returns a list of warning messages (if any) about this SyncOperation.boolean
isIgnored()
Get the "ignored" flag.boolean
isModifyDN()
Determines whether this SyncOperation represents a modify DN operation on the source entry (if the source is an LDAP directory).void
logDebug(java.lang.String message)
Logs a debug message to the synchronization log for this change.void
logError(java.lang.String message)
Logs an error message to the synchronization log for this change.void
logInfo(java.lang.String message)
Logs an informational message to the synchronization log for this change.void
putAttachment(java.lang.Object key, java.lang.Object value)
Stores an attachment in the operation.void
removeModifiedSourceAttribute(java.lang.String attributeName)
Remove a source attribute that should not be synchronized to the destination.void
setIgnored()
Sets the "ignored" flag to true.void
setSourceEntry(Entry sourceEntry, boolean isDeletedEntry)
Sets the entry that was fetched from the sync source.
-
-
-
Method Detail
-
getType
SyncOperationType getType()
Return the type of this SynchronizationOperation.- Returns:
- The type of this SynchronizationOperation.
-
getIdentifiableInfo
java.lang.String getIdentifiableInfo()
Return a String that can be used to correlate this change back to the source entry. For example, if the source endpoint is a directory server, this will be a DN.- Returns:
- A String that can be used to correlate this change back to the source entry.
-
getUniqueId
java.lang.String getUniqueId()
Return a unique ID for thisSyncOperation
. This ID is used in log messages.- Returns:
- A unique ID for this operation.
-
getSourceEntry
Entry getSourceEntry()
Return the Entry that was fetched from the sync source. This may be null if the source entry no longer exists or has not yet been fetched.- Returns:
- The entry that was fetched from the source server.
-
setSourceEntry
void setSourceEntry(Entry sourceEntry, boolean isDeletedEntry)
Sets the entry that was fetched from the sync source. If the entry was deleted, then sufficient information about the entry must be provided so that it can be correlated to a destination entry.- Parameters:
sourceEntry
- The entry that was fetched from the source.isDeletedEntry
-true
if and only if the entry was deleted at the source.
-
getChangeLogEntry
ChangeLogEntry getChangeLogEntry()
Return the original changelog entry that was detected for this operation. This is only applicable when synchronizing from a data source that supplies an LDAP changelog as described in draft-good-ldap-changelog, such as the Ping Identity Directory Server or Sun Directory Server.Note that this is the raw changelog entry and does not have any mappings or filterings applied to it.
- Returns:
- a
ChangeLogEntry
instance, or null if the source endpoint does not use an LDAP changelog for change detection.
-
getUnboundIDChangeLogEntry
UnboundIDChangeLogEntry getUnboundIDChangeLogEntry()
Return the original changelog entry that was detected for this operation. This is only applicable when synchronizing from a Ping Identity Directory Server. The UnboundID LDAP Changelog provides additional functionality not present in other directory servers.Note that this is the raw changelog entry and does not have any mappings or filterings applied to it.
- Returns:
- a
UnboundIDChangeLogEntry
instance, or null if the source endpoint is not a Ping Identity Directory Server.
-
getChangeRecord
ChangeRecord getChangeRecord()
Return the original change record that was detected for this operation. This is only applicable when synchronizing from a data source that is implemented by theSyncSource
orScriptedSyncSource
extension type.- Returns:
- a
ChangeRecord
instance, or null if the source endpoint is not an instance ofSyncSource
orScriptedSyncSource
.
-
getDatabaseChangeRecord
DatabaseChangeRecord getDatabaseChangeRecord()
Return the DatabaseChangeRecord that was detected from a RDBMS. This is only applicable when synchronizing from a database environment, and will be null otherwise.- Returns:
- a DatabaseChangeRecord that was detected from a database, or null if the sync source is not a JDBC sync source.
-
isModifyDN
boolean isModifyDN()
Determines whether this SyncOperation represents a modify DN operation on the source entry (if the source is an LDAP directory). The result of this method is undefined if the source is a relational database or some other type of endpoint.- Returns:
- true if the entry has been renamed, false otherwise.
-
getDestinationEntryBeforeChange
Entry getDestinationEntryBeforeChange()
Returns a representation of the target destination entry before it is modified or renamed. This can be used to obtain the before-values of any attributes. The returned entry cannot be modified.This value is only defined after the SyncOperation has made it past the post-mapping stage in the SyncPipe.
- Returns:
- a
Entry
instance.
-
getDestinationEntryAfterChange
Entry getDestinationEntryAfterChange()
Returns a representation of the target destination entry after it is modified or renamed. This can be used to obtain the after-values of any attributes.This value is only defined after the SyncOperation has made it past the post-mapping stage in the SyncPipe.
The returned entry is modifiable and can be used to influence the final list of modifications to apply at the destination. The Data Sync Server computes a diff between this entry and the existing entry returned from the destination. Any modifications to this entry would have to take place in either
LDAPSyncDestinationPlugin.preFetch
orLDAPSyncDestinationPlugin.postFetch
.- Returns:
- a
Entry
instance.
-
getModifiedSourceAttributes
java.util.Collection<java.lang.String> getModifiedSourceAttributes()
Return the names of the attributes that were modified at the source.- Returns:
- The names of the attributes that were modified at the source.
-
addModifiedSourceAttribute
void addModifiedSourceAttribute(java.lang.String attributeName)
Add an additional source attribute that should be synchronized to the destination.- Parameters:
attributeName
- The attribute to add to the set of attributes to synchronize.
-
removeModifiedSourceAttribute
void removeModifiedSourceAttribute(java.lang.String attributeName)
Remove a source attribute that should not be synchronized to the destination.- Parameters:
attributeName
- The attribute to remove from the set of attributes to synchronize.
-
addModifiedDestinationAttribute
void addModifiedDestinationAttribute(java.lang.String attributeName)
Add the name of a destination attribute that should be synchronized.- Parameters:
attributeName
- The name of the destination attribute to synchronize.
-
getSyncPipeName
java.lang.String getSyncPipeName()
Return the name of the Sync Pipe for the operation being processed.- Returns:
- The name of the Sync Pipe for the operation being processed.
-
getSyncClassName
java.lang.String getSyncClassName()
Return the name of the Sync Class for the operation being processed.- Returns:
- The name of the Sync Class for the operation being processed.
-
getSyncClass
SyncClass getSyncClass()
Return theSyncClass
for the operation being processed. This can be used to determine the correlation attributes and other properties configured for this type of change.- Returns:
- The Sync Class that this operation falls into, or null if no Sync Class has been determined yet.
-
putAttachment
void putAttachment(java.lang.Object key, java.lang.Object value)
Stores an attachment in the operation. This can be used by an extension to have information carried in the synchronization operation from one extension point to the next.- Parameters:
key
- The key of the attachment. To avoid conflicts, the fully-qualified class name of the extension should be used as a prefix of the key.value
- The value of the attachment.
-
getAttachment
java.lang.Object getAttachment(java.lang.Object key)
Returns an attachment from the operation that was previously set with a call toputAttachment(java.lang.Object, java.lang.Object)
.- Parameters:
key
- The key of the attachment.- Returns:
- The value of the attachment or
null
if no attachment was set for the specified key.
-
getWarnings
java.util.List<java.lang.String> getWarnings()
Returns a list of warning messages (if any) about this SyncOperation. For example, if a changelog entry omitted some data because an attribute had too many values, there will be a message in the returned list indicating so. Typically synchronization of this SyncOperation can continue despite these warnings.- Returns:
- a list of warning messages; the list will be empty if there are no warnings.
-
logError
void logError(java.lang.String message)
Logs an error message to the synchronization log for this change. Messages logged here should pertain to this specific change. For general logging capabilities, seeSyncServerContext
- Parameters:
message
- The message to log.
-
logInfo
void logInfo(java.lang.String message)
Logs an informational message to the synchronization log for this change. Messages logged here should pertain to this specific change. For general logging capabilities, seeSyncServerContext
- Parameters:
message
- The message to log.
-
logDebug
void logDebug(java.lang.String message)
Logs a debug message to the synchronization log for this change. Messages logged here should pertain to this specific change. For general logging capabilities, seeSyncServerContext
. To see messages logged with this API the Sync Log Publisher should include plugin-debug. For resyncs pass "--logLevel debug".- Parameters:
message
- The message to log.
-
isIgnored
boolean isIgnored()
Get the "ignored" flag. For create, modify, or delete operations when the "ignored" flag is set to true the Sync server does not include the operation in the statistics listed under "cn=Sync Pipe Monitor: <pipe name>,cn=monitor".- Returns:
- The "ignored" flag.
-
setIgnored
void setIgnored()
Sets the "ignored" flag to true. Setting the "ignored" flag to true informs the Sync server that the create, modify, or delete operation was ignored. This prevents the operation from being included as an applied operation in the statistics that are reported for the Sync Pipe via the Management Console, the bin/status command line utility, and in a raw form under "cn=Sync Pipe Monitor: <pipe name>,cn=monitor".
-
-