Class TopologyMsg


  • public final class TopologyMsg
    extends ReplicationMsg
    This class defines a message that is sent:
    • By a RS to the other RSs in the topology, containing:
      • every DSs directly connected to the RS in the DS infos
      • every connected RSs (including the sending RS) in the RS infos
    • By a RS to his connected DSs, containing.
      • every DSs the RS knows, except the destinator DS in the DS infos
      • every connected RSs (including the sending RS) in the RS infos
    Exchanging these messages allows to have each RS or DS take appropriate decisions according to the current topology:
    • a RS can route a message to a DS
    • a DS can decide towards which peer DS send referrals ...

    Its network encoding changed in V11 by using a simplified format, in ASN.1. The new definition is as follows:

     TopologyMsg ::= [APPLICATION 1] CHOICE {
          v11 PayloadV11
     }
    
     PayloadV11 ::= SEQUENCE {
          dsInfo ::= SET OF SEQUENCE {
              protocolVersion     INTEGER
              replicaId           PrintableString
              adminEndpoint       PrintableString
              groupId             PrintableString
              replicationServerId PrintableString
              generationId        INTEGER
              status              INTEGER
              processId           ProcessID
              refUrls ::= SET OF {
                  url             PrintableString
              }
              eclIncludes :: SET OF {
                  attributeName   PrintableString
              }
              eclIncludesForDeletes ::= SET OF {
                  attributeName   PrintableString
              }
              adminHostPorts      HostPorts
              ldapEndpoints ::= SEQUENCE {
                  connSecurity    INTEGER
                  endpoints       HostPorts
              }
          }
          rsInfo ::= SET OF SEQUENCE {
              replicationServerId PrintableString
              changelogEndpoint   PrintableString
              groupId             PrintableString
              generationId        INTEGER
              weight              INTEGER
              processId           ProcessID
              adminEndpoints      HostPorts
          }
     }
    
     ProcessID ::= SEQUENCE {
         mostSigBits     INTEGER
         leastSigBits    INTEGER
     }
    
     HostPorts ::= SET OF {
         host        PrintableString
         port        INTEGER
     }
     
    • Constructor Detail

      • TopologyMsg

        public TopologyMsg​(Collection<DSInfo> dsInfos,
                           List<RSInfo> rsInfos)
        Creates a new message of the currently connected servers.
        Parameters:
        dsInfos - The collection of currently connected DS servers ID.
        rsInfos - The list of currently connected RS servers ID.
    • Method Detail

      • getBytes

        public byte[] getBytes​(short version)
        Description copied from class: ReplicationMsg
        Serializes the PDU using the provided replication protocol version. WARNING: should be overwritten by a PDU (sub class) we want to support older protocol version serialization for.
        Specified by:
        getBytes in class ReplicationMsg
        Parameters:
        version - The protocol version to use for serialization. The version should normally be older than the current one.
        Returns:
        The encoded PDU, or null if the message isn't supported in that protocol version.
      • getReplicaInfos

        public List<DSInfo> getReplicaInfos()
        Returns the information about DSs in the topology.
        Returns:
        The DS infos
      • getRsInfos

        public List<RSInfo> getRsInfos()
        Get the RS infos.
        Returns:
        The RS infos