Class SortControlExchange
java.lang.Object
org.springframework.ldap.control.SortControlExchange
- All Implemented Interfaces:
ControlExchange<SortControl, SortResponseControl>
public class SortControlExchange
extends Object
implements ControlExchange<SortControl, SortResponseControl>
A
ControlExchange implementation for managing LDAP server-side sort request and
response controls.
This class pairs a SortControl request with its corresponding
SortResponseControl response. The sort control requests that search results be
sorted by the server, and the response control indicates whether the sort was
successful and provides result codes if there were errors.
Instances of this class are immutable. The withResponse(SortResponseControl)
method returns a new instance with the updated response control.
- Since:
- 4.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSortControlExchange(String... sortBy) Constructs a new sort control exchange with the specified attributes to sort by -
Method Summary
Modifier and TypeMethodDescriptionReturns the request control.@Nullable SortResponseControlReturns the response control, if one has been received.withResponse(SortResponseControl response) Creates a new exchange with the specified response control.
-
Constructor Details
-
SortControlExchange
Constructs a new sort control exchange with the specified attributes to sort by- Parameters:
sortBy- the attributes to sort by
-
-
Method Details
-
getRequest
Returns the request control.- Specified by:
getRequestin interfaceControlExchange<SortControl, SortResponseControl>- Returns:
- the request control
-
getResponse
Returns the response control, if one has been received.- Specified by:
getResponsein interfaceControlExchange<SortControl, SortResponseControl>- Returns:
- the response control, or
nullif no response has been received
-
withResponse
Creates a new exchange with the specified response control.If the provided control is not a
SortResponseControl, this method returns the current exchange unchanged.- Specified by:
withResponsein interfaceControlExchange<SortControl, SortResponseControl>- Parameters:
response- the response control to add to the exchange- Returns:
- a new
SortControlExchangewith the response, or this exchange if the response is not aSortResponseControl
-