Class ReplicationServerId
- java.lang.Object
-
- org.opends.server.replication.common.ReplicationServerId
-
- All Implemented Interfaces:
Comparable<ReplicationServerId>
,ServerId<ReplicationServerId>
public final class ReplicationServerId extends Object implements ServerId<ReplicationServerId>
Represents the server ID for a replication server, called a Replication Server ID.The Replication Server ID 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 a integer, it is needed only for compatibility with previous replication protocol versions and should be removed in the future. The integer should not be exposed in user interfaces.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(ReplicationServerId o)
boolean
equals(Object o)
static ReplicationServerId
fromLegacyNumericId(int numericId)
Generates a newReplicationServerId
from the provided integer value.static ReplicationServerId
fromReplicationServerName(String name)
Generates a newReplicationServerId
from the provided string value.int
hashCode()
boolean
isBackwardCompatibleWithNumericId()
Returns if the serverId can be used as identifier with replication protocol versions before V11.boolean
isNullReplicationServerId()
Tests whether this id corresponds to the null replication server id.String
normalizedName()
Returns the normalized name of this serverId.static ReplicationServerId
nullReplicationServerId()
Returns the special id corresponding to the null replication server id.int
numericId()
Returns the numeric value of this serverId, as an int.String
toString()
-
-
-
Method Detail
-
nullReplicationServerId
public static ReplicationServerId nullReplicationServerId()
Returns the special id corresponding to the null replication server id.- Returns:
- the null replication server id
-
fromLegacyNumericId
public static ReplicationServerId fromLegacyNumericId(int numericId)
Generates a newReplicationServerId
from the provided integer value.Replication Servers need an integer value only for protocol compatibility purposes, the method can be deleted once support for replication topologies running versions before 6.5.0 is dropped.
- Parameters:
numericId
- the numeric part of this ID- Returns:
- a new
ReplicationServerId
-
fromReplicationServerName
public static ReplicationServerId fromReplicationServerName(String name)
Generates a newReplicationServerId
from the provided string value.- Parameters:
name
- the name of this ID- Returns:
- a new
ReplicationServerId
-
normalizedName
public String normalizedName()
Description copied from interface:ServerId
Returns the normalized name of this serverId.- Specified by:
normalizedName
in interfaceServerId<ReplicationServerId>
- 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.
- Specified by:
numericId
in interfaceServerId<ReplicationServerId>
- Returns:
- this serverId as an int value
-
isNullReplicationServerId
public boolean isNullReplicationServerId()
Tests whether this id corresponds to the null replication server id.- Returns:
true
iff the id is the null replication server 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<ReplicationServerId>
- Returns:
- if the serverId can be used as identifier with replication protocol versions before V11
-
compareTo
public int compareTo(ReplicationServerId o)
- Specified by:
compareTo
in interfaceComparable<ReplicationServerId>
-
-