public class PagedResultsClient extends Object
Modifier and Type | Field and Description |
---|---|
private Connection |
connection
Connection to invoke the search operation on.
|
protected Logger |
logger
Logger for this class.
|
private int |
resultSize
Results page size.
|
Constructor and Description |
---|
PagedResultsClient(Connection conn,
int size)
Creates a new paged results client.
|
Modifier and Type | Method and Description |
---|---|
Response<SearchResult> |
execute(SearchRequest request)
Performs a search operation with the
PagedResultsControl . |
Response<SearchResult> |
execute(SearchRequest request,
CookieManager manager)
Performs a search operation with the
PagedResultsControl . |
Response<SearchResult> |
execute(SearchRequest request,
Response<SearchResult> response)
Performs a search operation with the
PagedResultsControl . |
Response<SearchResult> |
executeToCompletion(SearchRequest request)
Performs a search operation with the
PagedResultsControl . |
Response<SearchResult> |
executeToCompletion(SearchRequest request,
CookieManager manager)
Performs a search operation with the
PagedResultsControl . |
protected byte[] |
getPagedResultsCookie(Response<SearchResult> response)
Returns the paged results cookie in the supplied response or null if no cookie exists.
|
boolean |
hasMore(Response<SearchResult> response)
Returns whether
execute(SearchRequest, Response) can be invoked again. |
protected final Logger logger
private final Connection connection
private final int resultSize
public PagedResultsClient(Connection conn, int size)
conn
- to execute the search operation onsize
- the results page size to requestpublic Response<SearchResult> execute(SearchRequest request) throws LdapException
PagedResultsControl
. The supplied request is modified in the following
way:
request
- search request to executeLdapException
- if the search failspublic Response<SearchResult> execute(SearchRequest request, Response<SearchResult> response) throws LdapException
PagedResultsControl
. The supplied request is modified in the following
way:
AbstractRequest.setControls( org.ldaptive.control.RequestControl...)
is invoked with PagedResultsControl
The cookie is extracted from the supplied response and replayed in the request.
request
- search request to executeresponse
- of a previous paged results operationLdapException
- if the search failspublic Response<SearchResult> execute(SearchRequest request, CookieManager manager) throws LdapException
PagedResultsControl
. The supplied request is modified in the following
way:
AbstractRequest.setControls( org.ldaptive.control.RequestControl...)
is invoked with PagedResultsControl
The cookie used in the request is read from the cookie manager and written to the cookie manager after a successful search, if the response contains a cookie.
request
- search request to executemanager
- for reading and writing cookiesLdapException
- if the search failspublic boolean hasMore(Response<SearchResult> response)
execute(SearchRequest, Response)
can be invoked again.response
- of a previous paged results operationpublic Response<SearchResult> executeToCompletion(SearchRequest request) throws LdapException
PagedResultsControl
. The supplied request is modified in the following
way:
AbstractRequest.setControls( org.ldaptive.control.RequestControl...)
is invoked with PagedResultsControl
This method will continue to execute search operations until all paged search results have been retrieved from the server. The returned response contains the response data of the last paged result operation plus the entries and references returned by all previous search operations.
request
- search request to executeLdapException
- if the search failspublic Response<SearchResult> executeToCompletion(SearchRequest request, CookieManager manager) throws LdapException
PagedResultsControl
. The supplied request is modified in the following
way:
AbstractRequest.setControls( org.ldaptive.control.RequestControl...)
is invoked with PagedResultsControl
This method will continue to execute search operations until all paged search results have been retrieved from the server. The returned response contains the response data of the last paged result operation plus the entries and references returned by all previous search operations.
The cookie used for each request is read from the cookie manager and written to the cookie manager after a successful search, if the response contains a cookie.
request
- search request to executemanager
- for reading and writing cookiesLdapException
- if the search failsprotected byte[] getPagedResultsCookie(Response<SearchResult> response)
response
- of a previous paged results operationCopyright © 2003-2019 Virginia Tech. All Rights Reserved.