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

java.lang.Object
  extended by org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
      extended by org.apache.directory.api.ldap.codec.decorators.RequestDecorator<AbandonRequest>
          extended by org.apache.directory.api.ldap.codec.decorators.AbandonRequestDecorator
All Implemented Interfaces:
Decorator<AbandonRequest>, AbandonRequest, Message, Request

public final class AbandonRequestDecorator
extends RequestDecorator<AbandonRequest>
implements AbandonRequest

A decorator for the AddRequest 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.AbandonRequest
TYPE
 
Constructor Summary
AbandonRequestDecorator(LdapApiService codec, AbandonRequest decoratedMessage)
          Makes a AddRequest a MessageDecorator.
 
Method Summary
 AbandonRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 AbandonRequest addControl(Control control)
          Adds a control to this Message.
 int computeLength()
          Compute the AbandonRequest length AbandonRequest : 0x50 0x0(1..4) abandoned MessageId Length(AbandonRequest) = Length(0x50) + 1 + Length(abandoned MessageId)
 ByteBuffer encode(ByteBuffer buffer)
          Encode the Abandon protocolOp part
 int getAbandoned()
          Gets the id of the request operation to terminate.
 AbandonRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 AbandonRequest setAbandoned(int requestId)
          Sets the id of the request operation to terminate.
 AbandonRequest setMessageId(int messageId)
          Sets the Message ID for this request
 
Methods inherited from class org.apache.directory.api.ldap.codec.decorators.RequestDecorator
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.Request
hasResponse
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Message
get, getControl, getControls, getMessageId, getType, hasControl, put
 

Constructor Detail

AbandonRequestDecorator

public AbandonRequestDecorator(LdapApiService codec,
                               AbandonRequest decoratedMessage)
Makes a AddRequest a MessageDecorator.

Parameters:
decoratedMessage - the decorated AddRequest
Method Detail

getAbandoned

public int getAbandoned()
Gets the id of the request operation to terminate.

Specified by:
getAbandoned in interface AbandonRequest
Returns:
the id of the request message to abandon

setAbandoned

public AbandonRequest setAbandoned(int requestId)
Sets the id of the request operation to terminate.

Specified by:
setAbandoned in interface AbandonRequest
Parameters:
requestId - the sequence id of the request message to abandon
Returns:
The AbandonRequest instance

setMessageId

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

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

addControl

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

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

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

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

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Encode the Abandon protocolOp part

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

computeLength

public int computeLength()
Compute the AbandonRequest length AbandonRequest : 0x50 0x0(1..4) abandoned MessageId Length(AbandonRequest) = Length(0x50) + 1 + Length(abandoned MessageId)

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


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