Class SuffixDescriptor

  • All Implemented Interfaces:
    Comparable<SuffixDescriptor>

    public class SuffixDescriptor
    extends Object
    implements Comparable<SuffixDescriptor>
    The object of this class represent a topology of replicas across servers that have the same suffix DN. If there is more than one replica on the suffix, the contents of the replicas are replicated.
    • Constructor Detail

      • SuffixDescriptor

        public SuffixDescriptor​(DN suffixDn,
                                ReplicaDescriptor replica)
        Builds a new SuffixDescriptor.
        Parameters:
        suffixDn - the suffix DN
        replica - the replica
    • Method Detail

      • getDN

        public DN getDN()
        Returns the DN associated with this suffix descriptor.
        Returns:
        the DN associated with this suffix descriptor.
      • setDN

        public void setDN​(DN suffixDN)
        Sets the DN associated with this suffix descriptor.
        Parameters:
        suffixDN - the DN associated with this suffix descriptor.
      • getReplicas

        public Set<ReplicaDescriptor> getReplicas()
        Returns the replicas associated with this SuffixDescriptor.
        Returns:
        a Set containing the replicas associated with this SuffixDescriptor.
      • getReplicationServers

        public Set<HostPort> getReplicationServers()
        Returns the Set of Replication servers for the whole suffix topology. The servers are provided in their String representation.
        Returns:
        the Set of Replication servers for the whole suffix topology.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getId

        public String getId()
        Returns an Id that is unique for this suffix.

        The id is built from the suffix DN and the ids of the servers holding a replica of it. The server ids are sorted because getReplicas() hands out a HashSet of ReplicaDescriptors, which do not override hashCode(): without the sort, two descriptors describing the same suffix on the same servers could produce different ids depending on the iteration order.

        Returns:
        an Id that is unique for this suffix.