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
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendEclIncludes
(ByteStringBuilder builder) Appends the encoded attributes to the provided builder.Create a request from this message.abstract ChangeRecord
createRequest
(Dn newDN) Create a request from this message using the provided DN.static LDAPUpdateMsg
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.getDN()
Get the DN on which the operation happened.Returns the list of entry attributes.Get the entryUUID of the entry on which the operation happened.void
Set the DN.void
setEclIncludes
(Collection<Attribute> entryAttrs) Set a provided list of entry attributes.abstract int
size()
Return the number of bytes used by this message.toJson()
Returns the json representation of this update message.toString()
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
-
Constructor Details
-
LDAPUpdateMsg
protected LDAPUpdateMsg()Creates a new UpdateMsg.
-
-
Method Details
-
generateMsg
Generates an Update message with the provided information.- Parameters:
op
- The operation for which the message must be created.- Returns:
- The generated message.
-
getDN
Get the DN on which the operation happened.- Returns:
- The DN on which the operations happened.
-
setDN
Set the DN.- Parameters:
dn
- The dn that must now be used for this message.
-
getEntryUUID
Get the entryUUID of the entry on which the operation happened.- Returns:
- The entryUUID of the entry on which the operation happened.
-
createRequest
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
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
Appends the encoded attributes to the provided builder.- Parameters:
builder
- TheByteStringBuilder
where the encoded attributes will be appended.
-
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. -
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.
-
toString
-
toJson
Description copied from class:UpdateMsg
Returns the json representation of this update message. -
size
public abstract int size()Description copied from class:UpdateMsg
Return the number of bytes used by this message. -
setEclIncludes
Set a provided list of entry attributes.- Parameters:
entryAttrs
- The provided list of entry attributes.
-
getEclIncludes
Returns the list of entry attributes.- Returns:
- The list of entry attributes.
-