Class ReplicaId
- java.lang.Object
-
- org.opends.server.replication.common.ReplicaId
-
- All Implemented Interfaces:
Comparable<ReplicaId>,ServerId<ReplicaId>
public final class ReplicaId extends Object implements 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReplicaIdallReplicas()Returns the special id corresponding to "all replicas".intcompareTo(ReplicaId o)booleanequals(Object o)static ReplicaIdfromNumericId(int numericId)Generates a newReplicaIdfrom the provided integer value.static ReplicaIdfromReplicaName(String name)Generates a newReplicaIdfrom the provided string value.inthashCode()booleanisAllReplicas()Tests whether this id corresponds to all replicas.booleanisBackwardCompatibleWithNumericId()Returns if the serverId can be used as identifier with replication protocol versions before V11.booleanisNullReplicaId()Tests whether this id corresponds to the null replica id.StringnormalizedName()Returns the normalized name of this serverId.static ReplicaIdnullReplicaId()Returns the special id corresponding to the null replica id.intnumericId()Returns the numeric value of this serverId, as an int.StringtoString()
-
-
-
Method Detail
-
allReplicas
public static ReplicaId allReplicas()
Returns the special id corresponding to "all replicas".- Returns:
- the "all replica" id
-
nullReplicaId
public static ReplicaId nullReplicaId()
Returns the special id corresponding to the null replica id.- Returns:
- the null replica id
-
fromNumericId
public static ReplicaId fromNumericId(int numericId)
Generates a newReplicaIdfrom the provided integer value.- Parameters:
numericId- the numeric part of this replica ID- Returns:
- a new
ReplicaId
-
fromReplicaName
public static ReplicaId fromReplicaName(String name)
Generates a newReplicaIdfrom the provided string value.- Parameters:
name- the name of this replica ID- Returns:
- a new
ReplicaId
-
normalizedName
public String 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
public int compareTo(ReplicaId o)
- Specified by:
compareToin interfaceComparable<ReplicaId>
-
-