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, responseControlClass
Fields inherited from class org.springframework.ldap.control.AbstractRequestControlDirContextProcessor
log
-
Constructor Summary
ConstructorDescriptionSortControlDirContextProcessor
(String sortKey) Constructs a new instance using the supplied sort key. -
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of the appropriate RequestControl.int
Get the result code returned by the control.Get the sort key.protected void
handleResponse
(Object control) boolean
isSorted()
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, setResponseControlClass
Methods 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:
true
if the result was sorted,false
otherwise.
-
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:AbstractRequestControlDirContextProcessor
Create an instance of the appropriate RequestControl.- Specified by:
createRequestControl
in classAbstractRequestControlDirContextProcessor
- Returns:
- the new instance.
-
handleResponse
- Specified by:
handleResponse
in classAbstractFallbackRequestAndResponseControlDirContextProcessor
-