Class ExtendedRequestDecorator<Q extends ExtendedRequest>
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.MessageDecorator<M>
-
- org.apache.directory.api.ldap.codec.decorators.RequestDecorator<M>
-
- org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator<M>
-
- org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator<Q>
-
- org.apache.directory.api.ldap.codec.decorators.ExtendedRequestDecorator<Q>
-
- Type Parameters:
Q
- The extended request to decorate
- All Implemented Interfaces:
Asn1Object
,Decorator<Q>
,AbandonableRequest
,ExtendedRequest
,Message
,Request
,ResultResponseRequest
,SingleReplyRequest
- Direct Known Subclasses:
CancelRequestDecorator
,CertGenerationRequestDecorator
,EndTransactionRequestDecorator
,GracefulShutdownRequestDecorator
,PasswordModifyRequestDecorator
,StartTlsRequestDecorator
,StartTransactionRequestDecorator
,StoredProcedureRequestDecorator
,WhoAmIRequestDecorator
public class ExtendedRequestDecorator<Q extends ExtendedRequest> extends SingleReplyRequestDecorator<Q> implements ExtendedRequest
A decorator for the ExtendedRequest message- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description ExtendedRequestDecorator(LdapApiService codec, Q decoratedMessage)
Makes a ExtendedRequest a MessageDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtendedRequest
addAllControls(Control[] controls)
Adds an array of controls to this Message.ExtendedRequest
addControl(Control control)
Adds a control to this Message.int
computeLength()
Compute the ExtendedRequest length
ExtendedRequest :ByteBuffer
encode(ByteBuffer buffer)
Encode the ExtendedRequest message to a PDU.String
getRequestName()
Gets the Object Identifier corresponding to the extended request type.byte[]
getRequestValue()
Gets the Extended request payloadExtendedRequest
removeControl(Control control)
Deletes a control removing it from this Message.ExtendedRequest
setMessageId(int messageId)
Sets the Message ID for this requestExtendedRequest
setRequestName(String oid)
Sets the Object Identifier corresponding to the extended request type.void
setRequestValue(byte[] requestValue)
sets the Extended request payload-
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.Request
hasResponse
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest
getResultResponse
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.SingleReplyRequest
getResponseType
-
-
-
-
Constructor Detail
-
ExtendedRequestDecorator
public ExtendedRequestDecorator(LdapApiService codec, Q decoratedMessage)
Makes a ExtendedRequest a MessageDecorator.- Parameters:
codec
- The LDAP service instancedecoratedMessage
- the decorated ExtendedRequest
-
-
Method Detail
-
getRequestName
public String getRequestName()
Gets the Object Identifier corresponding to the extended request type. This is the requestName portion of the ExtendedRequst PDU.- Specified by:
getRequestName
in interfaceExtendedRequest
- Returns:
- the dotted-decimal representation as a String of the OID
-
setRequestName
public ExtendedRequest setRequestName(String oid)
Sets the Object Identifier corresponding to the extended request type.- Specified by:
setRequestName
in interfaceExtendedRequest
- Parameters:
oid
- the dotted-decimal representation as a String of the OID- Returns:
- The ExtendedRequest instance
-
getRequestValue
public byte[] getRequestValue()
Gets the Extended request payload- Returns:
- The extended payload
-
setRequestValue
public void setRequestValue(byte[] requestValue)
sets the Extended request payload- Parameters:
requestValue
- The extended payload
-
setMessageId
public ExtendedRequest setMessageId(int messageId)
Sets the Message ID for this request- Specified by:
setMessageId
in interfaceExtendedRequest
- Specified by:
setMessageId
in interfaceMessage
- Overrides:
setMessageId
in classMessageDecorator<Q extends ExtendedRequest>
- Parameters:
messageId
- The message Id- Returns:
- A Message reference
-
addControl
public ExtendedRequest addControl(Control control)
Adds a control to this Message.- Specified by:
addControl
in interfaceExtendedRequest
- Specified by:
addControl
in interfaceMessage
- Overrides:
addControl
in classMessageDecorator<Q extends ExtendedRequest>
- Parameters:
control
- the control to add.- Returns:
- A Message reference
-
addAllControls
public ExtendedRequest addAllControls(Control[] controls)
Adds an array of controls to this Message.- Specified by:
addAllControls
in interfaceExtendedRequest
- Specified by:
addAllControls
in interfaceMessage
- Overrides:
addAllControls
in classMessageDecorator<Q extends ExtendedRequest>
- Parameters:
controls
- the controls to add.- Returns:
- A Message reference
-
removeControl
public ExtendedRequest removeControl(Control control)
Deletes a control removing it from this Message.- Specified by:
removeControl
in interfaceExtendedRequest
- Specified by:
removeControl
in interfaceMessage
- Overrides:
removeControl
in classMessageDecorator<Q extends ExtendedRequest>
- Parameters:
control
- the control to remove.- Returns:
- A Message reference
-
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 interfaceAsn1Object
- 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 interfaceAsn1Object
- Parameters:
buffer
- The buffer where to put the PDU- Returns:
- The PDU.
- Throws:
EncoderException
- if the buffer can't be encoded
-
-