org.opends.server.api
Class SynchronizationProvider<T extends SynchronizationProviderCfg>

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

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=false)
public abstract class SynchronizationProvider<T extends SynchronizationProviderCfg>
extends java.lang.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 Summary
SynchronizationProvider()
           
 
Method Summary
 void completeSynchronizationProvider()
          Performs any necessary final initialization processing for this synchronization provider.
abstract  void doPostOperation(PostOperationAddOperation addOperation)
          Performs any necessary synchronization processing that may be needed after the provided add operation is performed.
abstract  void doPostOperation(PostOperationDeleteOperation deleteOperation)
          Performs any necessary synchronization processing that may be needed after the provided delete operation is performed.
abstract  void doPostOperation(PostOperationModifyDNOperation modifyDNOperation)
          Performs any necessary synchronization processing that may be needed after the provided modify DN operation is performed.
abstract  void doPostOperation(PostOperationModifyOperation modifyOperation)
          Performs any necessary synchronization processing that may be needed after the provided modify operation is performed.
abstract  SynchronizationProviderResult doPreOperation(PreOperationAddOperation addOperation)
          Performs any necessary synchronization processing that may be needed before the provided add operation is performed.
abstract  SynchronizationProviderResult doPreOperation(PreOperationDeleteOperation deleteOperation)
          Performs any necessary synchronization processing that may be needed before the provided delete operation is performed.
abstract  SynchronizationProviderResult doPreOperation(PreOperationModifyDNOperation modifyDNOperation)
          Performs any necessary synchronization processing that may be needed before the provided modify DN operation is performed.
abstract  SynchronizationProviderResult doPreOperation(PreOperationModifyOperation modifyOperation)
          Performs any necessary synchronization processing that may be needed before the provided modify operation is performed.
 void finalizeSynchronizationProvider()
          Performs any necessary finalization for this synchronization provider.
 SynchronizationProviderResult handleConflictResolution(PreOperationAddOperation addOperation)
          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.
 SynchronizationProviderResult handleConflictResolution(PreOperationDeleteOperation deleteOperation)
          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.
 SynchronizationProviderResult handleConflictResolution(PreOperationModifyDNOperation modifyDNOperation)
          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.
 SynchronizationProviderResult handleConflictResolution(PreOperationModifyOperation modifyOperation)
          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.
abstract  void initializeSynchronizationProvider(T config)
          Performs any initialization that might be necessary for this synchronization provider.
 boolean isConfigurationAcceptable(SynchronizationProviderCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this synchronization provider.
abstract  void processSchemaChange(java.util.List<Modification> modifications)
          Performs any processing that may be required whenever the server schema has been updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizationProvider

public SynchronizationProvider()
Method Detail

initializeSynchronizationProvider

public abstract void initializeSynchronizationProvider(T config)
                                                throws ConfigException,
                                                       InitializationException
Performs any initialization that might be necessary for this synchronization provider.

Parameters:
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(SynchronizationProviderCfg configuration,
                                         java.util.List<Message> 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.

Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.

Parameters:
configuration - The synchronization provider configuration for which to make the 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 deregistered with the server but before it has been unloaded.


handleConflictResolution

public SynchronizationProviderResult handleConflictResolution(PreOperationAddOperation addOperation)
                                                       throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPreOperation

public abstract SynchronizationProviderResult doPreOperation(PreOperationAddOperation addOperation)
                                                      throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPostOperation

public abstract void doPostOperation(PostOperationAddOperation addOperation)
                              throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

handleConflictResolution

public SynchronizationProviderResult handleConflictResolution(PreOperationDeleteOperation deleteOperation)
                                                       throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPreOperation

public abstract SynchronizationProviderResult doPreOperation(PreOperationDeleteOperation deleteOperation)
                                                      throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPostOperation

public abstract void doPostOperation(PostOperationDeleteOperation deleteOperation)
                              throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

handleConflictResolution

public SynchronizationProviderResult handleConflictResolution(PreOperationModifyOperation modifyOperation)
                                                       throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPreOperation

public abstract SynchronizationProviderResult doPreOperation(PreOperationModifyOperation modifyOperation)
                                                      throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPostOperation

public abstract void doPostOperation(PostOperationModifyOperation modifyOperation)
                              throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

handleConflictResolution

public SynchronizationProviderResult handleConflictResolution(PreOperationModifyDNOperation modifyDNOperation)
                                                       throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPreOperation

public abstract SynchronizationProviderResult doPreOperation(PreOperationModifyDNOperation modifyDNOperation)
                                                      throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

doPostOperation

public abstract void doPostOperation(PostOperationModifyDNOperation modifyDNOperation)
                              throws DirectoryException
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:
DirectoryException - If a problem occurs during synchronization processing.

processSchemaChange

public abstract void processSchemaChange(java.util.List<Modification> modifications)
Performs any processing that may be required whenever the server schema has been updated. This may be invoked for schema modifications made with the server online, and it may also be called if the server detects that there were any scheam changes made with the server offline (e.g., by directly editing the schema configuration files).

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

Parameters:
modifications - The set of modifications that have been made to the server schema.