Class SynchronizationProvider<T extends SynchronizationProviderCfg>

java.lang.Object
org.opends.server.api.SynchronizationProvider<T>
Type Parameters:
T - the configuration for the synchronization provider.
Direct Known Subclasses:
MultimasterReplication

public abstract class SynchronizationProvider<T extends SynchronizationProviderCfg> extends Object
This class defines the set of methods and structures that are available for use in a Directory Server synchronization provider. A synchronization provider ensures that changes in one instance of the Directory Server are properly communicated to other instances, and potentially to other kinds of applications, so that they can be updated accordingly.
  • Constructor Details

    • SynchronizationProvider

      public SynchronizationProvider()
  • Method Details

    • initializeSynchronizationProvider

      public abstract void initializeSynchronizationProvider(ServerContext serverContext, T config) throws ConfigException, InitializationException
      Performs any initialization that might be necessary for this synchronization provider.
      Parameters:
      serverContext - The server context.
      config - The configuration information for this synchronization provider.
      Throws:
      ConfigException - If the provided entry does not contain a valid configuration for this synchronization provider.
      InitializationException - If a problem occurs while initializing the synchronization provider that is not related to the server configuration.
    • isConfigurationAcceptable

      public boolean isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
      Indicates whether the provided configuration is acceptable for this synchronization provider. It should be possible to call this method on an uninitialized synchronization provider instance in order to determine whether the synchronization provider would be able to use the provided configuration.
      Parameters:
      configuration - The synchronization provider configuration for which to make the determination.
      unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
      Returns:
      true if the provided configuration is acceptable for this synchronization provider, or false if not.
    • completeSynchronizationProvider

      public void completeSynchronizationProvider()
      Performs any necessary final initialization processing for this synchronization provider. This will be called just after the provider has been registered with the server but before it has been unloaded.
    • finalizeSynchronizationProvider

      public void finalizeSynchronizationProvider()
      Performs any necessary finalization for this synchronization provider. This will be called just after the provider has been unregistered with the server but before it has been unloaded.
    • handleConflictResolution

      public SynchronizationProviderResult handleConflictResolution(PreOperationAddOperation addOperation) throws LdapException
      Performs any necessary synchronization processing for the operation that may be needed early on to deal with any potential conflict resolution or updates to historical data. This method will be invoked immediately after a lock is acquired on the target entry.
      Parameters:
      addOperation - The add operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPreOperation

      public abstract SynchronizationProviderResult doPreOperation(PreOperationAddOperation addOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed before the provided add operation is performed. This method will be invoked immediately before processing the add operation in the backend.
      Parameters:
      addOperation - The add operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPostOperation

      public abstract void doPostOperation(PostOperationAddOperation addOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed after the provided add operation is performed. This method will be invoked immediately after processing the add operation in the backend and releasing the lock on the target entry.
      Parameters:
      addOperation - The add operation to be processed.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • handleConflictResolution

      public SynchronizationProviderResult handleConflictResolution(PreOperationDeleteOperation deleteOperation) throws LdapException
      Performs any necessary synchronization processing for the operation that may be needed early on to deal with any potential conflict resolution or updates to historical data. This method will be invoked immediately after a lock is acquired on the target entry.
      Parameters:
      deleteOperation - The delete operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPreOperation

      public abstract SynchronizationProviderResult doPreOperation(PreOperationDeleteOperation deleteOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed before the provided delete operation is performed. This method will be invoked immediately before processing the delete operation in the backend.
      Parameters:
      deleteOperation - The delete operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPostOperation

      public abstract void doPostOperation(PostOperationDeleteOperation deleteOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed after the provided delete operation is performed. This method will be invoked immediately after processing the delete operation in the backend and releasing the lock on the target entry.
      Parameters:
      deleteOperation - The delete operation to be processed.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • handleConflictResolution

      public SynchronizationProviderResult handleConflictResolution(PreOperationModifyOperation modifyOperation) throws LdapException
      Performs any necessary synchronization processing for the operation that may be needed early on to deal with any potential conflict resolution or updates to historical data. This method will be invoked immediately after a lock is acquired on the target entry.
      Parameters:
      modifyOperation - The modify operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPreOperation

      public abstract SynchronizationProviderResult doPreOperation(PreOperationModifyOperation modifyOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed before the provided modify operation is performed. This method will be invoked immediately before processing the modify operation in the backend.
      Parameters:
      modifyOperation - The modify operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPostOperation

      public abstract void doPostOperation(PostOperationModifyOperation modifyOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed after the provided modify operation is performed. This method will be invoked immediately after processing the modify operation in the backend and releasing the lock on the target entry.
      Parameters:
      modifyOperation - The modify operation to be processed.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • handleConflictResolution

      public SynchronizationProviderResult handleConflictResolution(PreOperationModifyDNOperation modifyDNOperation) throws LdapException
      Performs any necessary synchronization processing for the operation that may be needed early on to deal with any potential conflict resolution or updates to historical data. This method will be invoked immediately after a lock is acquired on the target entry.
      Parameters:
      modifyDNOperation - The modify DN operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPreOperation

      public abstract SynchronizationProviderResult doPreOperation(PreOperationModifyDNOperation modifyDNOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed before the provided modify DN operation is performed. This method will be invoked immediately before processing the modify DN operation in the backend.
      Parameters:
      modifyDNOperation - The modify DN operation to be processed.
      Returns:
      Information about the result of the synchronization provider processing. Note that if the provider indicates that processing should end for the operation, it must set the result code for the operation and should also set the response message.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • doPostOperation

      public abstract void doPostOperation(PostOperationModifyDNOperation modifyDNOperation) throws LdapException
      Performs any necessary synchronization processing that may be needed after the provided modify DN operation is performed. This method will be invoked immediately after processing the modify DN operation in the backend and releasing the lock on the target entry.
      Parameters:
      modifyDNOperation - The modify DN operation to be processed.
      Throws:
      LdapException - If a problem occurs during synchronization processing.
    • synchronizeOfflineChanges

      public abstract void synchronizeOfflineChanges(Collection<ChangeRecord> changes)
      Synchronizes changes that have occurred to server data while the server was offline. This may happen when the server detects that the schema has been updated while the server was offline or if new symmetric keys have been added, e.g. when performing an offline encrypted backup or import.

      At the time this method is called, the changes will have already been applied to the local server. As such, this method must make a best effort attempt to process the associated changes, and is not allowed to throw any exceptions.

      Parameters:
      changes - The set of changes that have been made to the server while it was offline.