Class PagedResultsControlExchange
- All Implemented Interfaces:
ControlExchange<PagedResultsControl,PagedResultsResponseControl>
ControlExchange implementation for managing LDAP paged results request and
response controls.
This class pairs a PagedResultsControl request with its corresponding
PagedResultsResponseControl response. The paged results control allows clients
to retrieve search results in pages of a specified size, with the response control
providing a cookie for retrieving subsequent pages.
Instances of this class are immutable. The
withResponse(PagedResultsResponseControl) method returns a new instance with
an updated request control that includes the cookie from the response, ready for the
next page request.
-
Constructor Summary
ConstructorsConstructorDescriptionPagedResultsControlExchange(int pageSize) Constructs a new paged results control exchange with the specified page size -
Method Summary
Modifier and TypeMethodDescriptionReturns the request control.@Nullable PagedResultsResponseControlReturns the response control, if one has been received.withResponse(PagedResultsResponseControl response) Creates a new exchange with an updated request control that includes the cookie from the response control.
-
Constructor Details
-
PagedResultsControlExchange
public PagedResultsControlExchange(int pageSize) Constructs a new paged results control exchange with the specified page size- Parameters:
pageSize- the number of entries to return in each page
-
-
Method Details
-
getRequest
Returns the request control.- Specified by:
getRequestin interfaceControlExchange<PagedResultsControl,PagedResultsResponseControl> - Returns:
- the request control
-
getResponse
Returns the response control, if one has been received.- Specified by:
getResponsein interfaceControlExchange<PagedResultsControl,PagedResultsResponseControl> - Returns:
- the response control, or
nullif no response has been received
-
withResponse
Creates a new exchange with an updated request control that includes the cookie from the response control.This method creates a new
PagedResultsControlExchange.SpringLdapPagedResultsControlwith the same page size and criticality as the current request, but with the cookie from the provided response. This prepares the control for requesting the next page of results.- Specified by:
withResponsein interfaceControlExchange<PagedResultsControl,PagedResultsResponseControl> - Parameters:
response- the response control containing the cookie for the next page- Returns:
- a new
PagedResultsControlExchangewith the updated request and the provided response
-