| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.unboundid.directory.sdk.sync.scripting.ScriptedSyncDestination
@Extensible
@SynchronizationServerExtension(appliesToLocalContent=false,
                                appliesToSynchronizedContent=true)
@ThreadSafety(level=MOSTLY_THREADSAFE)
public abstract class ScriptedSyncDestinationThis class defines an API that must be implemented by scripted extensions that wish to push changes processed by the Synchronization Server to an arbitrary destination. This type of sync destination is generic and can support a wide range of endpoints. In addition, this type of sync destination supports one-way notifications, where the source and destination entries are never compared but instead changes are pushed straight through.
      dsconfig create-sync-destination \
           --sync-destination-name "{name}" \
           --type groovy-scripted \
           --set "script-class:{class-name}" \
           --set "script-argument:{name=value}"
 
 where "{name}" is the name to use for the sync destination
 instance, "{script-name}" is the fully-qualified name of the Java
 class that extends
 com.unboundid.directory.sdk.sync.scripting.ScriptedSyncDestination,
 and "{name=value}" represents name-value pairs for any arguments to
 provide to the sync destination. If multiple arguments should be
 provided to extension, then the
 "--set script-argument:{name=value}" option should be
 provided multiple times.
SyncDestination| Constructor Summary | |
|---|---|
ScriptedSyncDestination()
 | 
|
| Method Summary | |
|---|---|
abstract  void | 
createEntry(com.unboundid.ldap.sdk.Entry entryToCreate,
                       SyncOperation operation)
Creates a full destination "entry", corresponding to the the LDAP Entry that is passed in. | 
 void | 
defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
Updates the provided argument parser to define any configuration arguments which may be used by this extension.  | 
abstract  void | 
deleteEntry(com.unboundid.ldap.sdk.Entry entryToDelete,
                       SyncOperation operation)
Delete a full "entry" from the destination, corresponding to the the LDAP Entry that is passed in. | 
 java.util.List<com.unboundid.ldap.sdk.Entry> | 
fetchEntry(com.unboundid.ldap.sdk.Entry destEntryMappedFromSrc,
                     SyncOperation operation)
Return a full destination entry (in LDAP form) from the destination endpoint, corresponding to the the source Entry that is passed in. | 
 void | 
finalizeSyncDestination()
This hook is called when a Sync Pipe shuts down, or when the resync process shuts down.  | 
abstract  java.lang.String | 
getCurrentEndpointURL()
Return the URL or path identifying the destination endpoint to which this extension is transmitting data.  | 
 void | 
initializeSyncDestination(SyncServerContext serverContext,
                                                   SyncDestinationConfig config,
                                                   com.unboundid.util.args.ArgumentParser parser)
Initializes this sync destination.  | 
abstract  void | 
modifyEntry(com.unboundid.ldap.sdk.Entry entryToModify,
                       java.util.List<com.unboundid.ldap.sdk.Modification> modsToApply,
                       SyncOperation operation)
Modify an "entry" on the destination, corresponding to the the LDAP Entry that is passed in. | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ScriptedSyncDestination()
| Method Detail | 
|---|
public void defineConfigArguments(com.unboundid.util.args.ArgumentParser parser)
                           throws com.unboundid.util.args.ArgumentException
defineConfigArguments in interface Configurableparser - The argument parser to be updated with the configuration
                 arguments which may be used by this extension.
com.unboundid.util.args.ArgumentException - If a problem is encountered while updating the
                             provided argument parser.
public void initializeSyncDestination(SyncServerContext serverContext,
                                      SyncDestinationConfig config,
                                      com.unboundid.util.args.ArgumentParser parser)
                               throws EndpointException
SyncServerContext in a class member so that it can be used
 elsewhere in the implementation.
 The default implementation is empty.
serverContext - A handle to the server context for the server in
                        which this extension is running. Extensions should
                        typically store this in a class member.config - The general configuration for this object.parser - The argument parser which has been initialized from
                        the configuration for this sync destination.
EndpointException - if a problem occurs while initializing this
                        sync destination.public void finalizeSyncDestination()
The default implementation is empty.
public abstract java.lang.String getCurrentEndpointURL()
public java.util.List<com.unboundid.ldap.sdk.Entry> fetchEntry(com.unboundid.ldap.sdk.Entry destEntryMappedFromSrc,
                                                               SyncOperation operation)
                                                        throws EndpointException
