org.apache.directory.shared.ldap.codec.modifyDn
Class ModifyDNRequest

java.lang.Object
  extended byorg.apache.directory.shared.asn1.Asn1Object
      extended byorg.apache.directory.shared.ldap.codec.LdapMessage
          extended byorg.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequest

public class ModifyDNRequest
extends LdapMessage

A ModifyDNRequest Message. Its syntax is : ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { entry LDAPDN, newrdn RelativeLDAPDN, deleteoldrdn BOOLEAN, newSuperior [0] LDAPDN OPTIONAL }

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.Asn1Object
parent
 
Constructor Summary
ModifyDNRequest()
          Creates a new ModifyDNRequest object.
 
Method Summary
 int computeLength()
          Compute the ModifyDNRequest length ModifyDNRequest : 0x6C L1 | +--> 0x04 L2 entry +--> 0x04 L3 newRDN +--> 0x01 0x01 (true/false) deleteOldRDN (3 bytes) [+--> 0x80 L4 newSuperior ] L2 = Length(0x04) + Length(Length(entry)) + Length(entry) L3 = Length(0x04) + Length(Length(newRDN)) + Length(newRDN) L4 = Length(0x80) + Length(Length(newSuperior)) + Length(newSuperior) L1 = L2 + L3 + 3 [+ L4] Length(ModifyDNRequest) = Length(0x6C) + Length(L1) + L1
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the ModifyDNRequest message to a PDU.
 java.lang.String getEntry()
          Get the modification's DN
 int getMessageType()
          Get the message type
 java.lang.String getNewRDN()
          Get the new RDN
 java.lang.String getNewSuperior()
          Get the newSuperior
 boolean isDeleteOldRDN()
          Tells if the old RDN is to be deleted
 void setDeleteOldRDN(boolean deleteOldRDN)
          Set the flag to delete the old RDN
 void setEntry(javax.naming.Name entry)
          Set the modification DN.
 void setNewRDN(Rdn newRDN)
          Set the new RDN
 void setNewSuperior(javax.naming.Name newSuperior)
          Set the new superior
 java.lang.String toString()
          Get a String representation of a ModifyDNRequest
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessage
addControl, getAbandonRequest, getAddRequest, getAddResponse, getBindRequest, getBindResponse, getCompareRequest, getCompareResponse, getControls, getControls, getCurrentControl, getDelRequest, getDelResponse, getExtendedRequest, getExtendedResponse, getLdapResponse, getMessageId, getMessageTypeName, getModifyDNRequest, getModifyDNResponse, getModifyRequest, getModifyResponse, getSearchRequest, getSearchResultDone, getSearchResultEntry, getSearchResultReference, getUnBindRequest, initControl, setMessageId, setProtocolOP
 
Methods inherited from class org.apache.directory.shared.asn1.Asn1Object
addLength, getCurrentLength, getExpectedLength, getParent, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModifyDNRequest

public ModifyDNRequest()
Creates a new ModifyDNRequest object.

Method Detail

getMessageType

public int getMessageType()
Get the message type

Overrides:
getMessageType in class LdapMessage
Returns:
Returns the type.

getEntry

public java.lang.String getEntry()
Get the modification's DN

Returns:
Returns the entry.

setEntry

public void setEntry(javax.naming.Name entry)
Set the modification DN.

Parameters:
entry - The entry 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 java.lang.String 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 java.lang.String getNewSuperior()
Get the newSuperior

Returns:
Returns the newSuperior.

setNewSuperior

public void setNewSuperior(javax.naming.Name newSuperior)
Set the new superior

Parameters:
newSuperior - The newSuperior to set.

computeLength

public int computeLength()
Compute the ModifyDNRequest length ModifyDNRequest : 0x6C L1 | +--> 0x04 L2 entry +--> 0x04 L3 newRDN +--> 0x01 0x01 (true/false) deleteOldRDN (3 bytes) [+--> 0x80 L4 newSuperior ] L2 = Length(0x04) + Length(Length(entry)) + Length(entry) L3 = Length(0x04) + Length(Length(newRDN)) + Length(newRDN) L4 = Length(0x80) + Length(Length(newSuperior)) + Length(newSuperior) L1 = L2 + L3 + 3 [+ L4] Length(ModifyDNRequest) = Length(0x6C) + Length(L1) + L1

Overrides:
computeLength in class LdapMessage
Returns:
DOCUMENT ME!

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Encode the ModifyDNRequest message to a PDU. ModifyDNRequest : 0x6C LL 0x04 LL entry 0x04 LL newRDN 0x01 0x01 deleteOldRDN [0x80 LL newSuperior]

Overrides:
encode in class LdapMessage
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
org.apache.directory.shared.asn1.codec.EncoderException - If anything goes wrong.

toString

public java.lang.String toString()
Get a String representation of a ModifyDNRequest

Overrides:
toString in class LdapMessage
Returns:
A ModifyDNRequest String


Copyright © 2003-2006 . All Rights Reserved.