Class LeaderBasedReplication
java.lang.Object
org.opends.server.api.SynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>
org.forgerock.opendj.server.leaderbasedreplication.LeaderBasedReplication
- All Implemented Interfaces:
ConfigurationChangeListener<ReplicationSynchronizationProviderCfg>,BackupTaskListener,ExportTaskListener,ImportTaskListener,RestoreTaskListener,HealthStatusProvider,ShutdownSynchronizer
public final class LeaderBasedReplication
extends SynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>
implements ConfigurationChangeListener<ReplicationSynchronizationProviderCfg>, BackupTaskListener, RestoreTaskListener, ImportTaskListener, ExportTaskListener, HealthStatusProvider, ShutdownSynchronizer
The entry point of the Leader Based Replication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyConfigurationChange(ReplicationSynchronizationProviderCfg configuration) Applies the configuration changes to this change listener.voidClear the notifications for the provided domain.voiddoPostOperation(PostOperationAddOperation addOperation) Performs any necessary synchronization processing that may be needed after the provided add operation is performed.voiddoPostOperation(PostOperationDeleteOperation deleteOperation) Performs any necessary synchronization processing that may be needed after the provided delete operation is performed.voiddoPostOperation(PostOperationModifyDNOperation modifyDNOperation) Performs any necessary synchronization processing that may be needed after the provided modify DN operation is performed.voiddoPostOperation(PostOperationModifyOperation modifyOperation) Performs any necessary synchronization processing that may be needed after the provided modify operation is performed.voiddoPreOperation(PreOperationAddOperation addOperation) Performs any necessary synchronization processing that may be needed before the provided add operation is performed.voiddoPreOperation(PreOperationDeleteOperation deleteOperation) Performs any necessary synchronization processing that may be needed before the provided delete operation is performed.voiddoPreOperation(PreOperationModifyDNOperation modifyDNOperation) Performs any necessary synchronization processing that may be needed before the provided modify DN operation is performed.voiddoPreOperation(PreOperationModifyOperation modifyOperation) Performs any necessary synchronization processing that may be needed before the provided modify operation is performed.voidPerforms any necessary finalization for this synchronization provider.Returns theHealthStatusfor the underlying component.voidinitializeSynchronizationProvider(ServerContext serverContext, LeaderBasedReplicationSynchronizationProviderCfg config) Performs any initialization that might be necessary for this synchronization provider.booleanisConfigurationChangeAcceptable(ReplicationSynchronizationProviderCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.voidNotifies the offline message for the provided domain has been forwarded to a RS.voidNotifies an offline message has been sent by the DS for the provided domain.voidprocessBackupBegin(LocalBackend<?> backend) Performs any processing that might be necessary just before the server begins processing on a backup task.voidprocessBackupEnd(LocalBackend<?> backend) Performs any processing that might be necessary after the server has completed processing on a backup task.voidprocessExportBegin(LocalBackend<?> backend, LDIFExportConfig config) Performs any processing that might be necessary just before the server begins processing on an LDIF export task.voidprocessExportEnd(LocalBackend<?> backend, LDIFExportConfig config, boolean successful) Performs any processing that might be necessary after the server has completed processing on an LDIF export task.voidprocessImportBegin(LocalBackend<?> backend, LDIFImportConfig config) Performs any processing that might be necessary just before the server begins processing on an LDIF import task.voidprocessImportEnd(LocalBackend<?> backend, LDIFImportConfig config, boolean successful) Performs any processing that might be necessary after the server has completed processing on an LDIF import task.voidprocessRestoreBegin(LocalBackend<?> backend) Performs any processing that might be necessary just before the server begins processing on a restore task.voidprocessRestoreEnd(LocalBackend<?> backend) Performs any processing that might be necessary after the server has completed processing on a restore task.voidstart(ExecutionContext context) Starts the replication provider functionality.voidstop()Stops the replication provider functionality.voidsynchronizeOfflineChanges(Collection<ChangeRecord> changes) Synchronizes changes that have occurred to server data while the server was offline.voidWaits until a Replication Server can proceed with shutdown.Methods inherited from class org.opends.server.api.SynchronizationProvider
completeSynchronizationProvider, handleConflictResolution, handleConflictResolution, handleConflictResolution, handleConflictResolution, isConfigurationAcceptable
-
Constructor Details
-
LeaderBasedReplication
public LeaderBasedReplication()
-
-
Method Details
-
initializeSynchronizationProvider
public void initializeSynchronizationProvider(ServerContext serverContext, LeaderBasedReplicationSynchronizationProviderCfg config) Description copied from class:SynchronizationProviderPerforms any initialization that might be necessary for this synchronization provider.- Specified by:
initializeSynchronizationProviderin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
serverContext- The server context.config- The configuration information for this synchronization provider.
-
start
Starts the replication provider functionality. For use in the simulator.- Parameters:
context- the execution context
-
stop
public void stop()Stops the replication provider functionality. For use in the simulator. -
finalizeSynchronizationProvider
public void finalizeSynchronizationProvider()Description copied from class:SynchronizationProviderPerforms 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. -
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(ReplicationSynchronizationProviderCfg configuration, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<ReplicationSynchronizationProviderCfg>- Parameters:
configuration- The new configuration containing the changes.unacceptableReasons- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(ReplicationSynchronizationProviderCfg configuration) Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<ReplicationSynchronizationProviderCfg>- Parameters:
configuration- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
processBackupBegin
Description copied from interface:BackupTaskListenerPerforms any processing that might be necessary just before the server begins processing on a backup task. This may include flushing any outstanding writes to disk so they are included in the backup and/or pausing interaction with the provided backend while the backup is in progress.- Specified by:
processBackupBeginin interfaceBackupTaskListener- Parameters:
backend- The backend to be archived.
-
processBackupEnd
Description copied from interface:BackupTaskListenerPerforms any processing that might be necessary after the server has completed processing on a backup task. Note that this will always be called when backup processing completes, regardless of whether it was successful.- Specified by:
processBackupEndin interfaceBackupTaskListener- Parameters:
backend- The backend that was archived.
-
processExportBegin
Description copied from interface:ExportTaskListenerPerforms any processing that might be necessary just before the server begins processing on an LDIF export task. This may include flushing any outstanding writes to disk so they are included in the export and/or pausing interaction with the provided backend while the export is in progress.- Specified by:
processExportBeginin interfaceExportTaskListener- Parameters:
backend- The backend to be exported.config- Configuration information about the LDIF export to be performed.
-
processExportEnd
Description copied from interface:ExportTaskListenerPerforms any processing that might be necessary after the server has completed processing on an LDIF export task. Note that this will always be called when export processing completes, regardless of whether it was successful.- Specified by:
processExportEndin interfaceExportTaskListener- Parameters:
backend- The backend that was exported.config- Configuration information about the LDIF export that was performed.successful- Indicates whether the export operation completed successfully.
-
processImportBegin
Description copied from interface:ImportTaskListenerPerforms any processing that might be necessary just before the server begins processing on an LDIF import task. This should include pausing interaction with the provided backend while the import is in progress.- Specified by:
processImportBeginin interfaceImportTaskListener- Parameters:
backend- The backend to be imported.config- Configuration information about the LDIF import to be performed.
-
processImportEnd
Description copied from interface:ImportTaskListenerPerforms any processing that might be necessary after the server has completed processing on an LDIF import task. Note that this will always be called when import processing completes, regardless of whether it was successful.- Specified by:
processImportEndin interfaceImportTaskListener- Parameters:
backend- The backend that was imported.config- Configuration information about the LDIF import that was performed.successful- Indicates whether the import operation completed successfully.
-
processRestoreBegin
Description copied from interface:RestoreTaskListenerPerforms any processing that might be necessary just before the server begins processing on a restore task. This should include pausing interaction with the provided backend while the restore is in progress.- Specified by:
processRestoreBeginin interfaceRestoreTaskListener- Parameters:
backend- The backend to be restored.
-
processRestoreEnd
Description copied from interface:RestoreTaskListenerPerforms any processing that might be necessary after the server has completed processing on a restore task. Note that this will always be called when restore processing completes, regardless of whether it was successful.- Specified by:
processRestoreEndin interfaceRestoreTaskListener- Parameters:
backend- The backend that was restored.
-
doPreOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPreOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
addOperation- The add operation to be processed.
-
doPostOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPostOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
addOperation- The add operation to be processed.
-
doPreOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPreOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
deleteOperation- The delete operation to be processed.
-
doPostOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPostOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
deleteOperation- The delete operation to be processed.
-
doPreOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPreOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
modifyOperation- The modify operation to be processed.
-
doPostOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPostOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
modifyOperation- The modify operation to be processed.
-
doPreOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPreOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
modifyDNOperation- The modify DN operation to be processed.
-
doPostOperation
Description copied from class:SynchronizationProviderPerforms 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.- Specified by:
doPostOperationin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
modifyDNOperation- The modify DN operation to be processed.
-
synchronizeOfflineChanges
Description copied from class:SynchronizationProviderSynchronizes 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.
- Specified by:
synchronizeOfflineChangesin classSynchronizationProvider<LeaderBasedReplicationSynchronizationProviderCfg>- Parameters:
changes- The set of changes that have been made to the server while it was offline.
-
getHealthStatus
Description copied from interface:HealthStatusProviderReturns theHealthStatusfor the underlying component.- Specified by:
getHealthStatusin interfaceHealthStatusProvider- Returns:
- The
HealthStatus.
-
notifyReplicaOfflineMsgHasBeenSentByDS
Description copied from interface:ShutdownSynchronizerNotifies an offline message has been sent by the DS for the provided domain.- Specified by:
notifyReplicaOfflineMsgHasBeenSentByDSin interfaceShutdownSynchronizer- Parameters:
baseDn- the domain for which the offline message has been sent.
-
clearReplicaOfflineMsgNotifications
Description copied from interface:ShutdownSynchronizerClear the notifications for the provided domain. In other words, reset the counter of offline messages to forward to remote replication servers to zero.If the synchronization has failed or must be aborted for any reason, this method allows to reset the synchronizer to a clean state. For example, if a ReplicaOfflineMsg is ignored due to a DS in a bad data status, the shutdown for the peer DS should not wait for the forwarding of the message to other replication servers.
- Specified by:
clearReplicaOfflineMsgNotificationsin interfaceShutdownSynchronizer- Parameters:
baseDn- the domain for which the notifications must be cleared
-
notifyReplicaOfflineMsgHasBeenForwardedToRS
Description copied from interface:ShutdownSynchronizerNotifies the offline message for the provided domain has been forwarded to a RS.- Specified by:
notifyReplicaOfflineMsgHasBeenForwardedToRSin interfaceShutdownSynchronizer- Parameters:
baseDn- the domain for which the offline message has been forwarded.
-
waitForReplicaOfflineMessageToBeForwardedToRS
Description copied from interface:ShutdownSynchronizerWaits until a Replication Server can proceed with shutdown.The shutdown can be performed only when the offline message have been forwarded to all remote replications servers, or if the timeout has been reached.
- Specified by:
waitForReplicaOfflineMessageToBeForwardedToRSin interfaceShutdownSynchronizer- Parameters:
baseDn- the domain for which the offline message should be forwarded.
-