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

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

public class UnbindRequestDecorator
extends RequestDecorator<UnbindRequest>
implements UnbindRequest

A decorator for the LdapResultResponse 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.UnbindRequest
TYPE
 
Constructor Summary
UnbindRequestDecorator(LdapApiService codec, UnbindRequest decoratedMessage)
          Makes Request a MessageDecorator.
 
Method Summary
 UnbindRequest addAllControls(Control[] controls)
          Adds an array of controls to this Message.
 UnbindRequest addControl(Control control)
          Adds a control to this Message.
 int computeLength()
          Compute the UnBindRequest length UnBindRequest : 0x42 00
 ByteBuffer encode(ByteBuffer buffer)
          Encode the Unbind protocolOp part
 UnbindRequest removeControl(Control control)
          Deletes a control removing it from this Message.
 UnbindRequest 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

UnbindRequestDecorator

public UnbindRequestDecorator(LdapApiService codec,
                              UnbindRequest decoratedMessage)
Makes Request a MessageDecorator.

Parameters:
decoratedMessage - the decorated message
Method Detail

setMessageId

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

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

addControl

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

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

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

Specified by:
removeControl in interface Message
Specified by:
removeControl in interface UnbindRequest
Overrides:
removeControl in class MessageDecorator<UnbindRequest>
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 UnBindRequest length UnBindRequest : 0x42 00

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

encode

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

Specified by:
encode in interface Decorator<UnbindRequest>
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.