Package org.springframework.ldap.control
Class SortControlDirContextProcessor
java.lang.Object
org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
org.springframework.ldap.control.AbstractFallbackRequestAndResponseControlDirContextProcessor
org.springframework.ldap.control.SortControlDirContextProcessor
- All Implemented Interfaces:
DirContextProcessor
public class SortControlDirContextProcessor
extends AbstractFallbackRequestAndResponseControlDirContextProcessor
DirContextProcessor implementation for managing the SortControl. Note that
this class is stateful, so a new instance needs to be instantiated for each
new search.
-
Field Summary
Fields inherited from class org.springframework.ldap.control.AbstractFallbackRequestAndResponseControlDirContextProcessor
critical, defaultRequestControl, defaultResponseControl, fallbackRequestControl, fallbackResponseControl, requestControlClass, responseControlClassFields inherited from class org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
log -
Constructor Summary
ConstructorsConstructorDescriptionSortControlDirContextProcessor(String sortKey) Constructs a new instance using the supplied sort key. -
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of the appropriate RequestControl.intGet the result code returned by the control.Get the sort key.protected voidhandleResponse(Object control) booleanisSorted()Check whether the returned values were actually sorted by the server.Methods inherited from class org.springframework.ldap.control.AbstractFallbackRequestAndResponseControlDirContextProcessor
createRequestControl, invokeMethod, loadControlClasses, postProcess, setCritical, setRequestControlClass, setResponseControlClassMethods inherited from class org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
isReplaceSameControlEnabled, preProcess, setReplaceSameControlEnabled
-
Constructor Details
-
SortControlDirContextProcessor
Constructs a new instance using the supplied sort key.- Parameters:
sortKey- the sort key, i.e. the attribute name to sort on.
-
-
Method Details
-
isSorted
public boolean isSorted()Check whether the returned values were actually sorted by the server.- Returns:
trueif the result was sorted,falseotherwise.
-
getResultCode
public int getResultCode()Get the result code returned by the control.- Returns:
- result code.
-
getSortKey
Get the sort key.- Returns:
- the sort key.
-
createRequestControl
Description copied from class:AbstractRequestControlDirContextProcessorCreate an instance of the appropriate RequestControl.- Specified by:
createRequestControlin classAbstractRequestControlDirContextProcessor- Returns:
- the new instance.
-
handleResponse
- Specified by:
handleResponsein classAbstractFallbackRequestAndResponseControlDirContextProcessor
-