public final class LDAPReplicationDomain extends ReplicationDomain implements ConfigurationChangeListener<ReplicationDomainCfg>, AlertGenerator, LocalBackendInitializationListener, ServerShutdownListener
ReplicationDomain.ImportExportContext
Modifier and Type | Field and Description |
---|---|
static String |
DS_SYNC_CONFLICT
The attribute used to mark conflicting entries.
|
broker, config, generationId
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalMonitoring(MonitorData attributes)
Subclasses should use this method to add additional monitoring information in the ReplicationDomain.
|
ConfigChangeResult |
applyConfigurationChange(ReplicationDomainCfg configuration)
Applies the configuration changes to this change listener.
|
long |
countEntries()
This method should return the total number of objects in the replicated domain.
|
int |
decodeSource(String sourceString)
Verifies that the given string represents a valid source from which this server can be initialized.
|
void |
disable()
Disable the replication on this domain.
|
void |
dispatchUpdateForReplay(UpdateMsg updateMsg)
The listener thread takes care of processing dependencies between messages via
ReplicationDomain.dispatchUpdateForReplay(UpdateMsg) , dispatching updates to the replay threads. |
void |
enable()
Enable back the domain after a previous disable.
|
protected void |
exportBackend(OutputStream output)
This method trigger an export of the replicated data.
|
Map<String,String> |
getAlerts()
Retrieves information about the set of alerts that this generator may produce.
|
String |
getClassName()
Retrieves the fully-qualified name of the Java class for this alert generator implementation.
|
Dn |
getComponentEntryDN()
Retrieves the DN of the configuration entry with which this alert generator is associated.
|
String |
getShutdownListenerName()
Retrieves the human-readable name for this shutdown listener.
|
protected void |
importBackend(InputStream input)
This method triggers an import of the replicated data.
|
protected void |
initializeRemote(int target,
int requestorID,
Task initTask,
int initWindow)
This is overwritten to allow stopping the (online) export process if the local domain is fractional and the
destination is all other servers: This make no sense to have only fractional servers in a replicated topology.
|
boolean |
isConfigurationChangeAcceptable(ReplicationDomainCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable
to this change listener.
|
void |
performBackendPostFinalizationProcessing(LocalBackend<?> backend)
Performs any processing that may be required whenever a backend is finalized.
|
void |
performBackendPostInitializationProcessing(LocalBackend<?> backend)
Performs any processing that may be required after the Initialisation cycle has been completed, that is all
listeners have received the initialisation event, and the backend has been put into service,.
|
void |
performBackendPreFinalizationProcessing(LocalBackend<?> backend)
Performs any processing that may be required before starting the finalisation cycle, that is invoked before any
listener receive the Finalization event.
|
void |
performBackendPreInitializationProcessing(LocalBackend<?> backend)
Performs any processing that may be required whenever a backend is initialized for use in the Directory Server.
|
void |
processServerShutdown(LocalizableMessage reason)
Indicates that the Directory Server has received a request to stop running and that this shutdown listener should
take any action necessary to prepare for it.
|
void |
publishReplicaOfflineMsg()
Publishes a replica offline message if all pending changes for current replica have been sent out.
|
void |
purgeConflictsHistorical(PurgeConflictsHistoricalTask task,
long endDate)
Check and purge the historical attribute on all eligible entries under this domain.
|
protected byte[] |
receiveEntryBytes()
This is overwritten to allow stopping the (online) import process by the fractional ldif import plugin when it
detects that the (imported) remote data set is not consistent with the local fractional configuration.
|
static LDAPReplicationDomain |
retrievesReplicationDomain(Dn baseDN)
Retrieves a replication domain based on the baseDN.
|
void |
sessionInitiated(ServerStatus initStatus,
ServerState rsState)
Set the initial status of the domain and perform necessary initializations.
|
void |
shutdown()
Shutdown this ReplicationDomain.
|
void |
start()
Starts the Replication Domain.
|
protected void |
updateState()
Once the updates are completed by the replay threads (concurrently), dependency data and
the server state are cleaned up.
|
changeConfig, changeConfig, decodeTarget, disableService, enableService, getAssuredMode, getAssuredSdAcknowledgedUpdates, getAssuredSdLevel, getAssuredSdSentUpdates, getAssuredSdServerTimeoutUpdates, getAssuredSdTimeoutUpdates, getAssuredSrAcknowledgedUpdates, getAssuredSrNotAcknowledgedUpdates, getAssuredSrReceivedUpdates, getAssuredSrReceivedUpdatesAcked, getAssuredSrReceivedUpdatesNotAcked, getAssuredSrReplayErrorUpdates, getAssuredSrSentUpdates, getAssuredSrServerNotAcknowledgedUpdates, getAssuredSrTimeoutUpdates, getAssuredSrWrongStatusUpdates, getAssuredTimeout, getBaseDN, getCsnGenerator, getEclIncludes, getEclIncludesForDeletes, getGenerationID, getGroupId, getImportExportContext, getLastLocalChange, getLastStatusChangeDate, getRefUrls, getReplicaInfos, getReplicaStates, getReplicationServer, getRsInfos, getRsServerId, getServerId, getServerState, getStatus, hasConnectionError, ieRunning, initializeFromRemote, initializeRemote, isAssured, isConnected, isListenerShuttingDown, prepareWaitForAckIfAssuredEnabled, processUpdateAfterReplay, publish, readAssuredConfig, resetGenerationId, setEclIncludes, setGenerationID, signalNewStatus, startListenService, startPublishService, toString, waitForAckIfAssuredEnabled
public static final String DS_SYNC_CONFLICT
public String getShutdownListenerName()
ServerShutdownListener
getShutdownListenerName
in interface ServerShutdownListener
public void processServerShutdown(LocalizableMessage reason)
ServerShutdownListener
processServerShutdown
in interface ServerShutdownListener
reason
- The human-readable reason for the shutdown.public void performBackendPreInitializationProcessing(LocalBackend<?> backend)
LocalBackendInitializationListener
performBackendPreInitializationProcessing
in interface LocalBackendInitializationListener
backend
- The backend that has been initialized and is about to be put into service.public void performBackendPostFinalizationProcessing(LocalBackend<?> backend)
LocalBackendInitializationListener
performBackendPostFinalizationProcessing
in interface LocalBackendInitializationListener
backend
- The backend that has been taken out of service and is about to be finalized.public void performBackendPostInitializationProcessing(LocalBackend<?> backend)
LocalBackendInitializationListener
performBackendPostInitializationProcessing
in interface LocalBackendInitializationListener
backend
- The backend that has been initialized and has been put into service.public void performBackendPreFinalizationProcessing(LocalBackend<?> backend)
LocalBackendInitializationListener
performBackendPreFinalizationProcessing
in interface LocalBackendInitializationListener
backend
- The backend that is about to be finalized.protected byte[] receiveEntryBytes()
receiveEntryBytes
in class ReplicationDomain
protected void initializeRemote(int target, int requestorID, Task initTask, int initWindow) throws DirectoryException
initializeRemote
in class ReplicationDomain
target
- The target server that should be initialized.requestorID
- The server that initiated the export. It can be the serverID of this server, or the serverID of a
remote server.initTask
- The task in this server that triggers this initialization and that should be updated with its
progress. Null when the export is done following a request coming from a remote server (task is
remote).initWindow
- The value of the initialization window for flow control between the importer and the exporter.DirectoryException
- When an error occurs. No exception raised means success.public void publishReplicaOfflineMsg()
ReplicationDomain
publishReplicaOfflineMsg
in class ReplicationDomain
public void shutdown()
public void disable()
public void enable()
protected void exportBackend(OutputStream output) throws DirectoryException
exportBackend
in class ReplicationDomain
output
- The OutputStream where the export should be produced.DirectoryException
- When needed.protected void importBackend(InputStream input) throws DirectoryException
importBackend
in class ReplicationDomain
input
- The InputStream from which the data are read.DirectoryException
- When needed.public static LDAPReplicationDomain retrievesReplicationDomain(Dn baseDN) throws DirectoryException
baseDN
- The baseDN of the domain to retrieveDirectoryException
- When an error occurred or no domain match the provided baseDN.public ConfigChangeResult applyConfigurationChange(ReplicationDomainCfg configuration)
ConfigurationChangeListener
applyConfigurationChange
in interface ConfigurationChangeListener<ReplicationDomainCfg>
configuration
- The new configuration containing the changes.public boolean isConfigurationChangeAcceptable(ReplicationDomainCfg configuration, List<LocalizableMessage> unacceptableReasons)
ConfigurationChangeListener
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<ReplicationDomainCfg>
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.true
if the proposed change is acceptable,
or false
if it is not.public Map<String,String> getAlerts()
AlertGenerator
getAlerts
in interface AlertGenerator
public String getClassName()
AlertGenerator
getClassName
in interface AlertGenerator
public Dn getComponentEntryDN()
AlertGenerator
getComponentEntryDN
in interface AlertGenerator
public void start()
public void sessionInitiated(ServerStatus initStatus, ServerState rsState)
ReplicationDomain
sessionInitiated
in class ReplicationDomain
initStatus
- The status to enter the state machine with.rsState
- The ServerState of the ReplicationServer with which the session was established.public long countEntries() throws DirectoryException
countEntries
in class ReplicationDomain
DirectoryException
- when needed.public void dispatchUpdateForReplay(UpdateMsg updateMsg)
ReplicationDomain.dispatchUpdateForReplay(UpdateMsg)
, dispatching updates to the replay threads.
Dependencies checking relies on non thread-safe data structures and is done here before dispatching updates to the replay threads.
updateState()
takes care of successive steps.
dispatchUpdateForReplay
in class ReplicationDomain
updateMsg
- The UpdateMsg
to replay.protected void updateState()
updateState
in class ReplicationDomain
public void addAdditionalMonitoring(MonitorData attributes)
ReplicationDomain
addAdditionalMonitoring
in class ReplicationDomain
attributes
- where to additional monitoring attributespublic int decodeSource(String sourceString) throws DirectoryException
sourceString
- The string representing the sourceDirectoryException
- if the string is not validpublic void purgeConflictsHistorical(PurgeConflictsHistoricalTask task, long endDate) throws DirectoryException
task
- the task raising this purge.endDate
- the date to stop this task whether the job is done or not.DirectoryException
- when an exception happens.Copyright 2010-2020 ForgeRock AS.