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.
  Author:
    Ulrik Sandberg

- - ### 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

    Constructors
    Constructor and Description
    `SortControlDirContextProcessor(String sortKey)` Constructs a new instance using the supplied sort key.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Control` | `createRequestControl()` Create an instance of the appropriate RequestControl.
    `int` | `getResultCode()` Get the result code returned by the control.
    `String` | `getSortKey()` 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SortControlDirContextProcessor

          public SortControlDirContextProcessor(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

    - #### 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 String getSortKey()

      Get the sort key.
      Returns:
        the sort key.

    - #### createRequestControl

          public Control createRequestControl()

      Description copied from class: `AbstractRequestControlDirContextProcessor`
      Create an instance of the appropriate RequestControl.
      Specified by:
        `createRequestControl` in class `AbstractRequestControlDirContextProcessor`
      Returns:
        the new instance.

    - #### handleResponse

          protected void handleResponse(Object control)

      Specified by:
        `handleResponse` in class `AbstractFallbackRequestAndResponseControlDirContextProcessor`