public final class ReplicaId extends Object implements ServerId<ReplicaId>
The Server ID for a replica is represented both with a name and a numeric value:
Modifier and Type | Field and Description |
---|---|
static ReplicaId |
LONGEST_REPLICA_ID
Special ID for highest CSN comparison.
|
static ReplicaId |
SHORTEST_REPLICA_ID
Special ID for lowest CSN comparison.
|
Modifier and Type | Method and Description |
---|---|
static ReplicaId |
allReplicas()
Returns the special id corresponding to "all replicas".
|
int |
compareTo(ReplicaId o) |
boolean |
equals(Object o) |
static ReplicaId |
fromNumericId(int numericId)
Generates a new
ReplicaId from the provided integer value. |
static ReplicaId |
fromReplicaName(String name)
Generates a new
ReplicaId from the provided string value. |
int |
hashCode() |
boolean |
isAllReplicas()
Tests whether this id corresponds to all replicas.
|
boolean |
isNullReplicaId()
Tests whether this id corresponds to the null replica id.
|
String |
name()
Returns the name of this serverId, as a
String . |
String |
normalizedName()
Returns the normalized name of this serverId.
|
static ReplicaId |
nullReplicaId()
Returns the special id corresponding to the null replica id.
|
int |
numericId()
Returns the numeric value of this serverId, as an int.
|
String |
toString() |
public static final ReplicaId SHORTEST_REPLICA_ID
public static final ReplicaId LONGEST_REPLICA_ID
public static ReplicaId allReplicas()
public static ReplicaId nullReplicaId()
public static ReplicaId fromNumericId(int numericId)
ReplicaId
from the provided integer value.numericId
- the numeric part of this replica IDReplicaId
public static ReplicaId fromReplicaName(String name)
ReplicaId
from the provided string value.name
- the name of this replica IDReplicaId
public String name()
ServerId
String
.public String normalizedName()
ServerId
normalizedName
in interface ServerId<ReplicaId>
String
valuepublic int numericId()
ServerId
The numeric value is used in the CSNs.
public boolean isAllReplicas()
true
iff the id corresponds to the "all replicas" idpublic boolean isNullReplicaId()
true
iff the id is the null replica id.public int compareTo(ReplicaId o)
compareTo
in interface Comparable<ReplicaId>
Copyright 2010-2022 ForgeRock AS.