public class SortRequestDecorator extends ControlDecorator<SortRequest> implements SortRequest
Modifier and Type | Field and Description |
---|---|
static int |
ORDERING_RULE_TAG
ASN.1 BER tag for the forward ordering rule
|
static int |
REVERSE_ORDER_TAG
ASN.1 BER tag for the backward ordering rule
|
OID
Constructor and Description |
---|
SortRequestDecorator(LdapApiService codec)
Creates a new instance of SortRequestDecorator.
|
SortRequestDecorator(LdapApiService codec,
SortRequest control)
Creates a new instance of SortRequestDecorator.
|
Modifier and Type | Method and Description |
---|---|
void |
addSortKey(SortKey sortKey)
adds a sort key
|
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.
|
List<SortKey> |
getSortKeys() |
byte[] |
getValue()
Get the control value
|
void |
setSortKeys(List<SortKey> sortKeys)
sets the sort keys
|
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
getOid, isCritical, setCritical
public static final int ORDERING_RULE_TAG
public static final int REVERSE_ORDER_TAG
public SortRequestDecorator(LdapApiService codec)
codec
- the LDAP codecpublic SortRequestDecorator(LdapApiService codec, SortRequest control)
codec
- the LDAP codeccontrol
- the control instancepublic int computeLength()
ControlDecorator
computeLength
in interface Asn1Object
computeLength
in interface Decorator<SortRequest>
computeLength
in class ControlDecorator<SortRequest>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Decorator
encode
in interface Asn1Object
encode
in interface Decorator<SortRequest>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedpublic Asn1Object decode(byte[] controlBytes) throws DecoderException
CodecControl
decode
in interface CodecControl<SortRequest>
controlBytes
- the encoded control bytesDecoderException
- if anything goes wrongpublic byte[] getValue()
getValue
in interface CodecControl<SortRequest>
getValue
in class ControlDecorator<SortRequest>
public void setSortKeys(List<SortKey> sortKeys)
SortRequest
setSortKeys
in interface SortRequest
sortKeys
- The list of keys to be sortedpublic List<SortKey> getSortKeys()
getSortKeys
in interface SortRequest
public void addSortKey(SortKey sortKey)
SortRequest
addSortKey
in interface SortRequest
sortKey
- The list of keys to be sortedCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.