Class ReplicaId
java.lang.Object
org.opends.server.replication.common.ReplicaId
- All Implemented Interfaces:
Comparable<ReplicaId>,ServerId<ReplicaId>
Represents the server ID for a replica, called a replica ID.
The Server ID for a replica is represented both with a name and a numeric value:
- The name is a string, used for user interfaces (configuration, logs, monitoring, ...)
- The numeric value is an integer, needed because it is used in CSNs (there is no intent to change this) and for compatibility with previous replication protocol versions. The numeric id should not be exposed in user interfaces.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReplicaIdReturns the special id corresponding to "all replicas".intbooleanstatic ReplicaIdfromNumericId(int numericId) Generates a newReplicaIdfrom the provided integer value.static ReplicaIdfromReplicaName(String name) Generates a newReplicaIdfrom the provided string value.inthashCode()booleanTests whether this id corresponds to all replicas.booleanReturns if the serverId can be used as identifier with replication protocol versions before V11.booleanTests whether this id corresponds to the null replica id.Returns the normalized name of this serverId.static ReplicaIdReturns the special id corresponding to the null replica id.intReturns the numeric value of this serverId, as an int.toString()
-
Method Details
-
allReplicas
Returns the special id corresponding to "all replicas".- Returns:
- the "all replica" id
-
nullReplicaId
Returns the special id corresponding to the null replica id.- Returns:
- the null replica id
-
fromNumericId
Generates a newReplicaIdfrom the provided integer value.- Parameters:
numericId- the numeric part of this replica ID- Returns:
- a new
ReplicaId
-
fromReplicaName
Generates a newReplicaIdfrom the provided string value.- Parameters:
name- the name of this replica ID- Returns:
- a new
ReplicaId
-
normalizedName
Description copied from interface:ServerIdReturns the normalized name of this serverId.- Specified by:
normalizedNamein interfaceServerId<ReplicaId>- Returns:
- this serverId as a (normalized)
Stringvalue
-
numericId
public int numericId()Description copied from interface:ServerIdReturns the numeric value of this serverId, as an int.The numeric value is used in the CSNs.
-
isAllReplicas
public boolean isAllReplicas()Tests whether this id corresponds to all replicas.- Returns:
trueiff the id corresponds to the "all replicas" id
-
isNullReplicaId
public boolean isNullReplicaId()Tests whether this id corresponds to the null replica id.- Returns:
trueiff the id is the null replica id.
-
isBackwardCompatibleWithNumericId
public boolean isBackwardCompatibleWithNumericId()Description copied from interface:ServerIdReturns if the serverId can be used as identifier with replication protocol versions before V11.- Specified by:
isBackwardCompatibleWithNumericIdin interfaceServerId<ReplicaId>- Returns:
- if the serverId can be used as identifier with replication protocol versions before V11
-
compareTo
- Specified by:
compareToin interfaceComparable<ReplicaId>
-
equals
-
toString
-
hashCode
public int hashCode()
-