org.apache.directory.shared.ldap.codec.decorators
Class ModifyDnRequestDecorator

java.lang.Object
  extended by org.apache.directory.shared.ldap.codec.decorators.MessageDecorator<M>
      extended by org.apache.directory.shared.ldap.codec.decorators.RequestDecorator<M>
          extended by org.apache.directory.shared.ldap.codec.decorators.ResultResponseRequestDecorator<M>
              extended by org.apache.directory.shared.ldap.codec.decorators.SingleReplyRequestDecorator<ModifyDnRequest>
                  extended by org.apache.directory.shared.ldap.codec.decorators.ModifyDnRequestDecorator
All Implemented Interfaces:
Decorator<ModifyDnRequest>, AbandonableRequest, Message, ModifyDnRequest, Request, ResultResponseRequest, SingleReplyRequest

public class ModifyDnRequestDecorator
extends SingleReplyRequestDecorator<ModifyDnRequest>
implements ModifyDnRequest

A decorator for the ModifyDnRequest message

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.decorators.MessageDecorator
messageLength
 
Fields inherited from interface org.apache.directory.shared.ldap.model.message.ModifyDnRequest
RESP_TYPE, TYPE
 
Constructor Summary
ModifyDnRequestDecorator(LdapCodecService codec, ModifyDnRequest decoratedMessage)
          Makes a ModifyDnRequest encodable.
 
Method Summary
 int computeLength()
          Compute the ModifyDNRequest length ModifyDNRequest :
 ByteBuffer encode(ByteBuffer buffer)
          Encode the ModifyDNRequest message to a PDU.
 boolean getDeleteOldRdn()
          
 int getModifyDnResponseLength()
          Stores the encoded length for the ModifyDnRequest
 Dn getName()
          
 Rdn getNewRdn()
          
 Dn getNewSuperior()
          
 boolean isMove()
          
 void setDeleteOldRdn(boolean deleteOldRdn)
          
 void setModifyDnRequestLength(int modifyDnRequestLength)
           
 void setName(Dn name)
          
 void setNewRdn(Rdn newRdn)
          
 void setNewSuperior(Dn newSuperior)
          
 
Methods inherited from class org.apache.directory.shared.ldap.codec.decorators.SingleReplyRequestDecorator
abandon, addAbandonListener, getResponseType, isAbandoned
 
Methods inherited from class org.apache.directory.shared.ldap.codec.decorators.ResultResponseRequestDecorator
getResultResponse, hasResponse
 
Methods inherited from class org.apache.directory.shared.ldap.codec.decorators.MessageDecorator
addAllControls, addControl, get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, removeControl, setControlsLength, setMessageId, setMessageLength, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.SingleReplyRequest
getResponseType
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.ResultResponseRequest
getResultResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.Message
addAllControls, addControl, get, getControl, getControls, getMessageId, getType, hasControl, put, removeControl, setMessageId
 
Methods inherited from interface org.apache.directory.shared.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
 

Constructor Detail

ModifyDnRequestDecorator

public ModifyDnRequestDecorator(LdapCodecService codec,
                                ModifyDnRequest decoratedMessage)
Makes a ModifyDnRequest encodable.

Parameters:
decoratedMessage - the decorated ModifyDnRequest
Method Detail

setModifyDnRequestLength

public void setModifyDnRequestLength(int modifyDnRequestLength)
Parameters:
modifyDnRequestLength - The encoded ModifyDnRequest's length

getModifyDnResponseLength

public int getModifyDnResponseLength()
Stores the encoded length for the ModifyDnRequest

Returns:
the encoded length

getName

public Dn getName()

Specified by:
getName in interface ModifyDnRequest

setName

public void setName(Dn name)

Specified by:
setName in interface ModifyDnRequest

getNewRdn

public Rdn getNewRdn()

Specified by:
getNewRdn in interface ModifyDnRequest

setNewRdn

public void setNewRdn(Rdn newRdn)

Specified by:
setNewRdn in interface ModifyDnRequest

getDeleteOldRdn

public boolean getDeleteOldRdn()

Specified by:
getDeleteOldRdn in interface ModifyDnRequest

setDeleteOldRdn

public void setDeleteOldRdn(boolean deleteOldRdn)

Specified by:
setDeleteOldRdn in interface ModifyDnRequest

getNewSuperior

public Dn getNewSuperior()

Specified by:
getNewSuperior in interface ModifyDnRequest

setNewSuperior

public void setNewSuperior(Dn newSuperior)

Specified by:
setNewSuperior in interface ModifyDnRequest

isMove

public boolean isMove()

Specified by:
isMove in interface ModifyDnRequest

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 Decorator<ModifyDnRequest>
Returns:
The PDU's length of a ModifyDN Request

encode

public ByteBuffer encode(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 Decorator<ModifyDnRequest>
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
EncoderException - if the buffer can't be encoded


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