Class ChangeStatusMsg
- java.lang.Object
-
- org.opends.server.replication.protocol.ReplicationMsg
-
- org.opends.server.replication.protocol.ChangeStatusMsg
-
public final class ChangeStatusMsg extends ReplicationMsg
This message is used by the replica to tell the replication server he is changing his status (new status field used), or by the replication server to request that the replica changes his status (requested status field used).
-
-
Field Summary
-
Fields inherited from class org.opends.server.replication.protocol.ReplicationMsg
COMPACT_MASK, COMPACT_TYPE_ADD, COMPACT_TYPE_DELETE, COMPACT_TYPE_MODIFY, COMPACT_TYPE_MODIFY_DN, COMPACT_TYPE_REPLICA_OFFLINE, MSG_TYPE_DISK_ENCODING
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getBytes(short protocolVersion)
Serializes the PDU using the provided replication protocol version.ServerStatus
getNewStatus()
Get the new status, i.e.ServerStatus
getRequestedStatus()
Get the requested status, i.e.static ChangeStatusMsg
requestThatDsChangesStatusTo(ServerStatus requestedStatus)
Create a new ChangeStatusMsg suitable for sending from a replication server to a replica.static ChangeStatusMsg
signalThatDsStatusChangedTo(ServerStatus newStatus)
Create a new ChangeStatusMsg suitable for sending from a replica to a replication server.String
toString()
-
Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
decodeMsg, isRetryable
-
-
-
-
Method Detail
-
requestThatDsChangesStatusTo
public static ChangeStatusMsg requestThatDsChangesStatusTo(ServerStatus requestedStatus)
Create a new ChangeStatusMsg suitable for sending from a replication server to a replica. This message means the RS requests that the DS changes its status to the requested status. This request may fail if the transition is not allowed (for example, the DS may already have transitioned to a different status).- Parameters:
requestedStatus
- The requested status- Returns:
- a ChangeStatusMsg object that can be used by an RS to request that a DS changes its status to the provided one
-
signalThatDsStatusChangedTo
public static ChangeStatusMsg signalThatDsStatusChangedTo(ServerStatus newStatus)
Create a new ChangeStatusMsg suitable for sending from a replica to a replication server. This message signals that the DS status has changed to the new value. Note: this change already happened somewhere in the past, and by the time this message is processed by the RS, it is possible that the DS has transitioned to yet another status.- Parameters:
newStatus
- The new status- Returns:
- a ChangeStatusMsg object that can be used by a DS to signal to its RS that it changed its status to the provided one
-
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 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
null
if the message isn't supported in that protocol version.
-
getRequestedStatus
public ServerStatus getRequestedStatus()
Get the requested status, i.e. the status we want the DS to enter (used when from RS to DS).- Returns:
- The requested status
-
getNewStatus
public ServerStatus getNewStatus()
Get the new status, i.e. the new status the DS just entered (used when from DS to RS).- Returns:
- The new status
-
-