org.ldaptive
Class SearchOperation

java.lang.Object
  extended by org.ldaptive.AbstractOperation<SearchRequest,SearchResult>
      extended by org.ldaptive.SearchOperation
All Implemented Interfaces:
Operation<SearchRequest,SearchResult>

public class SearchOperation
extends AbstractOperation<SearchRequest,SearchResult>

Executes an ldap search operation.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ldaptive.AbstractOperation
AbstractOperation.ReopenOperationExceptionHandler
 
Field Summary
 
Fields inherited from class org.ldaptive.AbstractOperation
logger
 
Constructor Summary
SearchOperation(Connection conn)
          Creates a new search operation.
SearchOperation(Connection conn, Cache<SearchRequest> c)
          Creates a new search operation.
 
Method Summary
protected  Response<SearchResult> executeSearch(SearchRequest request)
          Performs the ldap search.
 Cache<SearchRequest> getCache()
          Returns the cache to check when performing search operations.
protected  Response<SearchResult> invoke(SearchRequest request)
          Call the provider specific implementation of this ldap operation.
protected  SearchResult readResult(SearchRequest request, SearchIterator si)
          Invokes the provider search operation and iterates over the results.
 void setCache(Cache<SearchRequest> c)
          Sets the cache.
 
Methods inherited from class org.ldaptive.AbstractOperation
execute, executeHandlers, getConnection, getOperationExceptionHandler, getOperationResponseHandlers, setOperationExceptionHandler, setOperationResponseHandlers, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchOperation

public SearchOperation(Connection conn)
Creates a new search operation.

Parameters:
conn - connection

SearchOperation

public SearchOperation(Connection conn,
                       Cache<SearchRequest> c)
Creates a new search operation.

Parameters:
conn - connection
c - cache
Method Detail

getCache

public Cache<SearchRequest> getCache()
Returns the cache to check when performing search operations. When a cache is provided it will be populated as new searches are performed and used when a search request hits the cache.

Returns:
cache

setCache

public void setCache(Cache<SearchRequest> c)
Sets the cache.

Parameters:
c - cache to set

invoke

protected Response<SearchResult> invoke(SearchRequest request)
                                 throws LdapException
Call the provider specific implementation of this ldap operation.

Specified by:
invoke in class AbstractOperation<SearchRequest,SearchResult>
Parameters:
request - ldap request
Returns:
ldap response
Throws:
LdapException - if the invocation fails

executeSearch

protected Response<SearchResult> executeSearch(SearchRequest request)
                                        throws LdapException
Performs the ldap search.

Parameters:
request - to invoke search with
Returns:
ldap response
Throws:
LdapException - if an error occurs

readResult

protected SearchResult readResult(SearchRequest request,
                                  SearchIterator si)
                           throws LdapException
Invokes the provider search operation and iterates over the results. Invokes handlers as necessary for each result type.

Parameters:
request - used to create the search iterator
si - search iterator
Returns:
search result
Throws:
LdapException - if an error occurs


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