org.ldaptive.async
Class AsyncSearchOperation.AsyncSearchListener

java.lang.Object
  extended by org.ldaptive.async.AsyncSearchOperation.AsyncSearchListener
All Implemented Interfaces:
ResponseListener, SearchListener
Enclosing class:
AsyncSearchOperation

protected class AsyncSearchOperation.AsyncSearchListener
extends Object
implements SearchListener

Async search listener used to build a search result and invoke search request handlers.


Constructor Summary
AsyncSearchOperation.AsyncSearchListener(SearchRequest request)
          Creates a new async search listener.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncSearchOperation.AsyncSearchListener

public AsyncSearchOperation.AsyncSearchListener(SearchRequest request)
Creates a new async search listener.

Parameters:
request - ldap search request
Method Detail

asyncRequestReceived

public void asyncRequestReceived(AsyncRequest request)
Invoked when an asynchronous operation has begun.

Specified by:
asyncRequestReceived in interface ResponseListener
Parameters:
request - to abandon this operation

searchItemReceived

public void searchItemReceived(SearchItem item)
Invoked when a search item is received from a provider.

Specified by:
searchItemReceived in interface SearchListener
Parameters:
item - containing a search result entry, reference, or intermediate response

responseReceived

public void responseReceived(Response<Void> response)
Invoked when a response is received from a provider indicating the operation has completed.

Specified by:
responseReceived in interface ResponseListener
Parameters:
response - containing the result

getResponse

public Response<SearchResult> getResponse()
                                   throws InterruptedException,
                                          LdapException
Returns the response data associated with this search, blocking until a response is available.

Returns:
response data
Throws:
InterruptedException - if this thread is interrupted before a response is received
LdapException - if the async search encountered an error

exceptionReceived

public void exceptionReceived(Exception exception)
Invoked when an exception is thrown from a provider indicating the operation cannot be completed.

Specified by:
exceptionReceived in interface ResponseListener
Parameters:
exception - thrown from the async operation

processAsyncRequest

protected void processAsyncRequest(AsyncRequest request)
                            throws LdapException
Invokes the handlers for the supplied async request. Calls responseReceived(Response) if a handler aborts the operation.

Parameters:
request - to handle
Throws:
LdapException - if a handler throws

processSearchItem

protected void processSearchItem(SearchItem item)
                          throws LdapException
Invokes the handlers for the supplied search item. Calls responseReceived(Response) if a handler aborts the operation.

Parameters:
item - to handle
Throws:
LdapException - if a handler throws


Copyright © 2003-2017 Virginia Tech. All Rights Reserved.