Class LDAPUpdateMsg
- java.lang.Object
-
- org.opends.server.replication.protocol.ReplicationMsg
-
- org.opends.server.replication.protocol.UpdateMsg
-
- org.opends.server.replication.protocol.LDAPUpdateMsg
-
- All Implemented Interfaces:
Comparable<UpdateMsg>
- Direct Known Subclasses:
AddMsg,DeleteMsg,ModifyCommonMsg
public abstract class LDAPUpdateMsg extends UpdateMsg
Abstract class that must be extended to define a message used for sending Updates between servers.
-
-
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLDAPUpdateMsg()Creates a new UpdateMsg.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidappendEclIncludes(ByteStringBuilder builder)Appends the encoded attributes to the provided builder.ChangeRecordcreateRequest()Create a request from this message.abstract ChangeRecordcreateRequest(Dn newDN)Create a request from this message using the provided DN.static LDAPUpdateMsggenerateMsg(PostOperationOperation op)Generates an Update message with the provided information.byte[]getBytes(short protocolVersion)Serializes the PDU using the provided replication protocol version.protected abstract byte[]getBytesLatest(short protocolVersion)Get the byte array representation of this message.DngetDN()Get the DN on which the operation happened.List<Attribute>getEclIncludes()Returns the list of entry attributes.UUIDgetEntryUUID()Get the entryUUID of the entry on which the operation happened.voidsetDN(Dn dn)Set the DN.voidsetEclIncludes(Collection<Attribute> entryAttrs)Set a provided list of entry attributes.abstract intsize()Return the number of bytes used by this message.JsonValuetoJson()Returns the json representation of this update message.StringtoString()-
Methods inherited from class org.opends.server.replication.protocol.UpdateMsg
accept, compareTo, equals, getBytes, getCSN, getVersion, hashCode
-
Methods inherited from class org.opends.server.replication.protocol.ReplicationMsg
decodeMsg, isRetryable
-
-
-
-
Method Detail
-
generateMsg
public static LDAPUpdateMsg generateMsg(PostOperationOperation op)
Generates an Update message with the provided information.- Parameters:
op- The operation for which the message must be created.- Returns:
- The generated message.
-
getDN
public Dn getDN()
Get the DN on which the operation happened.- Returns:
- The DN on which the operations happened.
-
setDN
public void setDN(Dn dn)
Set the DN.- Parameters:
dn- The dn that must now be used for this message.
-
getEntryUUID
public UUID getEntryUUID()
Get the entryUUID of the entry on which the operation happened.- Returns:
- The entryUUID of the entry on which the operation happened.
-
createRequest
public ChangeRecord createRequest() throws IOException
Create a request from this message.- Returns:
- the created request
- Throws:
LdapException- In case of LDAP decoding exception.IOException- In case of ASN1 decoding exception.
-
createRequest
public abstract ChangeRecord createRequest(Dn newDN) throws IOException
Create a request from this message using the provided DN.- Parameters:
newDN- the DN to use when creating the request.- Returns:
- the created request
- Throws:
LdapException- In case of LDAP decoding exceptionIOException- In case of ASN1 decoding exception
-
appendEclIncludes
public void appendEclIncludes(ByteStringBuilder builder)
Appends the encoded attributes to the provided builder.- Parameters:
builder- TheByteStringBuilderwhere the encoded attributes will be appended.
-
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.
-
getBytesLatest
protected abstract byte[] getBytesLatest(short protocolVersion)
Get the byte array representation of this message.This uses the provided version number which must be at least version 4.
- Parameters:
protocolVersion- the actual protocol version to encode into- Returns:
- The byte array representation of this Message.
-
toJson
public JsonValue toJson()
Description copied from class:UpdateMsgReturns the json representation of this update message.
-
size
public abstract int size()
Description copied from class:UpdateMsgReturn the number of bytes used by this message.
-
setEclIncludes
public void setEclIncludes(Collection<Attribute> entryAttrs)
Set a provided list of entry attributes.- Parameters:
entryAttrs- The provided list of entry attributes.
-
-