org.ldaptive.concurrent
Class ParallelPooledSearchExecutor

java.lang.Object
  extended by org.ldaptive.AbstractRequest
      extended by org.ldaptive.SearchRequest
          extended by org.ldaptive.concurrent.AbstractSearchExecutor
              extended by org.ldaptive.concurrent.AbstractParallelSearchExecutor<PooledConnectionFactory>
                  extended by org.ldaptive.concurrent.ParallelPooledSearchExecutor
All Implemented Interfaces:
Message<RequestControl>, Request

public class ParallelPooledSearchExecutor
extends AbstractParallelSearchExecutor<PooledConnectionFactory>

Executes a list of search filters in parallel, each search is performed on a separate connection in the pool. If you need to execute all searches on the same connection see ParallelSearchExecutor. 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
ParallelPooledSearchExecutor()
          Default constructor.
ParallelPooledSearchExecutor(ExecutorService es)
          Creates a new parallel 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 factory, SearchFilter[] filters, String[] attrs, SearchEntryHandler... handlers)
          Performs a search operation with the supplied connection factory.
 
Methods inherited from class org.ldaptive.concurrent.AbstractParallelSearchExecutor
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

ParallelPooledSearchExecutor

public ParallelPooledSearchExecutor()
Default constructor.


ParallelPooledSearchExecutor

public ParallelPooledSearchExecutor(ExecutorService es)
Creates a new parallel pooled search executor.

Parameters:
es - executor service
Method Detail

search

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

Specified by:
search in class AbstractParallelSearchExecutor<PooledConnectionFactory>
Parameters:
factory - 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-2017 Virginia Tech. All Rights Reserved.