org.springframework.ldap.control
Class SortControlDirContextProcessor

java.lang.Object
  extended by org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
      extended by org.springframework.ldap.control.SortControlDirContextProcessor
All Implemented Interfaces:
DirContextProcessor

public class SortControlDirContextProcessor
extends AbstractRequestControlDirContextProcessor

DirContextProcessor implementation for managing the SortControl. Note that this class is stateful, so a new instance needs to be instantiated for each new search.

Author:
Ulrik Sandberg

Field Summary
 
Fields inherited from class org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
log
 
Constructor Summary
SortControlDirContextProcessor(java.lang.String sortKey)
          Constructs a new instance using the supplied sort key.
 
Method Summary
 javax.naming.ldap.Control createRequestControl()
          Create an instance of the appropriate RequestControl.
 int getResultCode()
          Get the result code returned by the control.
 java.lang.String getSortKey()
          Get the sort key.
 boolean isSorted()
          Check whether the returned values were actually sorted by the server.
 void postProcess(javax.naming.directory.DirContext ctx)
          Perform post-processing on the supplied DirContext.
 void setResponseControlClass(java.lang.Class responseControlClass)
          Set the class of the expected ResponseControl for the sorted result response.
 void setSortKey(java.lang.String sortKey)
          Set the sort key, i.e.
 
Methods inherited from class org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
preProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortControlDirContextProcessor

public SortControlDirContextProcessor(java.lang.String sortKey)
Constructs a new instance using the supplied sort key.

Parameters:
sortKey - the sort key, i.e. the attribute name to sort on.
Method Detail

setResponseControlClass

public void setResponseControlClass(java.lang.Class responseControlClass)
Set the class of the expected ResponseControl for the sorted result response. The default is SortResponseControl.

Parameters:
responseControlClass - Class of the expected response control.

isSorted

public boolean isSorted()
Check whether the returned values were actually sorted by the server.

Returns:
true if the result was sorted, false otherwise.

getResultCode

public int getResultCode()
Get the result code returned by the control.

Returns:
result code.

getSortKey

public java.lang.String getSortKey()
Get the sort key.

Returns:
the sort key.

setSortKey

public void setSortKey(java.lang.String sortKey)
Set the sort key, i.e. the attribute on which to sort on.

Parameters:
sortKey - the sort key.

createRequestControl

public javax.naming.ldap.Control createRequestControl()
Description copied from class: AbstractRequestControlDirContextProcessor
Create an instance of the appropriate RequestControl.

Specified by:
createRequestControl in class AbstractRequestControlDirContextProcessor
Returns:
the new instance.

postProcess

public void postProcess(javax.naming.directory.DirContext ctx)
                 throws javax.naming.NamingException
Description copied from interface: DirContextProcessor
Perform post-processing on the supplied DirContext.

Parameters:
ctx - the DirContext instance.
Throws:
javax.naming.NamingException - if thrown by the underlying operation.


Copyright � 2002-2006. All Rights Reserved.