All Implemented Interfaces:
Comparable<UpdateMsg>

public final class AddMsg extends LDAPUpdateMsg
This class is used to exchange Add operation between LDAP servers and replication servers.
  • Constructor Details

    • AddMsg

      public AddMsg(CSN csn, Entry entry, UUID entryUuid, UUID parentEntryUuid)
      Creates a new AddMessage.
      Parameters:
      csn - CSN of the add.
      entry - the added entry.
      entryUuid - The Unique identifier of the added entry.
      parentEntryUuid - The unique Id of the parent of the added entry.
    • AddMsg

      public AddMsg(CSN csn, Dn dn, UUID entryUuid, UUID parentEntryUuid, byte[] encodedAttributes, byte[] encodedEclIncludes)
      Creates a new AddMessage.
      Parameters:
      csn - CSN of the add.
      dn - DN of the added entry.
      entryUuid - The Unique identifier of the added entry.
      parentEntryUuid - The unique Id of the parent of the added entry.
      encodedAttributes - The encodedAttributes of the operation.
      encodedEclIncludes - The encodedEclIncludes of the operation.
    • AddMsg

      public AddMsg(byte[] in) throws DataFormatException
      Creates a new Add message from a byte[].
      Parameters:
      in - The byte[] from which the operation must be read.
      Throws:
      DataFormatException - The input byte[] is not a valid AddMsg
  • Method Details

    • appendEncodedAttributes

      public void appendEncodedAttributes(ByteStringBuilder builder)
      Appends the encoded attributes to the provided builder.
      Parameters:
      builder - The ByteStringBuilder where the encoded attributes will be appended.
    • accept

      public <E extends Exception> void accept(UpdateMsgVisitor<E> visitor) throws E
      Description copied from class: UpdateMsg
      Applies an UpdateMsgVisitor to this UpdateMsg.
      Specified by:
      accept in class UpdateMsg
      Type Parameters:
      E - The type of the exception thrown by the visitor method if it fails, or NeverThrowsException if the visitor cannot fail.
      Parameters:
      visitor - The message visitor.
      Throws:
      E - If the visitor failed.
    • createRequest

      public AddRequest createRequest(Dn newDN)
      Description copied from class: LDAPUpdateMsg
      Create a request from this message using the provided DN.
      Specified by:
      createRequest in class LDAPUpdateMsg
      Parameters:
      newDN - the DN to use when creating the request.
      Returns:
      the created request
    • getBytesLatest

      public byte[] getBytesLatest(short protocolVersion)
      Description copied from class: LDAPUpdateMsg
      Get the byte array representation of this message.

      This uses the provided version number which must be at least version 4.

      Specified by:
      getBytesLatest in class LDAPUpdateMsg
      Parameters:
      protocolVersion - the actual protocol version to encode into
      Returns:
      The byte array representation of this Message.
    • addAttribute

      public void addAttribute(String name, Object value)
      Add the specified attribute/attribute value in the entry contained in this AddMsg.
      Parameters:
      name - The name of the attribute to add.
      value - The value of the attribute to add.
    • getAttributes

      public List<Attribute> getAttributes()
      Get the attributes of this add msg.
      Returns:
      the list of attributes
    • setParentEntryUUID

      public void setParentEntryUUID(UUID entryUUID)
      Set the parent unique id of this add msg.
      Parameters:
      entryUUID - the parent unique id.
    • getParentEntryUUID

      public UUID getParentEntryUUID()
      Get the parent unique id of this add msg.
      Returns:
      the parent unique id.
    • size

      public int size()
      Description copied from class: UpdateMsg
      Return the number of bytes used by this message.
      Specified by:
      size in class LDAPUpdateMsg
      Returns:
      The number of bytes used by this message.