org.apache.directory.api.dsmlv2.request
Class ModifyDNRequestDsml

java.lang.Object
  extended by org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator<E>
      extended by org.apache.directory.api.dsmlv2.request.AbstractRequestDsml<E>
          extended by org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml<ModifyDnRequest,ModifyDnResponse>
              extended by org.apache.directory.api.dsmlv2.request.ModifyDNRequestDsml
All Implemented Interfaces:
DsmlDecorator<ModifyDnRequest>, AbandonableRequest, Message, ModifyDnRequest, Request, ResultResponseRequest<ModifyDnResponse>, SingleReplyRequest<ModifyDnResponse>

public class ModifyDNRequestDsml
extends AbstractResultResponseRequestDsml<ModifyDnRequest,ModifyDnResponse>
implements ModifyDnRequest

DSML Decorator for ModifyDNRequest

Author:
Apache Directory Project

Field Summary
 
Fields inherited from interface org.apache.directory.api.ldap.model.message.ModifyDnRequest
RESP_TYPE, TYPE
 
Constructor Summary
ModifyDNRequestDsml(LdapApiService codec)
          Creates a new getDecoratedMessage() of ModifyDNRequestDsml.
ModifyDNRequestDsml(LdapApiService codec, ModifyDnRequest ldapMessage)
          Creates a new getDecoratedMessage() of ModifyDNRequestDsml.
 
Method Summary
 ModifyDnRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 ModifyDnRequest addControl(Control control)
          Adds a control to this Message.
 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.
 Dn getName()
          Get the modification's Dn
 Rdn getNewRdn()
          Gets the new relative distinguished name for the entry which represents the PDU's newrdn field.
 Rdn getNewRDN()
          Get the new Rdn
 Dn getNewSuperior()
          Get the newSuperior
 MessageTypeEnum getResponseType()
          Gets the protocol response message type for this request which produces at least one response.
 MessageTypeEnum getType()
          Gets the LDAP message type code associated with this Message.
 boolean isDeleteOldRDN()
          Tells if the old Rdn is to be deleted
 boolean isMove()
          Gets whether or not this request is a Dn change resulting in a move operation.
 ModifyDnRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 ModifyDnRequest 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.
 void setDeleteOldRDN(boolean deleteOldRDN)
          Set the flag to delete the old Rdn
 void setEntry(Dn name)
          Set the modification Dn.
 ModifyDnRequest setMessageId(int messageId)
          Sets the Message ID for this request
 ModifyDnRequest setName(Dn name)
          Sets the entry's distinguished name representing the entry PDU field.
 ModifyDnRequest setNewRdn(Rdn newRdn)
          Sets the new relative distinguished name for the entry which represents the PDU's newrdn field.
 void setNewRDN(Rdn newRdn)
          Set the new Rdn
 ModifyDnRequest setNewSuperior(Dn newSuperior)
          Set the new superior
 org.dom4j.Element toDsml(org.dom4j.Element root)
          Creates the Request Element and adds RequestID and Controls.
 
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractResultResponseRequestDsml
abandon, addAbandonListener, computeLength, encode, getResultResponse, isAbandoned
 
Methods inherited from class org.apache.directory.api.dsmlv2.request.AbstractRequestDsml
hasResponse
 
Methods inherited from class org.apache.directory.api.dsmlv2.AbstractDsmlMessageDecorator
get, getCodecService, getControl, getControls, getCurrentControl, getDecorated, getMessageId, hasControl, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest
getResultResponse
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
get, getControl, getControls, getMessageId, hasControl, put
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
 

Constructor Detail

ModifyDNRequestDsml

public ModifyDNRequestDsml(LdapApiService codec)
Creates a new getDecoratedMessage() of ModifyDNRequestDsml.


ModifyDNRequestDsml

public ModifyDNRequestDsml(LdapApiService codec,
                           ModifyDnRequest ldapMessage)
Creates a new getDecoratedMessage() of ModifyDNRequestDsml.

Parameters:
ldapMessage - the message to decorate
Method Detail

getType

public MessageTypeEnum getType()
Gets the LDAP message type code associated with this Message. Each request and response type has a unique message type code defined by the protocol in RFC 2251.

Specified by:
getType in interface Message
Overrides:
getType in class AbstractDsmlMessageDecorator<ModifyDnRequest>
Returns:
the message type code.

toDsml

public org.dom4j.Element toDsml(org.dom4j.Element root)
Creates the Request Element and adds RequestID and Controls.

Specified by:
toDsml in interface DsmlDecorator<ModifyDnRequest>
Overrides:
toDsml in class AbstractResultResponseRequestDsml<ModifyDnRequest,ModifyDnResponse>
Parameters:
root - the root element
Returns:
the Request Element of the given name containing

