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

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.LdapMessage
          extended by org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequest
All Implemented Interfaces:
Asn1Object

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 }

Version:
$Rev: 664290 $, $Date: 2008-06-07 08:28:06 +0200 (Sa, 07 Jun 2008) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
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.
 LdapDN getEntry()
          Get the modification's DN
 int getMessageType()
          Get the message type
 Rdn getNewRDN()
          Get the new RDN
 LdapDN 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(LdapDN entry)
          Set the modification DN.
 void setNewRDN(Rdn newRDN)
          Set the new RDN
 void setNewSuperior(LdapDN 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, initControls, setMessageId, setProtocolOP
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, 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 LdapDN getEntry()
Get the modification's DN

Returns:
Returns the entry.

setEntry

public void setEntry(LdapDN 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 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 LdapDN getNewSuperior()
Get the newSuperior

Returns:
Returns the newSuperior.

setNewSuperior

public void setNewSuperior(LdapDN 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

Specified by:
computeLength in interface Asn1Object
Overrides:
computeLength in class LdapMessage
Returns:
The PDU's length of a ModifyDN Request

encode

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

Specified by:
encode in interface Asn1Object
Overrides:
encode in class LdapMessage
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
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-2011 Apache Software Foundation. All Rights Reserved.