Class MonitorMsg


  • public class MonitorMsg
    extends ReplicationMsg
    This message is part of the replication protocol. RS1 sends a MonitorRequestMessage to RS2 to requests its monitoring information. When RS2 receives a MonitorRequestMessage from RS1, RS2 responds with a MonitorMsg.
    • Constructor Detail

      • MonitorMsg

        public MonitorMsg​(int sender,
                          int destination)
        Creates a new MonitorMsg.
        Parameters:
        sender - The sender of this message.
        destination - The destination of this message.
    • Method Detail

      • setReplServerDbState

        public void setReplServerDbState​(ServerState state)
        Sets the state of the replication server.
        Parameters:
        state - The state.
      • setServerState

        public void setServerState​(int serverId,
                                   ServerState state,
                                   long approxFirstMissingDate,
                                   boolean isLDAPServer)
        Sets the information of an LDAP server.
        Parameters:
        serverId - The serverID.
        state - The server state.
        approxFirstMissingDate - The approximation of the date of the older missing change. null when none.
        isLDAPServer - Specifies whether the server is a DS or a RS
      • getLDAPServerState

        public ServerState getLDAPServerState​(int serverId)
        Get the server state for the LDAP server with the provided serverId.
        Parameters:
        serverId - The provided serverId.
        Returns:
        The state.
      • getRSServerState

        public ServerState getRSServerState​(int serverId)
        Get the server state for the RS server with the provided serverId.
        Parameters:
        serverId - The provided serverId.
        Returns:
        The state.
      • getLDAPApproxFirstMissingDate

        public long getLDAPApproxFirstMissingDate​(int serverId)
        Get the approximation of the date of the older missing change for the LDAP Server with the provided server Id.
        Parameters:
        serverId - The provided serverId.
        Returns:
        The approximated state.
      • getRSApproxFirstMissingDate

        public long getRSApproxFirstMissingDate​(int serverId)
        Get the approximation of the date of the older missing change for the RS Server with the provided server Id.
        Parameters:
        serverId - The provided serverId.
        Returns:
        The approximated state.
      • getBytes

        public byte[] getBytes​(short protocolVersion)
        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:
        protocolVersion - 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.
      • getReplServerDbState

        public ServerState getReplServerDbState()
        Get the state of the replication server that sent this message.
        Returns:
        The state.
      • ldapIterator

        public Iterator<Integer> ldapIterator()
        Returns an iterator on the serverId of the connected LDAP servers.
        Returns:
        The iterator.
      • rsIterator

        public Iterator<Integer> rsIterator()
        Returns an iterator on the serverId of the connected RS servers.
        Returns:
        The iterator.
      • getDestination

        public int getDestination()
        Get the destination.
        Returns:
        the destination
      • getSenderID

        public int getSenderID()
        Get the server ID of the server that sent this message.
        Returns:
        the server id