public class ExtendedRequestDecorator<Q extends ExtendedRequest<P>,P extends ExtendedResponse> extends SingleReplyRequestDecorator<Q,P> implements ExtendedRequest<P>
Modifier and Type | Field and Description |
---|---|
protected byte[] |
requestValue |
messageLength
RESP_TYPE, TYPE
Constructor and Description |
---|
ExtendedRequestDecorator(LdapApiService codec,
Q decoratedMessage)
Makes a ExtendedRequest a MessageDecorator.
|
Modifier and Type | Method and Description |
---|---|
ExtendedRequest<P> |
addAllControls(Control[] controls)
Adds an array of controls to this Message.
|
ExtendedRequest<P> |
addControl(Control control)
Adds a control to this Message.
|
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()
Gets the Object Identifier corresponding to the extended request type.
|
byte[] |
getRequestNameBytes()
Gets the requestName bytes.
|
byte[] |
getRequestValue() |
ExtendedRequest<P> |
removeControl(Control control)
Deletes a control removing it from this Message.
|
void |
setExtendedRequestLength(int extendedRequestLength)
Stores the encoded length for the ExtendedRequest
|
ExtendedRequest<P> |
setMessageId(int messageId)
Sets the Message ID for this request
|
ExtendedRequest<P> |
setRequestName(String oid)
Sets the Object Identifier corresponding to the extended request type.
|
void |
setRequestNameBytes(byte[] requestNameBytes)
Sets the requestName bytes.
|
void |
setRequestValue(byte[] requestValue) |
abandon, addAbandonListener, getResponseType, isAbandoned
getResultResponse, hasResponse
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getResponseType
getResultResponse
hasResponse
get, getControl, getControls, getMessageId, getType, hasControl, put
protected byte[] requestValue
public ExtendedRequestDecorator(LdapApiService codec, Q decoratedMessage)
decoratedMessage
- the decorated ExtendedRequestpublic void setExtendedRequestLength(int extendedRequestLength)
extendedRequestLength
- The encoded lengthpublic int getExtendedRequestLength()
public byte[] getRequestNameBytes()
public void setRequestNameBytes(byte[] requestNameBytes)
requestNameBytes
- the OID bytes of the extended request type.public String getRequestName()
getRequestName
in interface ExtendedRequest<P extends ExtendedResponse>
public ExtendedRequest<P> setRequestName(String oid)
setRequestName
in interface ExtendedRequest<P extends ExtendedResponse>
oid
- the dotted-decimal representation as a String of the OIDpublic byte[] getRequestValue()
public void setRequestValue(byte[] requestValue)
public ExtendedRequest<P> setMessageId(int messageId)
setMessageId
in interface ExtendedRequest<P extends ExtendedResponse>
setMessageId
in interface Message
setMessageId
in class MessageDecorator<Q extends ExtendedRequest<P>>
messageId
- The message Idpublic ExtendedRequest<P> addControl(Control control) throws MessageException
addControl
in interface ExtendedRequest<P extends ExtendedResponse>
addControl
in interface Message
addControl
in class MessageDecorator<Q extends ExtendedRequest<P>>
control
- the control to add.MessageException
- if controls cannot be added to this Message or the control is
not known etc.public ExtendedRequest<P> addAllControls(Control[] controls) throws MessageException
addAllControls
in interface ExtendedRequest<P extends ExtendedResponse>
addAllControls
in interface Message
addAllControls
in class MessageDecorator<Q extends ExtendedRequest<P>>
controls
- the controls to add.MessageException
- if controls cannot be added to this Message or they are not known etc.public ExtendedRequest<P> removeControl(Control control) throws MessageException
removeControl
in interface ExtendedRequest<P extends ExtendedResponse>
removeControl
in interface Message
removeControl
in class MessageDecorator<Q extends ExtendedRequest<P>>
control
- the control to remove.MessageException
- if controls cannot be added to this Message or the control is
not known etc.public int computeLength()
computeLength
in interface Decorator<Q extends ExtendedRequest<P>>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
encode
in interface Decorator<Q extends ExtendedRequest<P>>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedCopyright © 2003-2014 The Apache Software Foundation. All Rights Reserved.