com.netscape.jndi.ldap.controls
Class LdapSortControl

java.lang.Object
  extended bynetscape.ldap.LDAPControl
      extended bynetscape.ldap.controls.LDAPSortControl
          extended bycom.netscape.jndi.ldap.controls.LdapSortControl
All Implemented Interfaces:
java.lang.Cloneable, javax.naming.ldap.Control, java.io.Serializable

public class LdapSortControl
extends LDAPSortControl
implements javax.naming.ldap.Control

Represents an LDAP v3 server control that specifies that you want the server to return sorted search results. (The OID for this control is 1.2.840.113556.1.4.473.)

When constructing an LDAPSortControl object, you can specify the order in which you want the results sorted. You can also specify whether or not this control is critical to the search operation.

To specify the sort order, you construct an LdapSortKey object and pass it to the LdapSortControl constructor. The LdapSortKey object represents a list of the attribute types used for sorting (a "sort key list"). The LDAP server sends back a sort response control to indicate the result of the sorting operation. (The OID for this control is 1.2.840.113556.1.4.474.)

See Also:
LdapSortKey, LdapSortResponseControl, Serialized Form

Field Summary
 
Fields inherited from class netscape.ldap.controls.LDAPSortControl
SORTREQUEST, SORTRESPONSE
 
Fields inherited from class netscape.ldap.LDAPControl
m_critical, m_value, MANAGEDSAIT, PWEXPIRED, PWEXPIRING
 
Fields inherited from interface javax.naming.ldap.Control
CRITICAL, NONCRITICAL
 
Constructor Summary
LdapSortControl(LdapSortKey[] keys, boolean critical)
          Constructs an LDAPSortControl object with an array of sorting keys.
LdapSortControl(LdapSortKey key, boolean critical)
          Constructs an LDAPSortControl object with a single sorting key.
LdapSortControl(java.lang.String[] keys, boolean critical)
          Constructs an LDAPSortControl object with an array of sorting keys.
 
Method Summary
 byte[] getEncodedValue()
          Retrieves the ASN.1 BER encoded value of the LDAP control.
(package private) static LdapSortKey[] toSortKey(java.lang.String[] keysIn)
           
 
Methods inherited from class netscape.ldap.controls.LDAPSortControl
getFailedAttribute, getResultCode, parseResponse, toString
 
Methods inherited from class netscape.ldap.LDAPControl
clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, register
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.naming.ldap.Control
getID, isCritical
 

Constructor Detail

LdapSortControl

public LdapSortControl(LdapSortKey key,
                       boolean critical)
Constructs an LDAPSortControl object with a single sorting key.

Parameters:
key - A single attribute to sort by.
critical - true if the LDAP operation should be discarded when the server does not support this control (in other words, this control is critical to the LDAP operation).
See Also:
LdapSortKey

LdapSortControl

public LdapSortControl(LdapSortKey[] keys,
                       boolean critical)
Constructs an LDAPSortControl object with an array of sorting keys.

Parameters:
keys - The attributes to sort by.
critical - true if the LDAP operation should be discarded when the server does not support this control (in other words, this control is critical to the LDAP operation).
See Also:
LdapSortKey

LdapSortControl

public LdapSortControl(java.lang.String[] keys,
                       boolean critical)
Constructs an LDAPSortControl object with an array of sorting keys.

Parameters:
keys - The attributes to sort by.
critical - true if the LDAP operation should be discarded when the server does not support this control (in other words, this control is critical to the LDAP operation).
See Also:
LdapSortKey
Method Detail

toSortKey

static LdapSortKey[] toSortKey(java.lang.String[] keysIn)

getEncodedValue

public byte[] getEncodedValue()
Retrieves the ASN.1 BER encoded value of the LDAP control. Null is returned if the value is absent.

Specified by:
getEncodedValue in interface javax.naming.ldap.Control
Returns:
A possibly null byte array representing the ASN.1 BER encoded value of the LDAP control.