Class 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.
  • Constructor Details

    • LDAPUpdateMsg

      protected LDAPUpdateMsg()
      Creates a new UpdateMsg.
  • Method Details

    • 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 exception
      IOException - In case of ASN1 decoding exception
    • appendEclIncludes

      public void appendEclIncludes(ByteStringBuilder builder)
      Appends the encoded attributes to the provided builder.
      Parameters:
      builder - The ByteStringBuilder 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.
      Specified by:
      getBytes in class UpdateMsg
      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.
    • 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

      public String toString()
      Overrides:
      toString in class UpdateMsg
    • toJson

      public JsonValue toJson()
      Description copied from class: UpdateMsg
      Returns the json representation of this update message.
      Overrides:
      toJson in 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.
      Specified by:
      size in class UpdateMsg
      Returns:
      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.
    • getEclIncludes

      public List<Attribute> getEclIncludes()
      Returns the list of entry attributes.
      Returns:
      The list of entry attributes.