Class ReplicationMsg
java.lang.Object
org.opends.server.replication.protocol.ReplicationMsg
- Direct Known Subclasses:
ChangeStatusMsg
,ChangeTimeHeartbeatMsg
,ExtendedStartMsg
,HeartbeatMsg
,InitializationMsg
,MonitorMsg
,MonitorRequestMsg
,ResetGenerationIdMsg
,StartMsg
,StartSessionMsg
,StopEncryptionMsg
,StopMsg
,TopologyMsg
,UpdateMsg
,WindowMsg
,WindowProbeMsg
Abstract class that must be used when defining messages that can be sent for replication purpose between servers.
When extending this class one should also create a new MSG_TYPE and should update the generateMsg() method.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Bitmask used to detect compact encoding of message stored inReplicationDomainDB
.static final byte
Type used by compact representation of aAddMsg
stored in aReplicationDomainDB
.static final byte
Type used by compact representation of aDeleteMsg
stored in aReplicationDomainDB
.static final byte
Type used by compact representation of aModifyMsg
stored in aReplicationDomainDB
.static final byte
Type used by compact representation of aModifyDNMsg
stored in aReplicationDomainDB
.static final byte
Type used by compact representation of aReplicaOfflineMsg
stored in aReplicationDomainDB
.static final byte
Reserved type for uses other than protocol messages. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReplicationMsg
decodeMsg
(byte[] buffer, short protocolVersion) Generates a ReplicationMsg from its encoded form.abstract byte[]
getBytes
(short protocolVersion) Serializes the PDU using the provided replication protocol version.boolean
Returns if in case of I/O error we should try to send this message again.
-
Field Details
-
MSG_TYPE_DISK_ENCODING
public static final byte MSG_TYPE_DISK_ENCODINGReserved type for uses other than protocol messages.- See Also:
-
COMPACT_MASK
public static final byte COMPACT_MASKBitmask used to detect compact encoding of message stored inReplicationDomainDB
.- See Also:
-
COMPACT_TYPE_MODIFY
public static final byte COMPACT_TYPE_MODIFYType used by compact representation of aModifyMsg
stored in aReplicationDomainDB
.- See Also:
-
COMPACT_TYPE_ADD
public static final byte COMPACT_TYPE_ADDType used by compact representation of aAddMsg
stored in aReplicationDomainDB
.- See Also:
-
COMPACT_TYPE_DELETE
public static final byte COMPACT_TYPE_DELETEType used by compact representation of aDeleteMsg
stored in aReplicationDomainDB
.- See Also:
-
COMPACT_TYPE_MODIFY_DN
public static final byte COMPACT_TYPE_MODIFY_DNType used by compact representation of aModifyDNMsg
stored in aReplicationDomainDB
.- See Also:
-
COMPACT_TYPE_REPLICA_OFFLINE
public static final byte COMPACT_TYPE_REPLICA_OFFLINEType used by compact representation of aReplicaOfflineMsg
stored in aReplicationDomainDB
.- See Also:
-
-
Constructor Details
-
ReplicationMsg
protected ReplicationMsg()Protected constructor.
-
-
Method Details
-
getBytes
public abstract byte[] getBytes(short protocolVersion) 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.- 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.
-
isRetryable
public boolean isRetryable()Returns if in case of I/O error we should try to send this message again.- Returns:
- if in case of I/O error we should try to send this message again
-
decodeMsg
public static ReplicationMsg decodeMsg(byte[] buffer, short protocolVersion) throws DataFormatException, NotSupportedOldVersionPDUException Generates a ReplicationMsg from its encoded form. This un-serialization is done taking into account the various supported replication protocol versions.- Parameters:
buffer
- The encode form of the ReplicationMsg.protocolVersion
- The version to use to decode the msg.- Returns:
- The generated SynchronizationMessage.
- Throws:
DataFormatException
- If the encoded form was not a valid msg.NotSupportedOldVersionPDUException
- If the PDU is part of an old protocol version and we do not support it.
-