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

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<ExtendedRequest>
                  extended by org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator
All Implemented Interfaces:
Decorator<ExtendedRequest>, AbandonableRequest, ExtendedRequest, Message, Request, ResultResponseRequest, SingleReplyRequest

public class ExtendedRequestDecorator
extends SingleReplyRequestDecorator<ExtendedRequest>
implements ExtendedRequest

A decorator for the ExtendedRequest 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.ExtendedRequest
RESP_TYPE, TYPE
 
Constructor Summary
ExtendedRequestDecorator(LdapCodecService codec, ExtendedRequest decoratedMessage)
          Makes a ExtendedRequest a MessageDecorator.
 
Method Summary
 int computeLength()
          Compute the ExtendedRequest length ExtendedRequest : 0x77 L1 | +--> 0x80 L2 name [+--> 0x81 L3 value] L1 = Length(0x80) + Length(L2) + L2 [+ Length(0x81) + Length(L3) + L3] Length(ExtendedRequest) = Length(0x77) + Length(L1) + L1
 ByteBuffer encode(ByteBuffer buffer)
          Encode the ExtendedRequest message to a PDU.
 int getExtendedRequestLength()
           
 String getRequestName()
          
 byte[] getRequestNameBytes()
          Gets the requestName bytes.
 byte[] getRequestValue()
          
 void setExtendedRequestLength(int extendedRequestLength)
          Stores the encoded length for the ExtendedRequest
 void setRequestName(String oid)
          
 void setRequestNameBytes(byte[] requestNameBytes)
          Sets the requestName bytes.
 void setRequestValue(byte[] requestValue)
          
 
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
 

Constructor Detail

ExtendedRequestDecorator

public ExtendedRequestDecorator(LdapCodecService codec,
                                ExtendedRequest decoratedMessage)
Makes a ExtendedRequest a MessageDecorator.

Parameters:
decoratedMessage - the decorated ExtendedRequest
Method Detail

setExtendedRequestLength

public void setExtendedRequestLength(int extendedRequestLength)
Stores the encoded length for the ExtendedRequest

Parameters:
extendedRequestLength - The encoded length

getExtendedRequestLength

public int getExtendedRequestLength()
Returns:
The encoded ExtendedRequest's length

getRequestNameBytes

public byte[] getRequestNameBytes()
Gets the requestName bytes.

Returns:
the requestName bytes of the extended request type.

setRequestNameBytes

public void setRequestNameBytes(byte[] requestNameBytes)
Sets the requestName bytes.

Parameters:
requestNameBytes - the OID bytes of the extended request type.

getRequestName

public String getRequestName()

Specified by:
getRequestName in interface ExtendedRequest

setRequestName

public void setRequestName(String oid)

Specified by:
setRequestName in interface ExtendedRequest

getRequestValue

public byte[] getRequestValue()

Specified by:
getRequestValue in interface ExtendedRequest

setRequestValue

public void setRequestValue(byte[] requestValue)

Specified by:
setRequestValue in interface ExtendedRequest

computeLength

public int computeLength()
Compute the ExtendedRequest length ExtendedRequest : 0x77 L1 | +--> 0x80 L2 name [+--> 0x81 L3 value] L1 = Length(0x80) + Length(L2) + L2 [+ Length(0x81) + Length(L3) + L3] Length(ExtendedRequest) = Length(0x77) + Length(L1) + L1

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

encode

public ByteBuffer encode(ByteBuffer buffer)
                  throws EncoderException
Encode the ExtendedRequest message to a PDU. ExtendedRequest : 0x80 LL resquest name [0x81 LL request value]

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