Class CompareRequestDecorator
- 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<CompareRequest>
-
- org.apache.directory.api.ldap.codec.decorators.CompareRequestDecorator
-
- All Implemented Interfaces:
Asn1Object
,Decorator<CompareRequest>
,AbandonableRequest
,CompareRequest
,Message
,Request
,ResultResponseRequest
,SingleReplyRequest
public class CompareRequestDecorator extends SingleReplyRequestDecorator<CompareRequest> implements CompareRequest
A decorator for the CompareRequest message- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description CompareRequestDecorator(LdapApiService codec, CompareRequest decoratedMessage)
Makes a CompareRequest a MessageDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompareRequest
addAllControls(Control[] controls)
Adds an array of controls to this Message.CompareRequest
addControl(Control control)
Adds a control to this Message.int
computeLength()
Compute the CompareRequest length
CompareRequest :ByteBuffer
encode(ByteBuffer buffer)
Encode the CompareRequest message to a PDU.Value
getAssertionValue()
Gets the attribute value to use in making the comparison.String
getAttributeId()
Gets the attribute id use in making the comparison.Dn
getName()
Gets the distinguished name of the entry to be compared using the attribute value assertion.CompareRequest
removeControl(Control control)
Deletes a control removing it from this Message.CompareRequest
setAssertionValue(byte[] value)
Sets the attribute value to use in the comparison.CompareRequest
setAssertionValue(String value)
Sets the attribute value to use in the comparison.CompareRequest
setAttributeId(String attrId)
Sets the attribute id used in the comparison.CompareRequest
setMessageId(int messageId)
Sets the Message ID for this requestCompareRequest
setName(Dn name)
Sets the distinguished name of the entry to be compared using the attribute value assertion.-
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.AbandonableRequest
abandon, addAbandonListener, isAbandoned
-
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
-
CompareRequestDecorator
public CompareRequestDecorator(LdapApiService codec, CompareRequest decoratedMessage)
Makes a CompareRequest a MessageDecorator.- Parameters:
codec
- The LDAP service instancedecoratedMessage
- the decorated CompareRequest
-
-
Method Detail
-
getName
public Dn getName()
Gets the distinguished name of the entry to be compared using the attribute value assertion.- Specified by:
getName
in interfaceCompareRequest
- Returns:
- the Dn of the compared entry.
-
setName
public CompareRequest setName(Dn name)
Sets the distinguished name of the entry to be compared using the attribute value assertion.- Specified by:
setName
in interfaceCompareRequest
- Parameters:
name
- the Dn of the compared entry.- Returns:
- The CompareRequest instance
-
getAssertionValue
public Value getAssertionValue()
Gets the attribute value to use in making the comparison.- Specified by:
getAssertionValue
in interfaceCompareRequest
- Returns:
- the attribute value to used in comparison.
-
setAssertionValue
public CompareRequest setAssertionValue(String value)
Sets the attribute value to use in the comparison.- Specified by:
setAssertionValue
in interfaceCompareRequest
- Parameters:
value
- the attribute value used in comparison.- Returns:
- The CompareRequest instance
-
setAssertionValue
public CompareRequest setAssertionValue(byte[] value)
Sets the attribute value to use in the comparison.- Specified by:
setAssertionValue
in interfaceCompareRequest
- Parameters:
value
- the attribute value used in comparison.- Returns:
- The CompareRequest instance
-
getAttributeId
public String getAttributeId()
Gets the attribute id use in making the comparison.- Specified by:
getAttributeId
in interfaceCompareRequest
- Returns:
- the attribute id used in comparison.
-
setAttributeId
public CompareRequest setAttributeId(String attrId)
Sets the attribute id used in the comparison.- Specified by:
setAttributeId
in interfaceCompareRequest
- Parameters:
attrId
- the attribute id used in comparison.- Returns:
- The CompareRequest instance
-
setMessageId
public CompareRequest setMessageId(int messageId)
Sets the Message ID for this request- Specified by:
setMessageId
in interfaceCompareRequest
- Specified by:
setMessageId
in interfaceMessage
- Overrides:
setMessageId
in classMessageDecorator<CompareRequest>
- Parameters:
messageId
- The message Id- Returns:
- A Message reference
-
addControl
public CompareRequest addControl(Control control)
Adds a control to this Message.- Specified by:
addControl
in interfaceCompareRequest
- Specified by:
addControl
in interfaceMessage
- Overrides:
addControl
in classMessageDecorator<CompareRequest>
- Parameters:
control
- the control to add.- Returns:
- A Message reference
-
addAllControls
public CompareRequest addAllControls(Control[] controls)
Adds an array of controls to this Message.- Specified by:
addAllControls
in interfaceCompareRequest
- Specified by:
addAllControls
in interfaceMessage
- Overrides:
addAllControls
in classMessageDecorator<CompareRequest>
- Parameters:
controls
- the controls to add.- Returns:
- A Message reference
-
removeControl
public CompareRequest removeControl(Control control)
Deletes a control removing it from this Message.- Specified by:
removeControl
in interfaceCompareRequest
- Specified by:
removeControl
in interfaceMessage
- Overrides:
removeControl
in classMessageDecorator<CompareRequest>
- Parameters:
control
- the control to remove.- Returns:
- A Message reference
-
computeLength
public int computeLength()
Compute the CompareRequest length
CompareRequest :0x6E L1 | +--> 0x04 L2 entry +--> 0x30 L3 (ava) | +--> 0x04 L4 attributeDesc +--> 0x04 L5 assertionValue L3 = Length(0x04) + Length(L4) + L4 + Length(0x04) + Length(L5) + L5 Length(CompareRequest) = Length(0x6E) + Length(L1) + L1 + Length(0x04) + Length(L2) + L2 + Length(0x30) + Length(L3) + L3
- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- The CompareRequest PDU's length
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the CompareRequest message to a PDU.CompareRequest : 0x6E LL 0x04 LL entry 0x30 LL attributeValueAssertion 0x04 LL attributeDesc 0x04 LL assertionValue
- Specified by:
encode
in interfaceAsn1Object
- Parameters:
buffer
- The buffer where to put the PDU- Returns:
- The encoded PDU.
- Throws:
EncoderException
- if the buffer can't be encoded
-
-