java.lang.Object
org.opends.server.replication.protocol.ReplicationMsg
org.opends.server.replication.protocol.StopMsg

public final class StopMsg extends ReplicationMsg
This message is part of the replication protocol. This message is sent by a server to tell a peer the communication will be terminated.
  • Constructor Details

    • StopMsg

      public StopMsg()
      Creates a message.
    • StopMsg

      public StopMsg(byte[] in)
      Creates a new message by decoding the provided byte array.
      Parameters:
      in - A byte array containing the encoded information for the message,
    • StopMsg

      public StopMsg(StopMsg.StopReason reason)
      Creates a new message with the provided reason.
      Parameters:
      reason - the reason to be sent to the peer
  • Method Details

    • getReason

      public StopMsg.StopReason getReason()
      Returns the reason for stopping sent by the peer.
      Returns:
      the reason for stopping sent by the peer
    • 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.
    • toString

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

      public static boolean isCloseNoNotify(ReplicationMsg message)
      Checks whether the provided message is a stop message with a reason set to StopMsg.StopReason.CLOSE_NO_NOTIFY.
      Parameters:
      message - The message to check
      Returns:
      true only if message is a StopMsg with StopMsg.StopReason.CLOSE_NO_NOTIFY.