org.ldaptive.concurrent
Class AggregatePooledSearchExecutor

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<PooledConnectionFactory>
                  extended by org.ldaptive.concurrent.AggregatePooledSearchExecutor
All Implemented Interfaces:
Message<RequestControl>, Request

public class AggregatePooledSearchExecutor
extends AbstractAggregateSearchExecutor<PooledConnectionFactory>

Executes a list of search filters in parallel over a list of connection factories, each search is performed on a separate connection in the pool. If you need to execute all searches on the same connection see AggregateSearchExecutor. 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
AggregatePooledSearchExecutor()
          Default constructor.
AggregatePooledSearchExecutor(ExecutorService es)
          Creates a new aggregate pooled search executor.
 
Method Summary
protected static
<Q extends Request,S>
Callable<Response<S>>
createCallable(Connection conn, Operation<Q,S> operation, Q request)
          Returns a Callable that executes the supplied request with the supplied operation in a try-finally block that opens and closes the connection.
 Collection<Response<SearchResult>> search(PooledConnectionFactory[] 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, getTypesOnly, hashCode, newObjectScopeSearchRequest, newObjectScopeSearchRequest, newObjectScopeSearchRequest, newSearchRequest, setBaseDn, setBinaryAttributes, setDerefAliases, setReturnAttributes, setSearchEntryHandlers, setSearchFilter, setSearchReferenceHandlers, setSearchScope, setSizeLimit, setSortBehavior, setTimeLimit, 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

AggregatePooledSearchExecutor

public AggregatePooledSearchExecutor()
Default constructor.


AggregatePooledSearchExecutor

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

Parameters:
es - executor service
Method Detail

search

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

Specified by:
search in class AbstractAggregateSearchExecutor<PooledConnectionFactory>
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<Response<S>> createCallable(Connection conn,
                                                                            Operation<Q,S> operation,
                                                                            Q request)
Returns a Callable that executes the supplied request with the supplied operation 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 operation will execute on
operation - to execute
request - to pass to the operation
Returns:
callable for the supplied operation and request


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