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 ReplicaId
Returns the special id corresponding to "all replicas".int
boolean
static ReplicaId
fromNumericId
(int numericId) Generates a newReplicaId
from the provided integer value.static ReplicaId
fromReplicaName
(String name) Generates a newReplicaId
from the provided string value.int
hashCode()
boolean
Tests whether this id corresponds to all replicas.boolean
Returns if the serverId can be used as identifier with replication protocol versions before V11.boolean
Tests whether this id corresponds to the null replica id.Returns the normalized name of this serverId.static ReplicaId
Returns the special id corresponding to the null replica id.int
Returns 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 newReplicaId
from the provided integer value.- Parameters:
numericId
- the numeric part of this replica ID- Returns:
- a new
ReplicaId
-
fromReplicaName
Generates a newReplicaId
from the provided string value.- Parameters:
name
- the name of this replica ID- Returns:
- a new
ReplicaId
-
normalizedName
Description copied from interface:ServerId
Returns the normalized name of this serverId.- Specified by:
normalizedName
in interfaceServerId<ReplicaId>
- Returns:
- this serverId as a (normalized)
String
value
-
numericId
public int numericId()Description copied from interface:ServerId
Returns 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:
true
iff the id corresponds to the "all replicas" id
-
isNullReplicaId
public boolean isNullReplicaId()Tests whether this id corresponds to the null replica id.- Returns:
true
iff the id is the null replica id.
-
isBackwardCompatibleWithNumericId
public boolean isBackwardCompatibleWithNumericId()Description copied from interface:ServerId
Returns if the serverId can be used as identifier with replication protocol versions before V11.- Specified by:
isBackwardCompatibleWithNumericId
in interfaceServerId<ReplicaId>
- Returns:
- if the serverId can be used as identifier with replication protocol versions before V11
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ReplicaId>
-
equals
-
toString
-
hashCode
public int hashCode()
-