Entry that is passed in.
 This method should perform any queries necessary to gather the latest
 values for all the attributes to be synchronized and return them in an
 Entry.
 
 This method only needs to be implemented if the 'synchronization-mode' on
 the Sync Pipe is set to 'standard'. If it is set to 'notification', this
 method will never be called, and the pipe will pass changes straight
 through to one of createEntry(com.unboundid.ldap.sdk.Entry, com.unboundid.directory.sdk.sync.types.SyncOperation), modifyEntry(com.unboundid.ldap.sdk.Entry, java.util.List, or
 deleteEntry(com.unboundid.ldap.sdk.Entry, com.unboundid.directory.sdk.sync.types.SyncOperation).
 
 Note that the if the source entry was renamed (see
 SyncOperation.isModifyDN()), the
 destEntryMappedFromSrc will have the new DN; the old DN can
 be obtained by calling
 SyncOperation.getDestinationEntryBeforeChange() and getting the DN
 from there. This method should return the entry in its existing form
 (i.e. with the old DN, before it is changed).
 
This method must be thread safe, as it will be called repeatedly and concurrently by each of the Sync Pipe worker threads as they process entries.
destEntryMappedFromSrc - the LDAP entry which corresponds to the destination "entry" to
          fetchoperation - the sync operation for this change
EndpointException - if there is an error fetching the entry
public abstract void createEntry(com.unboundid.ldap.sdk.Entry entryToCreate,
                                 SyncOperation operation)
                          throws EndpointException
Entry that is passed in. This method is responsible for
 transforming the contents of the entry into the desired format and
 transmitting it to the target destination. It should perform any inserts or
 updates necessary to make sure the entry is fully created on the
 destination endpoint.
 This method must be thread safe, as it will be called repeatedly and concurrently by the Sync Pipe worker threads as they process CREATE operations.
entryToCreate - the LDAP entry which corresponds to the destination
          "entry" to createoperation - the sync operation for this change
EndpointException - if there is an error creating the entry
public abstract void modifyEntry(com.unboundid.ldap.sdk.Entry entryToModify,
                                 java.util.List<com.unboundid.ldap.sdk.Modification> modsToApply,
                                 SyncOperation operation)
                          throws EndpointException
Entry that is passed in. This method is responsible for
 transforming the contents of the entry into the desired format and
 transmitting it to the target destination. It may perform multiple updates
 (including inserting or deleting other attributes) in order to fully
 synchronize the entire entry on the destination endpoint.
 
 Note that the if the source entry was renamed (see
 SyncOperation.isModifyDN()), the
 fetchedDestEntry will have the old DN; the new DN can
 be obtained by calling
 SyncOperation.getDestinationEntryAfterChange() and getting the DN
 from there.
 
This method must be thread safe, as it will be called repeatedly and concurrently by the Sync Pipe worker threads as they process MODIFY operations.
entryToModify - the LDAP entry which corresponds to the destination
          "entry" to modify. If the synchronization mode is 'standard',
          this will be the entry that was returned by fetchEntry(com.unboundid.ldap.sdk.Entry, com.unboundid.directory.sdk.sync.types.SyncOperation);
          otherwise if the synchronization mode is 'notification', this
          will be the mapped destination entry.modsToApply - a list of Modification objects which should be appliedoperation - the sync operation for this change
EndpointException - if there is an error modifying the entry
public abstract void deleteEntry(com.unboundid.ldap.sdk.Entry entryToDelete,
                                 SyncOperation operation)
                          throws EndpointException
Entry that is passed in. This method may perform multiple deletes
 or updates if necessary to fully delete the entry from the destination
 endpoint.
 This method must be thread safe, as it will be called repeatedly and concurrently by the Sync Pipe worker threads as they process DELETE operations.
entryToDelete - the LDAP entry which corresponds to the destination
          "entry" to delete. If the synchronization mode is 'standard',
          this will be the entry that was returned by fetchEntry(com.unboundid.ldap.sdk.Entry, com.unboundid.directory.sdk.sync.types.SyncOperation);
          otherwise if the synchronization mode is 'notification', this
          will be the mapped destination entry.operation - the sync operation for this change
EndpointException - if there is an error deleting the entry
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||