Constructor and Description |
---|
ServerState() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Empty the ServerState.
|
boolean |
cover(CSN covered)
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.
|
static int |
diffChanges(ServerState ss1,
ServerState ss2)
Computes the number of changes a first server state has in advance compared to a second server state.
|
ServerState |
duplicate()
Make a duplicate of this state.
|
boolean |
equals(Object obj) |
CSN |
getCSN(int serverId)
Returns the
CSN contained in this server state which corresponds to the provided server ID. |
Map<Integer,CSN> |
getServerIdToCSNMap()
Returns a copy of this ServerState's content as a Map of serverId => CSN.
|
Set<CSN> |
getSnapshot()
Returns a snapshot of this object.
|
int |
hashCode() |
boolean |
isEmpty()
Tests if the state is empty.
|
Iterator<CSN> |
iterator() |
boolean |
removeCSN(CSN expectedCSN)
Removes the mapping to the provided CSN if it is present in this ServerState.
|
String |
toString()
Return the text representation of ServerState.
|
Set<String> |
toStringSet()
Return a Set of String usable as a textual representation of a Server state.
|
boolean |
update(CSN csn)
Forward update the Server State with a CSN.
|
boolean |
update(ServerState serverState)
Update the Server State with a Server State.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public void clear()
public boolean update(CSN csn)
csn
- The committed CSN.public boolean update(ServerState serverState)
serverState
- the server state to use for the update.public boolean removeCSN(CSN expectedCSN)
expectedCSN
- the CSN to be removedpublic Set<String> toStringSet()
format : time seqnum id
example :
1 00000109e4666da600220001 2 00000109e44567a600220002
public Set<CSN> getSnapshot()
public String toString()
public CSN getCSN(int serverId)
CSN
contained in this server state which corresponds to the provided server ID.serverId
- The server ID.CSN
contained in this server state which corresponds to the provided server ID.public Map<Integer,CSN> getServerIdToCSNMap()
public boolean cover(ServerState covered)
covered
- The ServerState that needs to be checked.public boolean cover(CSN covered)
covered
- The CSN that should be checked.public boolean isEmpty()
public ServerState duplicate()
public static int diffChanges(ServerState ss1, ServerState ss2) throws IllegalArgumentException
ss1
- The server state supposed to be newer than the second oness2
- The server state supposed to be older than the first oneIllegalArgumentException
- If one of the passed state is nullCopyright 2010-2020 ForgeRock AS.