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(MeterRegistryHolder registry)
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.
|
ReplicaId |
decodeSource(String sourceReplicaName)
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.
|
Dn |
getComponentEntryDN()
Retrieves the DN of the configuration entry with which this alert generator is associated.
|
protected void |
importBackend(InputStream input)
This method triggers an import of the replicated data.
|
protected void |
initializeRemote(ReplicaId target,
ReplicaId requestorID,
Task initTask,
int initWindow)
Process the initialization of some other server or servers in the topology specified by the target argument when
this initialization specifying the server that requests the initialization.
|
boolean |
isConfigurationChangeAcceptable(ReplicationDomainCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable
to this change listener.
|
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 |
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 |
publishHeartbeatMsg()
Publishes a heartbeat message if all pending changes for current replica have been sent out.
|
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()
Receives bytes related to an entry in the context of an import to initialize the domain (called by
ReplLDIFInputStream).
|
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, getBaseDN, getCsnGenerator, getEclIncludes, getEclIncludesForDeletes, getGenerationID, getGroupId, getHealthStatus, getImportExportContext, getLastLocalChange, getMonitorEntry, getRefUrls, getReplicaId, getReplicaInfos, getReplicaStates, getReplicationContext, getReplicationServerId, getReplicationServerPort, getRsInfos, getServerState, getStatus, hasConnectionError, ieRunning, initializeFromRemote, initializeRemote, isConnected, isListenerShuttingDown, processUpdateAfterReplay, publish, recreateRemoteReplicasFromState, resetGenerationId, setEclIncludes, setGenerationID, signalNewStatus, startListenService, startPublishService, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClassName
performBackendPostFinalizationProcessing, performBackendPreInitializationProcessing
public static final String DS_SYNC_CONFLICT
public void processServerShutdown(LocalizableMessage reason)
ServerShutdownListener
processServerShutdown
in interface ServerShutdownListener
reason
- The human-readable reason for the shutdown.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()
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.
receiveEntryBytes
in class ReplicationDomain
protected void initializeRemote(ReplicaId target, ReplicaId requestorID, Task initTask, int initWindow) throws LdapException
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. This prevents from administrator manipulation error that would lead to whole topology data corruption.
initializeRemote
in class ReplicationDomain
target
- The target replica that should be initialized.requestorID
- The replica that initiated the export. It can be the replica id of this server,
or the replica id of a remote replica.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.LdapException
- When an error occurs. No exception raised means success.public void publishHeartbeatMsg()
ReplicationDomain
publishHeartbeatMsg
in class ReplicationDomain
public void publishReplicaOfflineMsg()
ReplicationDomain
publishReplicaOfflineMsg
in class ReplicationDomain
public void shutdown()
public void disable()
public void enable()
protected void exportBackend(OutputStream output) throws LdapException
exportBackend
in class ReplicationDomain
output
- The OutputStream where the export should be produced.LdapException
- When needed.protected void importBackend(InputStream input) throws LdapException
importBackend
in class ReplicationDomain
input
- The InputStream from which the data are read.LdapException
- When needed.public static LDAPReplicationDomain retrievesReplicationDomain(Dn baseDN) throws LdapException
baseDN
- The baseDN of the domain to retrieveLdapException
- 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 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 LdapException
countEntries
in class ReplicationDomain
LdapException
- 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(MeterRegistryHolder registry)
ReplicationDomain
addAdditionalMonitoring
in class ReplicationDomain
registry
- where to additional monitoring attributespublic ReplicaId decodeSource(String sourceReplicaName) throws LdapException
sourceReplicaName
- The string representing the name of the sourceReplicaId
LdapException
- if the string is not validpublic void purgeConflictsHistorical(PurgeConflictsHistoricalTask task, long endDate) throws LdapException
task
- the task raising this purge.endDate
- the date to stop this task whether the job is done or not.LdapException
- when an exception happens.Copyright 2010-2022 ForgeRock AS.