Class LDAPUpdateMsg

    • Field Detail

      • dn

        protected DN dn
        The DN on which the update was originally done.
      • entryUUID

        protected String entryUUID
        The entryUUID of the entry that was updated.
      • bytes

        protected byte[] bytes
        Encoded form of the LDAPUpdateMsg.
      • encodedEclIncludes

        protected byte[] encodedEclIncludes
        Encoded form of entry attributes.
    • Constructor Detail

      • LDAPUpdateMsg

        protected LDAPUpdateMsg()
        Creates a new UpdateMsg.
    • 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 String getEntryUUID()
        Get the entryUUID of the entry on which the operation happened.
        Returns:
        The entryUUID of the entry on which the operation happened.
      • encode

        public void encode()
        Do all the work necessary for the encoding. This is useful in case when one wants to perform this outside of a synchronized portion of code. This method is not synchronized and therefore not MT safe.
      • encodeHeader

        public ByteArrayBuilder encodeHeader​(byte msgType,
                                             short protocolVersion)
        Encode the common header for all the UpdateMsg. This uses the current protocol version.
        Overrides:
        encodeHeader in class UpdateMsg
        Parameters:
        msgType - The type of UpdateMsg to encode.
        protocolVersion - The ProtocolVersion to use when encoding.
        Returns:
        a byte array builder containing the common header
      • getBytes

        public byte[] getBytes​(short protocolVersion)
        This implementation is only called during unit testing, so we are free to force the protocol version. Underlying implementations override this method in order to provide version specific encodings. 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.
        Overrides:
        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.
      • getBytes_V1

        protected abstract byte[] getBytes_V1()
        Get the byte array representation of this message. This uses the version 1 of the replication protocol (used for compatibility purpose).
        Returns:
        The byte array representation of this message.
      • getBytes_V23

        protected abstract byte[] getBytes_V23()
        Get the byte array representation of this message. This uses the version 2 of the replication protocol (used for compatibility purpose).
        Returns:
        The byte array representation of this message.
      • getBytes_V45

        protected abstract byte[] getBytes_V45​(short protocolVersion)
        Get the byte array representation of this message. This uses the provided version number which must be version 4 or newer.
        Parameters:
        protocolVersion - the actual protocol version to encode into
        Returns:
        The byte array representation of this Message.
      • size

        public abstract int size()
        Return the number of bytes used by this message.
        Overrides:
        size in class UpdateMsg
        Returns:
        The number of bytes used by this message.
      • headerSize

        protected int headerSize()
        Return the number of bytes used by the header.
        Returns:
        The number of bytes used by the header.
      • setEclIncludes

        public void setEclIncludes​(Collection<Attribute> entryAttrs)
        Set a provided list of entry attributes.
        Parameters:
        entryAttrs - The provided list of entry attributes.
      • getEclIncludes

        public ArrayList<RawAttribute> getEclIncludes()
        Returns the list of entry attributes.
        Returns:
        The list of entry attributes.