public class ChangelogState extends Object
This class is used during replication initialization to decouple the code that reads the changelogStateDB from the code that makes use of its data.
| Constructor and Description |
|---|
ChangelogState() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOfflineReplica(DN baseDN,
CSN offlineCSN)
Adds the following replica information to the offline list.
|
void |
addServerIdToDomain(int serverId,
DN baseDN)
Adds the serverId to the serverIds list of the supplied replication domain.
|
Map<DN,Long> |
getDomainToGenerationId()
Returns the Map of domainBaseDN => generationId.
|
Map<DN,Set<Integer>> |
getDomainToServerIds()
Returns the Map of domainBaseDN => List<serverId>.
|
MultiDomainServerState |
getOfflineReplicas()
Returns the internal MultiDomainServerState for offline replicas.
|
boolean |
isEqualTo(ChangelogState other)
Returns whether the current ChangelogState is equal to the provided
ChangelogState.
|
void |
removeOfflineReplica(DN baseDN,
int serverId)
Removes the following replica information from the offline list.
|
void |
setDomainGenerationId(DN baseDN,
long generationId)
Sets the generationId for the supplied replication domain.
|
String |
toString() |
public ChangelogState()
public void setDomainGenerationId(DN baseDN, long generationId)
baseDN - the targeted replication domain baseDNgenerationId - the generation Id to setpublic void addServerIdToDomain(int serverId, DN baseDN)
serverId - the serverId to addbaseDN - the targeted replication domain baseDNpublic void addOfflineReplica(DN baseDN, CSN offlineCSN)
baseDN - the baseDN of the offline replicaofflineCSN - the CSN (serverId + timestamp) of the offline replicapublic void removeOfflineReplica(DN baseDN, int serverId)
baseDN - the baseDN of the offline replicaserverId - the serverId that is not offline anymorepublic Map<DN,Long> getDomainToGenerationId()
public Map<DN,Set<Integer>> getDomainToServerIds()
public MultiDomainServerState getOfflineReplicas()
public boolean isEqualTo(ChangelogState other)
Note: Only use for tests!!
This method should only be used by tests because it creates a lot of
intermediate objects which is not suitable for production.
other - the ChangelogState to compare withCopyright © 2010-2015 ForgeRock AS. All Rights Reserved.