public final class LDAPReplicationDomain extends ReplicationDomain implements ConfigurationChangeListener<ReplicationDomainCfg>, AlertGenerator
FIXME Move this class to org.opends.server.replication.service or the equivalent package once this code is moved to a maven module.
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 |
|---|---|
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 |
enable()
Enable back the domain after a previous disable.
|
protected void |
exportBackend(OutputStream output)
This method trigger an export of the replicated data.
|
Collection<Attribute> |
getAdditionalMonitoring()
Monitoring information for the LDAPReplicationDomain.
|
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.
|
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.
|
boolean |
processUpdate(UpdateMsg updateMsg)
This method should handle the processing of
UpdateMsg receive from
remote replication entities. |
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 if the operation that just happened has cleared a conflict : Clearing
a conflict happens if the operation has freed a DN for which another entry
was in conflict.
|
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.
|
changeConfig, changeConfig, decodeTarget, disableService, enableService, getAssuredMode, getAssuredSdAcknowledgedUpdates, getAssuredSdLevel, getAssuredSdSentUpdates, getAssuredSdServerTimeoutUpdates, getAssuredSdTimeoutUpdates, getAssuredSrAcknowledgedUpdates, getAssuredSrNotAcknowledgedUpdates, getAssuredSrReceivedUpdates, getAssuredSrReceivedUpdatesAcked, getAssuredSrReceivedUpdatesNotAcked, getAssuredSrReplayErrorUpdates, getAssuredSrSentUpdates, getAssuredSrServerNotAcknowledgedUpdates, getAssuredSrTimeoutUpdates, getAssuredSrWrongStatusUpdates, getAssuredTimeout, getBaseDN, getEclIncludes, getEclIncludesForDeletes, getGenerationID, getGenerator, getGroupId, getImportExportContext, getInitWindow, getLastLocalChange, getLastStatusChangeDate, getRefUrls, getReplicaInfos, getReplicaStates, getReplicationServer, getRsInfos, getRsServerId, getServerId, getServerState, getStatus, hasConnectionError, ieRunning, initializeFromRemote, initializeRemote, isAssured, isConnected, isListenerShuttingDown, prepareWaitForAckIfAssuredEnabled, processUpdateDone, publish, readAssuredConfig, resetGenerationId, setEclIncludes, setGenerationID, signalNewStatus, startListenService, startPublishService, toString, waitForAckIfAssuredEnabledpublic static final String DS_SYNC_CONFLICT
protected byte[] receiveEntryBytes()
receiveEntryBytes in class ReplicationDomainprotected void initializeRemote(int target, int requestorID, Task initTask, int initWindow) throws DirectoryException
initializeRemote in class ReplicationDomaintarget - 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()
ReplicationDomainpublishReplicaOfflineMsg in class ReplicationDomainpublic void shutdown()
public void disable()
public void enable()
protected void exportBackend(OutputStream output) throws DirectoryException
exportBackend in class ReplicationDomainoutput - The OutputStream where the export should
be produced.DirectoryException - When needed.protected void importBackend(InputStream input) throws DirectoryException
importBackend in class ReplicationDomaininput - 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)
ConfigurationChangeListenerapplyConfigurationChange in interface ConfigurationChangeListener<ReplicationDomainCfg>configuration - The new configuration containing the changes.public boolean isConfigurationChangeAcceptable(ReplicationDomainCfg configuration, List<LocalizableMessage> unacceptableReasons)
ConfigurationChangeListenerisConfigurationChangeAcceptable 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()
AlertGeneratorgetAlerts in interface AlertGeneratorpublic String getClassName()
AlertGeneratorgetClassName in interface AlertGeneratorpublic DN getComponentEntryDN()
AlertGeneratorgetComponentEntryDN in interface AlertGeneratorpublic void start()
public void sessionInitiated(ServerStatus initStatus, ServerState rsState)
ReplicationDomainsessionInitiated in class ReplicationDomaininitStatus - 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 ReplicationDomainDirectoryException - when needed.public boolean processUpdate(UpdateMsg updateMsg)
ReplicationDomainUpdateMsg receive from
remote replication entities.
This method will be called by a single thread and should therefore should not be blocking.
processUpdate in class ReplicationDomainupdateMsg - The UpdateMsg that was received. true is returned, no further processing is
necessary. If false is returned, the subclass should
call the method ReplicationDomain.processUpdateDone(UpdateMsg, String) and
update the ServerState When this processing is complete.public Collection<Attribute> getAdditionalMonitoring()
getAdditionalMonitoring in class ReplicationDomainpublic 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
Steps:
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-2015 ForgeRock AS. All Rights Reserved.