Package org.opends.server.controls
Class ServerSideSortRequestControl
- java.lang.Object
-
- org.opends.server.types.Control
-
- org.opends.server.controls.ServerSideSortRequestControl
-
public class ServerSideSortRequestControl extends Control
This class implements the server-side sort request control as defined in RFC 2891 section 1.1. The subclass ServerSideSortRequestControl.ClientRequest should be used when encoding this control from a sort order string. This is suitable for client tools that want to encode this control without a SortOrder object. The ASN.1 description for the control value is:
SortKeyList ::= SEQUENCE OF SEQUENCE { attributeType AttributeDescription, orderingRule [0] MatchingRuleId OPTIONAL, reverseOrder [1] BOOLEAN DEFAULT FALSE }
-
-
Field Summary
Fields Modifier and Type Field Description static ControlDecoder<ServerSideSortRequestControl>DECODERThe Control Decoder that can be used to decode this control.
-
Constructor Summary
Constructors Constructor Description ServerSideSortRequestControl(boolean isCritical, String sortOrderString)Creates a new server-side sort request control based on the definition in the provided sort order string.ServerSideSortRequestControl(boolean isCritical, List<SortKey> sortKeys)Creates a new server-side sort request control with the provided information.ServerSideSortRequestControl(String sortOrderString)Creates a new server-side sort request control based on the definition in the provided sort order string.ServerSideSortRequestControl(List<SortKey> sortKeys)Creates a new server-side sort request control based on the provided sort order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsSortKeys()Indicates whether the sort control contains Sort keys.List<SortKey>getSortKeys()Retrieves the sort order for this server-side sort request control.voidtoString(StringBuilder buffer)Appends a string representation of this server-side sort request control to the provided buffer.protected voidwriteValue(ASN1Writer writer)Writes this control's value to an ASN.1 writer.-
Methods inherited from class org.opends.server.types.Control
getOID, isCritical, toString, write
-
-
-
-
Field Detail
-
DECODER
public static final ControlDecoder<ServerSideSortRequestControl> DECODER
The Control Decoder that can be used to decode this control.
-
-
Constructor Detail
-
ServerSideSortRequestControl
public ServerSideSortRequestControl(String sortOrderString) throws LDAPException
Creates a new server-side sort request control based on the definition in the provided sort order string.- Parameters:
sortOrderString- The string representation of the sort order to use for the control.- Throws:
LDAPException- If the provided sort order string could not be decoded.
-
ServerSideSortRequestControl
public ServerSideSortRequestControl(boolean isCritical, String sortOrderString) throws LDAPExceptionCreates a new server-side sort request control based on the definition in the provided sort order string.- Parameters:
isCritical- Indicates whether support for this control should be considered a critical part of the server processing.sortOrderString- The string representation of the sort order to use for the control.- Throws:
LDAPException- If the provided sort order string could not be decoded.
-
ServerSideSortRequestControl
public ServerSideSortRequestControl(List<SortKey> sortKeys)
Creates a new server-side sort request control based on the provided sort order.- Parameters:
sortKeys- The sort order to use for this control.
-
ServerSideSortRequestControl
public ServerSideSortRequestControl(boolean isCritical, List<SortKey> sortKeys)Creates a new server-side sort request control with the provided information.- Parameters:
isCritical- Indicates whether support for this control should be considered a critical part of the server processing.sortKeys- sort order associated with this server-side sort control.
-
-
Method Detail
-
getSortKeys
public List<SortKey> getSortKeys() throws DirectoryException
Retrieves the sort order for this server-side sort request control.- Returns:
- The sort order for this server-side sort request control.
- Throws:
DirectoryException- if an error occurs while retrieving the sort order.
-
containsSortKeys
public boolean containsSortKeys() throws DirectoryExceptionIndicates whether the sort control contains Sort keys.A Sort control may not contain sort keys if the attribute type is not recognized by the server
- Returns:
trueif the control contains sort keys orfalseif it does not.- Throws:
DirectoryException- If a problem occurs while trying to make the determination.
-
writeValue
protected void writeValue(ASN1Writer writer) throws IOException
Writes this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.- Specified by:
writeValuein classControl- Parameters:
writer- The ASN.1 writer to use.- Throws:
IOException- If a problem occurs while writing to the stream.
-
toString
public void toString(StringBuilder buffer)
Appends a string representation of this server-side sort request control to the provided buffer.
-
-