Class ServerState
java.lang.Object
org.opends.server.replication.common.ServerState
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Empty the ServerState.boolean
Checks that the CSN given as a parameter is in this ServerState.boolean
cover
(ServerState covered) Check that all the CSNs in the covered serverState are also in this serverState.Make a duplicate of this state.boolean
Returns theCSN
contained in this server state which corresponds to the provided replica ID.Returns a copy of this ServerState's content as a Map of replicaId to CSN.Returns a snapshot of this object.int
hashCode()
boolean
isEmpty()
Tests if the state is empty.iterator()
boolean
Removes the mapping to the provided CSN if it is present in this ServerState.toString()
Return the text representation of ServerState.boolean
Forward update the Server State with a CSN.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
-
ServerState
public ServerState()
-
-
Method Details
-
clear
public void clear()Empty the ServerState. After this call the Server State will be in the same state as if it was just created. -
update
Forward update the Server State with a CSN. The provided CSN will be put on the current object only if it is newer than the existing CSN for the same replicaId or if there is no existing CSN.- Parameters:
csn
- The committed CSN.- Returns:
- a boolean indicating if the update was meaningful.
-
removeCSN
Removes the mapping to the provided CSN if it is present in this ServerState.- Parameters:
expectedCSN
- the CSN to be removed- Returns:
- true if the CSN could be removed, false otherwise.
-
getSnapshot
Returns a snapshot of this object.- Returns:
- an unmodifiable List representing a snapshot of this object.
-
toString
Return the text representation of ServerState. -
getCSN
Returns theCSN
contained in this server state which corresponds to the provided replica ID.- Parameters:
replicaId
- The replica ID.- Returns:
- The
CSN
contained in this server state which corresponds to the provided replica ID.
-
getReplicaIdToCSNMap
Returns a copy of this ServerState's content as a Map of replicaId to CSN.- Returns:
- a copy of this ServerState's content as a Map of replicaId to CSN.
-
iterator
-
cover
Check that all the CSNs in the covered serverState are also in this serverState.- Parameters:
covered
- The ServerState that needs to be checked.- Returns:
- A boolean indicating if this ServerState covers the ServerState given in parameter.
-
cover
Checks that the CSN given as a parameter is in this ServerState.- Parameters:
covered
- The CSN that should be checked.- Returns:
- A boolean indicating if this ServerState contains the CSN given in parameter.
-
isEmpty
public boolean isEmpty()Tests if the state is empty.- Returns:
- True if the state is empty.
-
duplicate
Make a duplicate of this state.- Returns:
- The duplicate of this state.
-
equals
-
hashCode
public int hashCode()
-