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 intcompareTo(ReplicationServerId o)booleanequals(Object o)static ReplicationServerIdfromLegacyNumericId(int numericId)Generates a newReplicationServerIdfrom the provided integer value.static ReplicationServerIdfromReplicationServerName(String name)Generates a newReplicationServerIdfrom the provided string value.inthashCode()booleanisBackwardCompatibleWithNumericId()Returns if the serverId can be used as identifier with replication protocol versions before V11.booleanisNullReplicationServerId()Tests whether this id corresponds to the null replication server id.StringnormalizedName()Returns the normalized name of this serverId.static ReplicationServerIdnullReplicationServerId()Returns the special id corresponding to the null replication server id.intnumericId()Returns the numeric value of this serverId, as an int.StringtoString()
-
-
-
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 newReplicationServerIdfrom 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 newReplicationServerIdfrom the provided string value.- Parameters:
name- the name of this ID- Returns:
- a new
ReplicationServerId
-
normalizedName
public String normalizedName()
Description copied from interface:ServerIdReturns the normalized name of this serverId.- Specified by:
normalizedNamein interfaceServerId<ReplicationServerId>- 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.
- Specified by:
numericIdin 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:
trueiff the id is the null replication server 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<ReplicationServerId>- Returns:
- if the serverId can be used as identifier with replication protocol versions before V11
-
compareTo
public int compareTo(ReplicationServerId o)
- Specified by:
compareToin interfaceComparable<ReplicationServerId>
-
-