Class ModifyDnMsg

All Implemented Interfaces:
Comparable<UpdateMsg>

public final class ModifyDnMsg extends ModifyCommonMsg
Message used to send Modify DN information.
  • Constructor Details

    • ModifyDnMsg

      public ModifyDnMsg(PostOperationModifyDnOperation operation)
      Builds a ModifyDnMsg.
      Parameters:
      operation - the modify DN operation that will be used to build the ModifyDnMsg
    • ModifyDnMsg

      public ModifyDnMsg(Dn dn, CSN csn, UUID entryUUID, UUID newSuperiorEntryUUID, boolean deleteOldRdn, Dn newSuperior, Rdn 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, UUID entryUUID, UUID newSuperiorEntryUUID, boolean deleteOldRdn, Dn newSuperior, Rdn 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.
    • ModifyDnMsg

      public ModifyDnMsg(CSN csn, Dn dn, UUID entryUUID, Rdn newRdn, Dn newSuperior, UUID newSuperiorEntryUUID, boolean deleteOldRdn, byte[] encodedMods, byte[] encodedEclIncludes)
      Creates a new ModifyDN message.
      Parameters:
      csn - The CSNto use for building the message.
      dn - The dn to use for building the message.
      entryUUID - The unique id to use for building the message.
      newRdn - The new Rdn to use for building the message.
      newSuperior - The new Superior entry 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.
      encodedMods - The encodedMods of the operation.
      encodedEclIncludes - The encodedEclIncludes of the operation.
  • Method Details

    • 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 ModifyDnRequest createRequest(Dn newDN) throws IOException
      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
      Throws:
      IOException - In case of ASN1 decoding exception
    • getBytesLatest

      public byte[] getBytesLatest(short protocolVersion)
      Description copied from class: LdapUpdateMsg
      Returns 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
    • toString

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

      public JsonValue toJson()
      Description copied from class: UpdateMsg
      Returns the json representation of this update message.
      Overrides:
      toJson in class LdapUpdateMsg
      Returns:
      the json representation of this update message
    • setNewSuperior

      public void setNewSuperior(Dn newSuperior)
      Set the new superior.
      Parameters:
      newSuperior - the new superior.
    • getNewSuperior

      public Dn getNewSuperior()
      Returns the new superior.
      Returns:
      the new superior
    • getNewSuperiorEntryUUID

      public UUID getNewSuperiorEntryUUID()
      Returns the new superior id.
      Returns:
      the new superior id
    • deleteOldRdn

      public boolean deleteOldRdn()
      Returns the delete old rdn option.
      Returns:
      the delete old rdn option
    • 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 Rdn getNewRDN()
      Returns the new RDN of this operation.
      Returns:
      the new RDN of this operation
    • setNewRDN

      public void setNewRDN(Rdn newRDN)
      Set the new RDN of this operation.
      Parameters:
      newRDN - the new RDN of this operation.
    • size

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