Class EntryMsg
- java.lang.Object
-
- org.opends.server.replication.protocol.ReplicationMsg
-
- org.opends.server.replication.protocol.RoutableMsg
-
- org.opends.server.replication.protocol.EntryMsg
-
public class EntryMsg extends RoutableMsg
This message is part of the replication protocol. This message is sent by a server to one or several other servers and contain one entry to be sent over the protocol in the context of an import/export over the protocol.
-
-
Field Summary
-
Fields inherited from class org.opends.server.replication.protocol.RoutableMsg
ALL_SERVERS, destination, senderID, THE_CLOSEST_SERVER, UNKNOWN_SERVER
-
Fields inherited from class org.opends.server.replication.protocol.ReplicationMsg
MSG_TYPE_DISK_ENCODING
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getBytes(short version)Serializes the PDU using the provided replication protocol version.byte[]getEntryBytes()Returns the entry bytes.intgetMsgId()Return the msg id.voidsetMsgId(int msgId)Set the msg id.-
Methods inherited from class org.opends.server.replication.protocol.RoutableMsg
getDestination, getSenderID, toString
-
Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
generateMsg, isEncodableFor
-
-
-
-
Constructor Detail
-
EntryMsg
public EntryMsg(int serverID, int destination, byte[] entryBytes, int msgId)Creates a new EntryMsg.- Parameters:
serverID- The sender of this message.destination- The destination of this message.entryBytes- The bytes of the entry.msgId- Message counter.
-
EntryMsg
public EntryMsg(int serverID, int destination, byte[] entryBytes, int startPos, int length, int msgId)Creates a new EntryMsg.- Parameters:
serverID- The sender of this message.destination- The destination of this message.entryBytes- The bytes of the entry.startPos- The starting Position in the array.length- Number of array elements to be copied.msgId- Message counter.
-
-
Method Detail
-
getEntryBytes
public byte[] getEntryBytes()
Returns the entry bytes.- Returns:
- The entry bytes.
-
getBytes
public byte[] getBytes(short version)
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:
getBytesin classReplicationMsg- Parameters:
version- 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.
-
getMsgId
public int getMsgId()
Return the msg id.- Returns:
- The msg id.
-
setMsgId
public void setMsgId(int msgId)
Set the msg id.- Parameters:
msgId- The msg id.
-
-