|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.opends.server.api.DirectoryThread
org.opends.server.replication.plugin.ReplicationDomain
public class ReplicationDomain
This class implements the bulk part of the.of the Directory Server side of the replication code. It contains the root method for publishing a change, processing a change received from the replicationServer service, handle conflict resolution, handle protocol messages from the replicationServer.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static java.lang.String |
DS_SYNC_CONFLICT
The attribute used to mark conflicting entries. |
protected static java.lang.String |
REPLICATION_GENERATION_ID
The attribute name used to store the state in the backend. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ReplicationDomain(ReplicationDomainCfg configuration,
java.util.concurrent.LinkedBlockingQueue<UpdateToReplay> updateToReplayQueue)
Creates a new ReplicationDomain using configuration from configEntry. |
Method Summary | |
---|---|
protected void |
abandonImportExport(ErrorMessage errorMsg)
Processes an error message received while an import/export is on going. |
void |
ack(ChangeNumber changeNumber)
Send an Ack message. |
ConfigChangeResult |
applyConfigurationChange(ReplicationDomainCfg configuration)
Applies the configuration changes to this change listener. |
void |
backupEnd()
Do whatever is needed when a backup is finished. |
void |
backupStart()
Do whatever is needed when a backup is started. |
static void |
clearJEBackend(boolean createBaseEntry,
java.lang.String beID,
java.lang.String dn)
Clears all the entries from the JE backend determined by the be id passed into the method. |
protected void |
closeBackendImport(Backend backend)
Make post import operations. |
long |
computeGenerationId()
Compute the data generationId associated with the current data present in the backend for this domain. |
short |
decodeSource(java.lang.String sourceString)
Verifies that the given string represents a valid source from which this server can be initialized. |
short |
decodeTarget(java.lang.String targetString)
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 |
doPreOperation(PreOperationAddOperation addOperation)
The preOperation phase for the add Operation. |
void |
enable()
Enable back the domain after a previous disable. |
protected void |
exportBackend()
Export the entries from the backend. |
void |
exportLDIFEntry(java.lang.String lDIFEntry)
Exports an entry in LDIF format. |
java.util.LinkedHashMap<java.lang.String,java.lang.String> |
getAlerts()
Retrieves information about the set of alerts that this generator may produce. |
Backend |
getBackend()
Returns the backend associated to this domain. |
DN |
getBaseDN()
Returns the base DN of this ReplicationDomain. |
java.lang.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. |
int |
getCurrentRcvWindow()
Get the current receive window size. |
int |
getCurrentSendWindow()
Get the current send window size. |
int |
getDebugCount()
Get the debugCount. |
long |
getGenerationId()
Returns the generationId set for this domain. |
int |
getMaxRcvWindow()
Get the maximum receive window size. |
int |
getMaxSendWindow()
Get the maximum send window size. |
int |
getNumLostConnections()
Get the number of times the replication connection was lost. |
int |
getNumProcessedUpdates()
get the number of updates replayed by the replication. |
int |
getNumRcvdUpdates()
get the number of updates received by the replication plugin. |
int |
getNumReplayedPostOpCalled()
get the number of updates replayed successfully by the replication. |
int |
getNumResolvedModifyConflicts()
Get the number of modify conflicts successfully resolved. |
int |
getNumResolvedNamingConflicts()
Get the number of namign conflicts successfully resolved. |
int |
getNumSentUpdates()
Get the number of updates sent by the replication plugin. |
int |
getNumUnresolvedNamingConflicts()
Get the number of unresolved conflicts. |
int |
getPendingUpdatesCount()
Get the number of updates in the pending list. |
java.lang.String |
getReplicationServer()
Get the name of the replicationServer to which this domain is currently connected. |
int |
getServerId()
Get the server ID. |
ServerState |
getServerState()
get the ServerState. |
SynchronizationProviderResult |
handleConflictResolution(PreOperationAddOperation addOperation)
Implement the handleConflictResolution phase of the addOperation. |
SynchronizationProviderResult |
handleConflictResolution(PreOperationDeleteOperation deleteOperation)
Implement the handleConflictResolution phase of the deleteOperation. |
SynchronizationProviderResult |
handleConflictResolution(PreOperationModifyDNOperation modifyDNOperation)
Implement the handleConflictResolution phase of the ModifyDNOperation. |
SynchronizationProviderResult |
handleConflictResolution(PreOperationModifyOperation modifyOperation)
Handle the conflict resolution. |
boolean |
ieRunning()
Returns a boolean indiciating if an import or export is currently processed. |
void |
incProcessedUpdates()
Increment the number of processed updates. |
protected void |
initialize(InitializeTargetMessage initializeMessage)
Initializes the domain's backend with received entries. |
void |
initializeFromRemote(short source,
Task initTask)
Initializes this domain from another source server. |
void |
initializeRemote(short target,
short requestorID,
Task initTask)
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. |
void |
initializeRemote(short target,
Task initTask)
Process the initialization of some other server or servers in the topology specified by the target argument. |
static boolean |
isConfigurationAcceptable(ReplicationDomainCfg configuration,
java.util.List<Message> unacceptableReasons)
Check if the provided configuration is acceptable for add. |
boolean |
isConfigurationChangeAcceptable(ReplicationDomainCfg configuration,
java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener. |
boolean |
isConnected()
Check if the domain is connected to a ReplicationServer. |
boolean |
isSessionEncrypted()
Determine whether the connection to the replication server is encrypted. |
protected void |
loadDataState()
Do what necessary when the data have changed : load state, load generation Id. |
long |
loadGenerationId()
Load the GenerationId from the root entry of the domain from the REPLICATION_GENERATION_ID attribute in database to memory, or compute it if not found. |
UpdateMessage |
receive()
Receives an update message from the replicationServer. |
void |
receiveAck(AckMessage ack)
Do the necessary processing when an AckMessage is received. |
byte[] |
receiveEntryBytes()
Receives bytes related to an entry in the context of an import to initialize the domain (called by ReplLDIFInputStream). |
void |
receiveUpdate(UpdateMessage update)
Do the necessary processing when an UpdateMessage was received. |
void |
replay(UpdateMessage msg)
Create and replay a synchronized Operation from an UpdateMessage. |
void |
resetGenerationId(java.lang.Long generationIdNewValue)
Reset the generationId of this domain in the whole topology. |
protected static Backend |
retrievesBackend(DN baseDN)
Retrieves the backend related to the domain. |
static ReplicationDomain |
retrievesReplicationDomain(DN baseDN)
Retrieves a replication domain based on the baseDN. |
void |
run()
|
ResultCode |
saveGenerationId(long generationId)
Stores the value of the generationId. |
void |
shutdown()
Shutdown this ReplicationDomain. |
boolean |
solveConflict()
Check if the domain solve conflicts. |
void |
synchronize(PostOperationOperation op)
Check if an operation must be synchronized. |
void |
synchronizeModifications(java.util.List<Modification> modifications)
Push the modifications contain the in given parameter has a modification that would happen on a local server. |
void |
updateError(ChangeNumber changeNumber)
This method is called when an error happens while replaying an operation. |
Methods inherited from class org.opends.server.api.DirectoryThread |
---|
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, setAssociatedTask |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DS_SYNC_CONFLICT
protected static final java.lang.String REPLICATION_GENERATION_ID
Constructor Detail |
---|
public ReplicationDomain(ReplicationDomainCfg configuration, java.util.concurrent.LinkedBlockingQueue<UpdateToReplay> updateToReplayQueue) throws ConfigException
configuration
- The configuration of this ReplicationDomain.updateToReplayQueue
- The queue for update messages to replay.
ConfigException
- In case of invalid configuration.Method Detail |
---|
public DN getBaseDN()
public SynchronizationProviderResult handleConflictResolution(PreOperationDeleteOperation deleteOperation)
deleteOperation
- The deleteOperation.
public SynchronizationProviderResult handleConflictResolution(PreOperationAddOperation addOperation)
addOperation
- The AddOperation.
public SynchronizationProviderResult handleConflictResolution(PreOperationModifyDNOperation modifyDNOperation)
modifyDNOperation
- The ModifyDNOperation.
public SynchronizationProviderResult handleConflictResolution(PreOperationModifyOperation modifyOperation)
modifyOperation
- the operation
public void doPreOperation(PreOperationAddOperation addOperation)
addOperation
- The Add Operation.public UpdateMessage receive()
public void receiveUpdate(UpdateMessage update)
update
- The received UpdateMessage.public void receiveAck(AckMessage ack)
ack
- The AckMessage that was received.public void synchronize(PostOperationOperation op)
op
- the operationpublic int getNumRcvdUpdates()
public int getNumSentUpdates()
public int getPendingUpdatesCount()
public void incProcessedUpdates()
public int getNumProcessedUpdates()
public int getNumReplayedPostOpCalled()
public ServerState getServerState()
public int getDebugCount()
public void ack(ChangeNumber changeNumber)
changeNumber
- The ChangeNumber for which the ack must be sent.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void shutdown()
public java.lang.String getReplicationServer()
public void replay(UpdateMessage msg)
msg
- The UpdateMessage to be replayed.public void updateError(ChangeNumber changeNumber)
changeNumber
- the ChangeNumber of the operation with error.public int getMaxRcvWindow()
public int getCurrentRcvWindow()
public int getMaxSendWindow()
public int getCurrentSendWindow()
public int getNumLostConnections()
public int getNumResolvedModifyConflicts()
public int getNumResolvedNamingConflicts()
public int getNumUnresolvedNamingConflicts()
public int getServerId()
public boolean solveConflict()
public void disable()
protected void loadDataState() throws DirectoryException
DirectoryException
- Thrown when an error occurs.public void enable()
public long computeGenerationId() throws DirectoryException
DirectoryException
- When an error occurs.public long getGenerationId()
public ResultCode saveGenerationId(long generationId)
generationId
- The value of the generationId.
public long loadGenerationId() throws DirectoryException
DirectoryException
- When an error occurs.public void resetGenerationId(java.lang.Long generationIdNewValue)
generationIdNewValue
- The new value of the generation Id.public void backupStart()
public void backupEnd()
public byte[] receiveEntryBytes()
protected void abandonImportExport(ErrorMessage errorMsg)
errorMsg
- The error message received.public static void clearJEBackend(boolean createBaseEntry, java.lang.String beID, java.lang.String dn) throws java.lang.Exception
createBaseEntry
- Indicate whether to automatically create the base
entry and add it to the backend.beID
- The be id to clear.dn
- The suffix of the backend to create if the the createBaseEntry
boolean is true.
java.lang.Exception
- If an unexpected problem occurs.protected void exportBackend() throws DirectoryException
DirectoryException
- when an error occurredprotected static Backend retrievesBackend(DN baseDN)
baseDN
- The baseDN to retrieve the backend
public void exportLDIFEntry(java.lang.String lDIFEntry) throws java.io.IOException
lDIFEntry
- The entry to be exported..
java.io.IOException
- when an error occurred.public void initializeFromRemote(short source, Task initTask) throws DirectoryException
source
- The source from which to initializeinitTask
- The task that launched the initialization
and should be updated of its progress.
DirectoryException
- when an error occurspublic short decodeSource(java.lang.String sourceString) throws DirectoryException
sourceString
- The string representing the source
DirectoryException
- if the string is not validpublic short decodeTarget(java.lang.String targetString) throws DirectoryException
targetString
- The string representing the source
DirectoryException
- if the string is not validpublic void initializeRemote(short target, Task initTask) throws DirectoryException
target
- The target that should be initializedinitTask
- The task that triggers this initialization and that should
be updated with its progress.
DirectoryException
- When an error occurs.public void initializeRemote(short target, short requestorID, Task initTask) throws DirectoryException
target
- The target that should be initialized.requestorID
- The server that initiated the export.initTask
- The task that triggers this initialization and that should
be updated with its progress.
DirectoryException
- When an error occurs.protected void initialize(InitializeTargetMessage initializeMessage) throws DirectoryException
initializeMessage
- The message that initiated the import.
DirectoryException
- Thrown when an error occurs.protected void closeBackendImport(Backend backend) throws DirectoryException
backend
- The backend implied in the import.
DirectoryException
- Thrown when an error occurs.public static ReplicationDomain retrievesReplicationDomain(DN baseDN) throws DirectoryException
baseDN
- The baseDN of the domain to retrieve
DirectoryException
- When an error occurred or no domain
match the provided baseDN.public Backend getBackend()
public boolean ieRunning()
public void synchronizeModifications(java.util.List<Modification> modifications)
modifications
- The modification to pushpublic static boolean isConfigurationAcceptable(ReplicationDomainCfg configuration, java.util.List<Message> unacceptableReasons)
configuration
- The configuration to check.unacceptableReasons
- When the configuration is not acceptable, this
table is use to return the reasons why this
configuration is not acceptbale.
public ConfigChangeResult applyConfigurationChange(ReplicationDomainCfg configuration)
applyConfigurationChange
in interface ConfigurationChangeListener<ReplicationDomainCfg>
configuration
- The new configuration containing the changes.
public boolean isConfigurationChangeAcceptable(ReplicationDomainCfg configuration, java.util.List<Message> unacceptableReasons)
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 java.util.LinkedHashMap<java.lang.String,java.lang.String> getAlerts()
getAlerts
in interface AlertGenerator
public java.lang.String getClassName()
getClassName
in interface AlertGenerator
public DN getComponentEntryDN()
getComponentEntryDN
in interface AlertGenerator
public boolean isConnected()
public boolean isSessionEncrypted()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |