Class SortResponseDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<SortResponse>
-
- org.apache.directory.api.ldap.codec.controls.sort.SortResponseDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<SortResponse>
,Decorator<SortResponse>
,Control
,SortResponse
public class SortResponseDecorator extends ControlDecorator<SortResponse> implements SortResponse
Decorator class for SortResponseControl.- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.model.message.controls.SortResponse
OID
-
-
Constructor Summary
Constructors Constructor Description SortResponseDecorator(LdapApiService codec)
Creates a new instance of SortResponseDecorator.SortResponseDecorator(LdapApiService codec, SortResponse control)
Creates a new instance of SortResponseDecorator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the object length, which is the sum of all inner length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.ByteBuffer
encode(ByteBuffer buffer)
Encode the object to a PDU.String
getAttributeName()
SortResultCode
getSortResult()
byte[]
getValue()
Get the control valuevoid
setAttributeName(String attributeName)
Sets the name of the first offending attributevoid
setSortResult(SortResultCode result)
sets the sort result-
Methods inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Control
getOid, isCritical, setCritical
-
-
-
-
Constructor Detail
-
SortResponseDecorator
public SortResponseDecorator(LdapApiService codec)
Creates a new instance of SortResponseDecorator.- Parameters:
codec
- the LDAP codec
-
SortResponseDecorator
public SortResponseDecorator(LdapApiService codec, SortResponse control)
Creates a new instance of SortResponseDecorator.- Parameters:
codec
- the LDAP codeccontrol
- the sort response control
-
-
Method Detail
-
computeLength
public int computeLength()
Description copied from interface:Asn1Object
Compute the object length, which is the sum of all inner length.- Specified by:
computeLength
in interfaceAsn1Object
- Returns:
- the control length.
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encode the object to a PDU.- 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
-
decode
public Asn1Object decode(byte[] controlBytes) throws DecoderException
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.- Specified by:
decode
in interfaceCodecControl<SortResponse>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
getValue
public byte[] getValue()
Get the control value- Specified by:
getValue
in interfaceCodecControl<SortResponse>
- Overrides:
getValue
in classControlDecorator<SortResponse>
- Returns:
- The control value
-
setSortResult
public void setSortResult(SortResultCode result)
sets the sort result- Specified by:
setSortResult
in interfaceSortResponse
- Parameters:
result
- The sort result code
-
getSortResult
public SortResultCode getSortResult()
- Specified by:
getSortResult
in interfaceSortResponse
- Returns:
- the sort result
-
setAttributeName
public void setAttributeName(String attributeName)
Sets the name of the first offending attribute- Specified by:
setAttributeName
in interfaceSortResponse
- Parameters:
attributeName
- The attribute's name
-
getAttributeName
public String getAttributeName()
- Specified by:
getAttributeName
in interfaceSortResponse
- Returns:
- the name of the first offending attribute
-
-