public class MultiDomainServerState extends Object implements Iterable<org.forgerock.opendj.ldap.Dn>
MultiDomainServerState is also known as "cookie" and is used with the cookie-based changelog.
Constructor and Description |
---|
MultiDomainServerState()
Creates a new empty object.
|
MultiDomainServerState(MultiDomainServerState cookie)
Copy constructor.
|
MultiDomainServerState(String cookie)
Create an object from a string representation.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Empty the object..
|
boolean |
cover(org.forgerock.opendj.ldap.Dn baseDN,
CSN csn)
Test if this object covers the provided CSN for the provided baseDN.
|
boolean |
cover(MultiDomainServerState covered)
Test if this object covers the provided covered object.
|
boolean |
equalsTo(MultiDomainServerState other)
Test if this object equals the provided other object.
|
CSN |
getCSN(org.forgerock.opendj.ldap.Dn baseDN,
int serverId)
Returns the CSN associated to the provided replication domain's baseDN and
serverId.
|
org.forgerock.util.Pair<org.forgerock.opendj.ldap.Dn,CSN> |
getOldestCSNExcluding(MultiDomainServerState excludedCSNs)
Returns the oldest Pair<DN, CSN> held in current object, excluding
the provided CSNs.
|
ServerState |
getServerState(org.forgerock.opendj.ldap.Dn baseDN)
Returns the ServerState associated to the provided replication domain's
baseDN.
|
Map<org.forgerock.opendj.ldap.Dn,List<CSN>> |
getSnapshot()
Returns a snapshot of this object.
|
boolean |
isEmpty()
Tests if the state is empty.
|
Iterator<org.forgerock.opendj.ldap.Dn> |
iterator() |
boolean |
removeCSN(org.forgerock.opendj.ldap.Dn baseDN,
CSN expectedCSN)
Removes the mapping to the provided CSN if it is present in this
MultiDomainServerState.
|
void |
replace(org.forgerock.opendj.ldap.Dn baseDN,
ServerState serverState)
Replace the ServerState of the provided baseDN with the provided server
state.
|
String |
toString()
Returns a string representation of this object.
|
void |
toString(StringBuilder buffer)
Dump a string representation in the provided buffer.
|
boolean |
update(org.forgerock.opendj.ldap.Dn baseDN,
CSN csn)
Update the ServerState of the provided baseDN with the replication
CSN provided. |
void |
update(org.forgerock.opendj.ldap.Dn baseDN,
ServerState serverState)
Update the ServerState of the provided baseDN with the provided server
state.
|
void |
update(MultiDomainServerState state)
Update the current object with the provided multi domain server state.
|
public MultiDomainServerState()
public MultiDomainServerState(MultiDomainServerState cookie)
cookie
- the cookie to copypublic MultiDomainServerState(String cookie) throws DirectoryException
cookie
- The provided string representation of the state.DirectoryException
- when the string has an invalid formatpublic void clear()
public boolean update(org.forgerock.opendj.ldap.Dn baseDN, CSN csn)
CSN
provided.baseDN
- The provided baseDN.csn
- The provided CSN.public void update(org.forgerock.opendj.ldap.Dn baseDN, ServerState serverState)
baseDN
- The provided baseDN.serverState
- The provided serverState.public void replace(org.forgerock.opendj.ldap.Dn baseDN, ServerState serverState)
baseDN
- The provided baseDN.serverState
- The provided serverState.public void update(MultiDomainServerState state)
state
- The provided multi domain server state.public Map<org.forgerock.opendj.ldap.Dn,List<CSN>> getSnapshot()
public void toString(StringBuilder buffer)
buffer
- The provided buffer.public boolean isEmpty()
public ServerState getServerState(org.forgerock.opendj.ldap.Dn baseDN)
baseDN
- the replication domain's baseDNpublic CSN getCSN(org.forgerock.opendj.ldap.Dn baseDN, int serverId)
baseDN
- the replication domain's baseDNserverId
- the serverIdpublic org.forgerock.util.Pair<org.forgerock.opendj.ldap.Dn,CSN> getOldestCSNExcluding(MultiDomainServerState excludedCSNs)
excludedCSNs
- the CSNs that cannot be returnedPair.EMPTY
if no such
older CSN exists.public boolean removeCSN(org.forgerock.opendj.ldap.Dn baseDN, CSN expectedCSN)
baseDN
- the replication domain's baseDNexpectedCSN
- the CSN to be removedpublic boolean equalsTo(MultiDomainServerState other)
other
- The other object with which we want to test equality.public boolean cover(MultiDomainServerState covered)
covered
- The provided object.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.