Class StopMsg
java.lang.Object
org.opends.server.replication.protocol.ReplicationMsg
org.opends.server.replication.protocol.StopMsg
This message is part of the replication protocol. This message is sent by a server to tell a peer the communication
will be terminated.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe reason why the connection might be terminated. -
Field Summary
Fields inherited from class org.opends.server.replication.protocol.ReplicationMsg
MSG_TYPE_DISK_ENCODING -
Constructor Summary
ConstructorsConstructorDescriptionStopMsg()Creates a message.StopMsg(byte[] in) Creates a new message by decoding the provided byte array.StopMsg(StopMsg.StopReason reason) Creates a new message with the provided reason. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes(short protocolVersion) Serializes the PDU using the provided replication protocol version.Returns the reason for stopping sent by the peer.static booleanisCloseNoNotify(ReplicationMsg message) Checks whether the providedmessageis astop messagewith a reason set toStopMsg.StopReason.CLOSE_NO_NOTIFY.toString()Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
decodeMsg, isRetryable
-
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
Creates a new message with the provided reason.- Parameters:
reason- the reason to be sent to the peer
-
-
Method Details
-
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:ReplicationMsgSerializes 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:
getBytesin classReplicationMsg- Parameters:
protocolVersion- The protocol version to use for serialization. The version should normally be older than the current one.- Returns:
- The encoded PDU, or
nullif the message isn't supported in that protocol version.
-
toString
-
isCloseNoNotify
Checks whether the providedmessageis astop messagewith a reason set toStopMsg.StopReason.CLOSE_NO_NOTIFY.- Parameters:
message- The message to check- Returns:
trueonly ifmessageis aStopMsgwithStopMsg.StopReason.CLOSE_NO_NOTIFY.
-