LDAP Classes
Implements Java LDAP

com.novell.ldap.controls
Class LDAPSortKey

java.lang.Object
  extended bycom.novell.ldap.controls.LDAPSortKey

public class LDAPSortKey
extends java.lang.Object

Encapsulates parameters for sorting search results.

Sample Code: AsyncSortControl.java


Constructor Summary
LDAPSortKey(java.lang.String keyDescription)
          Constructs a new LDAPSortKey object using an attribute as the sort key.
LDAPSortKey(java.lang.String key, boolean reverse)
          Constructs a new LDAPSortKey object with the specified attribute name and sort order.
LDAPSortKey(java.lang.String key, boolean reverse, java.lang.String matchRule)
          Constructs a new LDAPSortKey object with the specified attribute name, sort order, and a matching rule.
 
Method Summary
 java.lang.String getKey()
          Returns the attribute to used for sorting.
 java.lang.String getMatchRule()
          Returns the OID to be used as a matching rule.
 boolean getReverse()
          Returns the sorting order, ascending or descending.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LDAPSortKey

public LDAPSortKey(java.lang.String keyDescription)
Constructs a new LDAPSortKey object using an attribute as the sort key.

Parameters:
keyDescription - The single attribute to use for sorting. If the name is preceded by a minus sign (-), the sorting is done in reverse (descending) order. An OID for a matching rule may be appended following a ":".
Examples:

LDAPSortKey

public LDAPSortKey(java.lang.String key,
                   boolean reverse)
Constructs a new LDAPSortKey object with the specified attribute name and sort order.

Parameters:
key - The single attribute to use for sorting.

reverse - If true, sorting is done in descending order. If false, sorting is done in ascending order.

LDAPSortKey

public LDAPSortKey(java.lang.String key,
                   boolean reverse,
                   java.lang.String matchRule)
Constructs a new LDAPSortKey object with the specified attribute name, sort order, and a matching rule.

Parameters:
key - The attribute name (for example, "cn") to use for sorting.

reverse - If true, sorting is done in descending order. If false, sorting is done in ascending order.

matchRule - The object ID (OID) of a matching rule used for collation. If the object will be used to request server-side sorting of search results, it should be the OID of a matching rule known to be supported by that server.
Method Detail

getKey

public java.lang.String getKey()
Returns the attribute to used for sorting.

Returns:
The name of the attribute used for sorting.

getReverse

public boolean getReverse()
Returns the sorting order, ascending or descending.

Returns:
True if the sorting is done is descending order; false, if the sorting is done is ascending order.

getMatchRule

public java.lang.String getMatchRule()
Returns the OID to be used as a matching rule.

Returns:
The OID to be used as matching rule, or null if none is to be used.

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000