org.ldaptive.concurrent
Class AggregateSearchExecutor

java.lang.Object
  extended by org.ldaptive.AbstractRequest
      extended by org.ldaptive.SearchRequest
          extended by org.ldaptive.concurrent.AbstractSearchExecutor
              extended by org.ldaptive.concurrent.AbstractAggregateSearchExecutor<ConnectionFactory>
                  extended by org.ldaptive.concurrent.AggregateSearchExecutor
All Implemented Interfaces:
Message<RequestControl>, Request

public class AggregateSearchExecutor
extends AbstractAggregateSearchExecutor<ConnectionFactory>

Executes a list of search filters in parallel over a list of connection factories. This implementation executes each search on the same connection in separate threads. If you need parallel searches over a pool of connections see AggregatePooledSearchExecutor. A cached thread pool is used by default.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Field Summary
 
Fields inherited from class org.ldaptive.concurrent.AbstractSearchExecutor
logger
 
Constructor Summary
AggregateSearchExecutor()
          Default constructor.
AggregateSearchExecutor(ExecutorService es)
          Creates a new aggregate search executor.
 
Method Summary
protected static
<Q extends Request,S>
Callable<Collection<Response<S>>>
createCallable(Connection conn, OperationWorker<Q,S> worker, Q[] requests)
          Returns a Callable that executes the supplied request with the supplied worker in a try-finally block that opens and closes the connection.
 Collection<Response<SearchResult>> search(ConnectionFactory[] factories, SearchFilter[] filters, String[] attrs, SearchEntryHandler... handlers)
          Performs a search operation with the supplied connection factories.
 
Methods inherited from class org.ldaptive.concurrent.AbstractAggregateSearchExecutor
search, search, search, search
 
Methods inherited from class org.ldaptive.concurrent.AbstractSearchExecutor
createSearchOperation, finalize, getExecutorService, getSearchCache, getSearchExceptionHandler, getSearchResponseHandlers, setSearchCache, setSearchExceptionHandler, setSearchResponseHandlers, shutdown, shutdownNow, toString
 
Methods inherited from class org.ldaptive.SearchRequest
equals, getBaseDn, getBinaryAttributes, getDerefAliases, getReturnAttributes, getSearchEntryHandlers, getSearchFilter, getSearchReferenceHandlers, getSearchScope, getSizeLimit, getSortBehavior, getTimeLimit, getTimeLimitDuration, getTypesOnly, hashCode, newObjectScopeSearchRequest, newObjectScopeSearchRequest, newObjectScopeSearchRequest, newSearchRequest, setBaseDn, setBinaryAttributes, setDerefAliases, setReturnAttributes, setSearchEntryHandlers, setSearchFilter, setSearchReferenceHandlers, setSearchScope, setSizeLimit, setSortBehavior, setTimeLimit, setTimeLimitDuration, setTypesOnly
 
Methods inherited from class org.ldaptive.AbstractRequest
getControls, getFollowReferrals, getIntermediateResponseHandlers, setControls, setFollowReferrals, setIntermediateResponseHandlers
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AggregateSearchExecutor

public AggregateSearchExecutor()
Default constructor.


AggregateSearchExecutor

public AggregateSearchExecutor(ExecutorService es)
Creates a new aggregate search executor.

Parameters:
es - executor service
Method Detail

search

public Collection<Response<SearchResult>> search(ConnectionFactory[] factories,
                                                 SearchFilter[] filters,
                                                 String[] attrs,
                                                 SearchEntryHandler... handlers)
                                          throws LdapException
Performs a search operation with the supplied connection factories.

Specified by:
search in class AbstractAggregateSearchExecutor<ConnectionFactory>
Parameters:
factories - to get a connection from
filters - to search with
attrs - to return
handlers - entry handlers
Returns:
search results
Throws:
LdapException - if the search fails

createCallable

protected static <Q extends Request,S> Callable<Collection<Response<S>>> createCallable(Connection conn,
                                                                                        OperationWorker<Q,S> worker,
                                                                                        Q[] requests)
Returns a Callable that executes the supplied request with the supplied worker in a try-finally block that opens and closes the connection.

Type Parameters:
Q - type of ldap request
S - type of ldap response
Parameters:
conn - connection that the worker will execute on
worker - to execute
requests - to pass to the worker
Returns:
callable for the supplied operation and request


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