protected class AsyncSearchOperation.AsyncSearchListener extends Object implements SearchListener
Modifier and Type | Field and Description |
---|---|
private Semaphore |
responseLock
Wait for the response to arrive.
|
private LdapException |
searchException
Thrown by the async search operation.
|
private SearchRequest |
searchRequest
Containing request handlers.
|
private Response<SearchResult> |
searchResponse
To return when a response is received or the operation is aborted.
|
private SearchResult |
searchResult
To build as results arrive.
|
Constructor and Description |
---|
AsyncSearchListener(SearchRequest request)
Creates a new async search listener.
|
Modifier and Type | Method and Description |
---|---|
void |
asyncRequestReceived(AsyncRequest request)
Invoked when an asynchronous operation has begun.
|
void |
exceptionReceived(Exception exception)
Invoked when an exception is thrown from a provider indicating the operation cannot be completed.
|
Response<SearchResult> |
getResponse()
Returns the response data associated with this search, blocking until a response is available.
|
protected void |
processAsyncRequest(AsyncRequest request)
Invokes the handlers for the supplied async request.
|
protected void |
processSearchItem(SearchItem item)
Invokes the handlers for the supplied search item.
|
void |
responseReceived(Response<Void> response)
Invoked when a response is received from a provider indicating the operation has completed.
|
void |
searchItemReceived(SearchItem item)
Invoked when a search item is received from a provider.
|
private final SearchRequest searchRequest
private final SearchResult searchResult
private final Semaphore responseLock
private Response<SearchResult> searchResponse
private LdapException searchException
public AsyncSearchListener(SearchRequest request)
request
- ldap search requestpublic void asyncRequestReceived(AsyncRequest request)
ResponseListener
asyncRequestReceived
in interface ResponseListener
request
- to abandon this operationpublic void searchItemReceived(SearchItem item)
SearchListener
searchItemReceived
in interface SearchListener
item
- containing a search result entry, reference, or intermediate responsepublic void responseReceived(Response<Void> response)
ResponseListener
responseReceived
in interface ResponseListener
response
- containing the resultpublic Response<SearchResult> getResponse() throws InterruptedException, LdapException
InterruptedException
- if this thread is interrupted before a response is receivedLdapException
- if the async search encountered an errorpublic void exceptionReceived(Exception exception)
ResponseListener
exceptionReceived
in interface ResponseListener
exception
- thrown from the async operationprotected void processAsyncRequest(AsyncRequest request) throws LdapException
responseReceived(Response)
if a handler
aborts the operation.request
- to handleLdapException
- if a handler throwsprotected void processSearchItem(SearchItem item) throws LdapException
responseReceived(Response)
if a handler aborts
the operation.item
- to handleLdapException
- if a handler throwsCopyright © 2003-2019 Virginia Tech. All Rights Reserved.