org.apache.directory.api.ldap.codec.decorators
Class DeleteRequestDecorator

java.lang.Object
  extended by org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
      extended by org.apache.directory.api.ldap.codec.decorators.RequestDecorator<M>
          extended by org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator<M,R>
              extended by org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator<DeleteRequest,DeleteResponse>
                  extended by org.apache.directory.api.ldap.codec.decorators.DeleteRequestDecorator
All Implemented Interfaces:
Decorator<DeleteRequest>, AbandonableRequest, DeleteRequest, Message, Request, ResultResponseRequest<DeleteResponse>, SingleReplyRequest<DeleteResponse>

public class DeleteRequestDecorator
extends SingleReplyRequestDecorator<DeleteRequest,DeleteResponse>
implements DeleteRequest

A decorator for the DeleteRequest message

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
messageLength
 
Fields inherited from interface org.apache.directory.api.ldap.model.message.DeleteRequest
RESP_TYPE, TYPE
 
Constructor Summary
DeleteRequestDecorator(LdapApiService codec, DeleteRequest decoratedMessage)
          Makes a DeleteRequest a MessageDecorator.
 
Method Summary
 DeleteRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 DeleteRequest addControl(Control control)
          Adds a control to this Message.
 int computeLength()
          Compute the DelRequest length DelRequest : 0x4A L1 entry L1 = Length(entry) Length(DelRequest) = Length(0x4A) + Length(L1) + L1
 ByteBuffer encode(ByteBuffer buffer)
          Encode the DelRequest message to a PDU.
 Dn getName()
          Gets the distinguished name of the leaf entry to be deleted by this request.
 DeleteRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 DeleteRequest setMessageId(int messageId)
          Sets the Message ID for this request
 DeleteRequest setName(Dn name)
          Sets the distinguished name of the leaf entry to be deleted by this request.
 
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator
abandon, addAbandonListener, getResponseType, isAbandoned
 
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator
getResultResponse, hasResponse
 
Methods inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, 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.api.ldap.model.message.SingleReplyRequest
getResponseType
 
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, getType, hasControl, put
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
 

Constructor Detail

DeleteRequestDecorator

public DeleteRequestDecorator(LdapApiService codec,
                              DeleteRequest decoratedMessage)
Makes a DeleteRequest a MessageDecorator.

Parameters:
decoratedMessage - the decorated DeleteRequest
Method Detail

getName

public Dn getName()
Gets the distinguished name of the leaf entry to be deleted by this request.

Specified by:
getName in interface DeleteRequest
Returns:
the Dn of the leaf entry to delete.

setName

public DeleteRequest setName(Dn name)
Sets the distinguished name of the leaf entry to be deleted by this request.

Specified by:
setName in interface DeleteRequest
Parameters:
name - the Dn of the leaf entry to delete.
Returns:
The DeleteRequest instance

setMessageId

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

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

addControl

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

Specified by:
addControl in interface DeleteRequest
Specified by:
addControl in interface Message
Overrides:
addControl in class MessageDecorator<DeleteRequest>
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 DeleteRequest addAllControls(Control[] controls)
                             throws MessageException
Adds an array of controls to this Message.

Specified by:
addAllControls in interface DeleteRequest
Specified by:
addAllControls in interface Message
Overrides:
addAllControls in class MessageDecorator<DeleteRequest>
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 DeleteRequest removeControl(Control control)
                            throws MessageException
Deletes a control removing it from this Message.

Specified by:
removeControl in interface DeleteRequest
Specified by:
removeControl in interface Message
Overrides:
removeControl in class MessageDecorator<DeleteRequest>
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.

computeLength

public int computeLength()
Compute the DelRequest length DelRequest : 0x4A L1 entry L1 = Length(entry) Length(DelRequest) = Length(0x4A) + Length(L1) + L1

Specified by:
computeLength in interface Decorator<DeleteRequest>
Returns:
The object's computed length

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Encode the DelRequest message to a PDU. DelRequest : 0x4A LL entry

Specified by:
encode in interface Decorator<DeleteRequest>
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
EncoderException - if the buffer can't be encoded


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