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.
Names of Server IDs are case-insensitive, i.e. "server1" and "Server1" are considered to be equal.
  • Method Details

    • 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 new ReplicationServerId 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 new ReplicationServerId 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 interface ServerId<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 interface ServerId<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 interface ServerId<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 interface Comparable<ReplicationServerId>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object