Class ModifyDNMsg

    • Constructor Detail

      • ModifyDNMsg

        public ModifyDNMsg​(PostOperationModifyDNOperation operation)
        Construct a new Modify DN message.
        Parameters:
        operation - The operation to use for building the message
      • ModifyDNMsg

        public ModifyDNMsg​(DN dn,
                           CSN csn,
                           String entryUUID,
                           String newSuperiorEntryUUID,
                           boolean deleteOldRdn,
                           String newSuperior,
                           String newRDN)
        Construct a new Modify DN message (no mods). Note: Keep this constructor version to support already written tests, not using mods.
        Parameters:
        dn - The dn to use for building the message.
        csn - The CSN to use for building the message.
        entryUUID - The unique id to use for building the message.
        newSuperiorEntryUUID - The new parent unique id to use for building the message.
        deleteOldRdn - boolean indicating if old rdn must be deleted to use for building the message.
        newSuperior - The new Superior entry to use for building the message.
        newRDN - The new Rdn to use for building the message.
      • ModifyDNMsg

        public ModifyDNMsg​(DN dn,
                           CSN csn,
                           String entryUUID,
                           String newSuperiorEntryUUID,
                           boolean deleteOldRdn,
                           String newSuperior,
                           String newRDN,
                           List<Modification> mods)
        Construct a new Modify DN message (with mods).
        Parameters:
        dn - The dn to use for building the message.
        csn - The CSNto use for building the message.
        entryUUID - The unique id to use for building the message.
        newSuperiorEntryUUID - The new parent unique id to use for building the message.
        deleteOldRdn - boolean indicating if old rdn must be deleted to use for building the message.
        newSuperior - The new Superior entry to use for building the message.
        newRDN - The new Rdn to use for building the message.
        mods - The mod of the operation.
    • Method Detail

      • getBytes_V1

        public byte[] getBytes_V1()
        Description copied from class: LDAPUpdateMsg
        Get the byte array representation of this message. This uses the version 1 of the replication protocol (used for compatibility purpose).
        Specified by:
        getBytes_V1 in class LDAPUpdateMsg
        Returns:
        The byte array representation of this message.
      • getBytes_V23

        public byte[] getBytes_V23()
        Description copied from class: LDAPUpdateMsg
        Get the byte array representation of this message. This uses the version 2 of the replication protocol (used for compatibility purpose).
        Specified by:
        getBytes_V23 in class LDAPUpdateMsg
        Returns:
        The byte array representation of this message.
      • getBytes_V45

        public byte[] getBytes_V45​(short protocolVersion)
        Description copied from class: LDAPUpdateMsg
        Get the byte array representation of this message. This uses the provided version number which must be version 4 or newer.
        Specified by:
        getBytes_V45 in class LDAPUpdateMsg
        Parameters:
        protocolVersion - the actual protocol version to encode into
        Returns:
        The byte array representation of this Message.
      • setNewSuperior

        public void setNewSuperior​(String string)
        Set the new superior.
        Parameters:
        string - the new superior.
      • getNewSuperior

        public String getNewSuperior()
        Get the new superior.
        Returns:
        The new superior.
      • getNewSuperiorEntryUUID

        public String getNewSuperiorEntryUUID()
        Get the new superior id.
        Returns:
        The new superior id.
      • deleteOldRdn

        public boolean deleteOldRdn()
        Get the delete old rdn option.
        Returns:
        The delete old rdn option.
      • setNewSuperiorEntryUUID

        public void setNewSuperiorEntryUUID​(String newSup)
        Set the new superior id.
        Parameters:
        newSup - The new superior id.
      • setDeleteOldRdn

        public void setDeleteOldRdn​(boolean delete)
        Set the delete old rdn option.
        Parameters:
        delete - The delete old rdn option.
      • getDeleteOldRdn

        public boolean getDeleteOldRdn()
        Get the delete old rdn option.
        Returns:
        true if delete old rdn option
      • getNewRDN

        public String getNewRDN()
        Get the new RDN of this operation.
        Returns:
        The new RDN of this operation.
      • setNewRDN

        public void setNewRDN​(String newRDN)
        Set the new RDN of this operation.
        Parameters:
        newRDN - the new RDN of this operation.
      • newDNIsParent

        public boolean newDNIsParent​(DN targetDn)
        Check if this MSG will change the DN of the target entry to be the same as the dn given as a parameter.
        Parameters:
        targetDn - the DN to use when checking if this MSG will change the DN of the entry to a given DN.
        Returns:
        A boolean indicating if the modify DN MSG will change the DN of the target entry to be the same as the dn given as a parameter.
      • newDNIsEqual

        public boolean newDNIsEqual​(DN targetDN)
        Check if the new dn of this ModifyDNMsg is the same as the targetDN given in parameter.
        Parameters:
        targetDN - The targetDN to use to check for equality.
        Returns:
        A boolean indicating if the targetDN if the same as the new DN of the ModifyDNMsg.
      • newParentIsEqual

        public boolean newParentIsEqual​(DN targetDN)
        Check if the new parent of the modifyDNMsg is the same as the targetDN given in parameter.
        Parameters:
        targetDN - the targetDN to use when checking equality.
        Returns:
        A boolean indicating if the new parent of the modifyDNMsg is the same as the targetDN.
      • size

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