Interface ModifyDnRequest
- All Superinterfaces:
AbandonableRequest, Message, Request, ResultResponseRequest, SingleReplyRequest
- All Known Implementing Classes:
ModifyDnRequestImpl
Modify Dn request protocol message used to rename or move an existing entry
in the directory. Here's what RFC 2251 has to say about
it:
4.9. Modify Dn Operation
The Modify Dn Operation allows a client to change the leftmost (least
significant) component of the name of an entry in the directory, or
to move a subtree of entries to a new location in the directory. The
Modify Dn Request is defined as follows:
ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
entry LDAPDN,
newrdn RelativeLDAPDN,
deleteoldrdn BOOLEAN,
newSuperior [0] LDAPDN OPTIONAL }
Parameters of the Modify Dn Request are:
- entry: the Distinguished Name of the entry to be changed. This
entry may or may not have subordinate entries.
- newrdn: the Rdn that will form the leftmost component of the new
name of the entry.
- deleteoldrdn: a boolean parameter that controls whether the old Rdn
attribute values are to be retained as attributes of the entry, or
deleted from the entry.
- newSuperior: if present, this is the Distinguished Name of the entry
which becomes the immediate superior of the existing entry.
Note that this operation can move an entry and change its Rdn at the same
time in fact it might have no choice to comply with name forms.- Author:
- Apache Directory Project
-
Method Summary
Modifier and TypeMethodDescriptionaddAllControls(Control[] controls) Adds an array of controls to this Message.addControl(Control control) Adds a control to this Message.booleanGets the flag which determines if the old Rdn attribute is to be removed from the entry when the new Rdn is used in its stead.getName()Gets the entry's distinguished name representing the entry PDU field.Gets the new relative distinguished name for the entry which represents the PDU's newrdn field.Gets the optional distinguished name of the new superior entry where the candidate entry is to be moved.booleanisMove()Gets whether or not this request is a Dn change resulting in a move operation.removeControl(Control control) Deletes a control removing it from this Message.setDeleteOldRdn(boolean deleteOldRdn) Sets the flag which determines if the old Rdn attribute is to be removed from the entry when the new Rdn is used in its stead.setMessageId(int messageId) Sets the Message ID for this requestSets the entry's distinguished name representing the entry PDU field.Sets the new relative distinguished name for the entry which represents the PDU's newrdn field.setNewSuperior(Dn newSuperior) Sets the optional distinguished name of the new superior entry where the candidate entry is to be moved.Methods inherited from interface AbandonableRequest
abandon, addAbandonListener, isAbandonedMethods inherited from interface Message
get, getControl, getControls, getMessageId, getType, hasControl, putMethods inherited from interface Request
hasResponseMethods inherited from interface ResultResponseRequest
getResultResponseMethods inherited from interface SingleReplyRequest
getResponseType
-
Method Details
-
getName
Dn getName()Gets the entry's distinguished name representing the entry PDU field.- Returns:
- the distinguished name of the entry.
-
setName
Sets the entry's distinguished name representing the entry PDU field.- Parameters:
name- the distinguished name of the entry.- Returns:
- The ModifyDnRequest instance
-
getNewRdn
Rdn getNewRdn()Gets the new relative distinguished name for the entry which represents the PDU's newrdn field.- Returns:
- the relative dn with one component
-
setNewRdn
Sets the new relative distinguished name for the entry which represents the PDU's newrdn field.- Parameters:
newRdn- the relative dn with one component- Returns:
- The ModifyDnRequest instance
-
getDeleteOldRdn
boolean getDeleteOldRdn()Gets the flag which determines if the old Rdn attribute is to be removed from the entry when the new Rdn is used in its stead. This property corresponds to the deleteoldrdn.- Returns:
- true if the old rdn is to be deleted, false if it is not
-
setDeleteOldRdn
Sets the flag which determines if the old Rdn attribute is to be removed from the entry when the new Rdn is used in its stead. This property corresponds to the deleteoldrdn.- Parameters:
deleteOldRdn- true if the old rdn is to be deleted, false if it is not- Returns:
- The ModifyDnRequest instance
-
getNewSuperior
Dn getNewSuperior()Gets the optional distinguished name of the new superior entry where the candidate entry is to be moved. This property corresponds to the PDU's newSuperior field. May be null representing a simple Rdn change rather than a move operation.- Returns:
- the dn of the superior entry the candidate entry is moved under.
-
setNewSuperior
Sets the optional distinguished name of the new superior entry where the candidate entry is to be moved. This property corresponds to the PDU's newSuperior field. May be null representing a simple Rdn change rather than a move operation. Setting this property to a non-null value toggles the move flag obtained via theisMovemethod.- Parameters:
newSuperior- the dn of the superior entry the candidate entry for Dn modification is moved under.- Returns:
- The ModifyDnRequest instance
-
isMove
boolean isMove()Gets whether or not this request is a Dn change resulting in a move operation. Setting the newSuperior property to a non-null name, toggles this flag.- Returns:
- true if the newSuperior property is NOT null, false otherwise.
-
setMessageId
Sets the Message ID for this request- Specified by:
setMessageIdin interfaceMessage- Parameters:
messageId- The message Id- Returns:
- A Message reference
-
addControl
Adds a control to this Message.- Specified by:
addControlin interfaceMessage- Parameters:
control- the control to add.- Returns:
- A Message reference
-
addAllControls
Adds an array of controls to this Message.- Specified by:
addAllControlsin interfaceMessage- Parameters:
controls- the controls to add.- Returns:
- A Message reference
-
removeControl
Deletes a control removing it from this Message.- Specified by:
removeControlin interfaceMessage- Parameters:
control- the control to remove.- Returns:
- A Message reference
-