Interface ControlExchange<S extends Control,T extends Control>
- All Known Implementing Classes:
PagedResultsControlExchange,SortControlExchange
This interface defines the contract for managing the lifecycle of LDAP controls,
pairing a request Control with its corresponding response Control.
Implementations are typically immutable, with the withResponse(Control) method
returning a new instance that includes the response control.
Control exchanges are used by ControlExchangeDirContextProcessor to manage
controls across LDAP operations, particularly for stateful controls that require
maintaining information between successive requests (such as paged results or
server-side sorting).
- Since:
- 4.1
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the request control.@Nullable TReturns the response control, if one has been received.withResponse(T response) Creates a new exchange with the specified response control.
-
Method Details
-
getRequest
S getRequest()Returns the request control.- Returns:
- the request control
-
getResponse
@Nullable T getResponse()Returns the response control, if one has been received.- Returns:
- the response control, or
nullif no response has been received
-
withResponse
Creates a new exchange with the specified response control.Implementations typically create a new instance with the updated response, maintaining immutability. Some implementations may also update the request control based on information from the response (such as copying a cookie for paged results).
- Parameters:
response- the response control to include in the new exchange- Returns:
- a new
ControlExchangewith the response
-