getName

public Dn getName()
Get the modification's Dn

Specified by:
getName in interface ModifyDnRequest
Returns:
Returns the name.

setEntry

public void setEntry(Dn name)
Set the modification Dn.

Parameters:
name - The name to set.

isDeleteOldRDN

public boolean isDeleteOldRDN()
Tells if the old Rdn is to be deleted

Returns:
Returns the deleteOldRDN.

setDeleteOldRDN

public void setDeleteOldRDN(boolean deleteOldRDN)
Set the flag to delete the old Rdn

Parameters:
deleteOldRDN - The deleteOldRDN to set.

getNewRDN

public Rdn getNewRDN()
Get the new Rdn

Returns:
Returns the newRDN.

setNewRDN

public void setNewRDN(Rdn newRdn)
Set the new Rdn

Parameters:
newRdn - The newRdn to set.

getNewSuperior

public Dn getNewSuperior()
Get the newSuperior

Specified by:
getNewSuperior in interface ModifyDnRequest
Returns:
Returns the newSuperior.

setNewSuperior

public ModifyDnRequest setNewSuperior(Dn newSuperior)
Set the new superior

Specified by:
setNewSuperior in interface ModifyDnRequest
Parameters:
newSuperior - The newSuperior to set.
Returns:
The ModifyDnRequest instance

getResponseType

public MessageTypeEnum getResponseType()
Gets the protocol response message type for this request which produces at least one response.

Specified by:
getResponseType in interface SingleReplyRequest<ModifyDnResponse>
Returns:
the message type of the response.

setName

public ModifyDnRequest setName(Dn name)
Sets the entry's distinguished name representing the entry PDU field.

Specified by:
setName in interface ModifyDnRequest
Parameters:
name - the distinguished name of the entry.
Returns:
The ModifyDnRequest instance

getNewRdn

public Rdn getNewRdn()
Gets the new relative distinguished name for the entry which represents the PDU's newrdn field.

Specified by:
getNewRdn in interface ModifyDnRequest
Returns:
the relative dn with one component

setNewRdn

public ModifyDnRequest setNewRdn(Rdn newRdn)
Sets the new relative distinguished name for the entry which represents the PDU's newrdn field.

Specified by:
setNewRdn in interface ModifyDnRequest
Parameters:
newRdn - the relative dn with one component
Returns:
The ModifyDnRequest instance

getDeleteOldRdn

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

Specified by:
getDeleteOldRdn in interface ModifyDnRequest
Returns:
true if the old rdn is to be deleted, false if it is not

setDeleteOldRdn

public ModifyDnRequest 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. This property corresponds to the deleteoldrdn.

Specified by:
setDeleteOldRdn in interface ModifyDnRequest
Parameters:
deleteOldRdn - true if the old rdn is to be deleted, false if it is not
Returns:
The ModifyDnRequest instance

isMove

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

Specified by:
isMove in interface ModifyDnRequest
Returns:
true if the newSuperior property is NOT null, false otherwise.

setMessageId

public ModifyDnRequest setMessageId(int messageId)
Sets the Message ID for this request

Specified by:
setMessageId in interface Message
Specified by:
setMessageId in interface ModifyDnRequest
Overrides:
setMessageId in class AbstractDsmlMessageDecorator<ModifyDnRequest>
Parameters:
messageId - The message Id
Returns:
A Message reference

addControl

public ModifyDnRequest addControl(Control control)
                           throws MessageException
Adds a control to this Message.

Specified by:
addControl in interface Message
Specified by:
addControl in interface ModifyDnRequest
Overrides:
addControl in class AbstractDsmlMessageDecorator<ModifyDnRequest>
Parameters:
control - the control to add.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.

addAllControls

public ModifyDnRequest addAllControls(Control[] controls)
                               throws MessageException
Adds an array of controls to this Message.

Specified by:
addAllControls in interface Message
Specified by:
addAllControls in interface ModifyDnRequest
Overrides:
addAllControls in class AbstractDsmlMessageDecorator<ModifyDnRequest>
Parameters:
controls - the controls to add.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or they are not known etc.

removeControl

public ModifyDnRequest removeControl(Control control)
                              throws MessageException
Deletes a control removing it from this Message.

Specified by:
removeControl in interface Message
Specified by:
removeControl in interface ModifyDnRequest
Overrides:
removeControl in class AbstractDsmlMessageDecorator<ModifyDnRequest>
Parameters:
control - the control to remove.
Returns:
A Message reference
Throws:
MessageException - if controls cannot be added to this Message or the control is not known etc.


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.