Class AddMsg

  • 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 Detail

      • 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 Detail

      • 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.
      • 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.