Class MultiDomainServerState
java.lang.Object
org.opends.server.replication.common.MultiDomainServerState
This object is used to store a list of ServerState object, one by replication domain. Globally, it is the
generalization of ServerState (that applies to one domain) to a list of domains.
MultiDomainServerState is also known as "cookie" and is used with the cookie-based changelog.
-
Constructor Summary
ConstructorDescriptionCreates a new empty object.MultiDomainServerState
(String cookie) Create an object from a string representation.Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if this object covers the provided CSN for the provided baseDN.boolean
Returns the CSN associated to the provided replication domain's baseDN and replicaId.getServerState
(Dn baseDN) Returns the ServerState associated to the provided replication domain's baseDN.Returns a snapshot of this object.int
hashCode()
boolean
isEmpty()
Tests if the state is empty.iterator()
void
replace
(Dn baseDN, ServerState serverState) Replace the ServerState of the provided baseDN with the provided server state.toString()
boolean
Update the ServerState of the provided baseDN with the replicationCSN
provided.void
update
(Dn baseDN, ServerState serverState) Update the ServerState of the provided baseDN with the provided server state.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MultiDomainServerState
public MultiDomainServerState()Creates a new empty object. -
MultiDomainServerState
Copy constructor.- Parameters:
cookie
- the cookie to copy
-
MultiDomainServerState
Create an object from a string representation.- Parameters:
cookie
- The provided string representation of the state.- Throws:
LdapException
- when the string has an invalid format
-
-
Method Details
-
update
Update the ServerState of the provided baseDN with the replicationCSN
provided.- Parameters:
baseDN
- The provided baseDN.csn
- The provided CSN.- Returns:
- a boolean indicating if the update was meaningful.
-
update
Update the ServerState of the provided baseDN with the provided server state.- Parameters:
baseDN
- The provided baseDN.serverState
- The provided serverState.
-
replace
Replace the ServerState of the provided baseDN with the provided server state. The provided server state will be owned by this instance, so care must be taken by calling code to duplicate it if needed.- Parameters:
baseDN
- The provided baseDN.serverState
- The provided serverState.
-
getSnapshot
Returns a snapshot of this object.- Returns:
- an unmodifiable Map representing a snapshot of this object.
-
toString
-
isEmpty
public boolean isEmpty()Tests if the state is empty.- Returns:
- True if the state is empty.
-
iterator
-
getServerState
Returns the ServerState associated to the provided replication domain's baseDN.- Parameters:
baseDN
- the replication domain's baseDN- Returns:
- the associated ServerState
-
getCSN
Returns the CSN associated to the provided replication domain's baseDN and replicaId.- Parameters:
baseDN
- the replication domain's baseDNreplicaId
- the replicaId- Returns:
- the associated CSN
-
equals
-
hashCode
public int hashCode() -
cover
Test if this object covers the provided CSN for the provided baseDN.- Parameters:
baseDN
- The provided baseDN.csn
- The provided CSN.- Returns:
- true when this object covers the provided CSN for the provided baseDN.
-