org.ldaptive.templates
Class SearchTemplatesExecutor

java.lang.Object
  extended by org.ldaptive.templates.SearchTemplatesExecutor
Direct Known Subclasses:
AbstractServletSearchTemplatesExecutor

public class SearchTemplatesExecutor
extends Object

Searches an LDAP using a defined set of search templates. For each term count some number of templates are defined and used for searching.

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

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
SearchTemplatesExecutor()
          Default constructor.
SearchTemplatesExecutor(org.ldaptive.concurrent.AggregatePooledSearchExecutor executor, org.ldaptive.pool.PooledConnectionFactory[] factories, SearchTemplates... templates)
          Creates a new templates search executor.
 
Method Summary
 void close()
          Closes any resources associated with this object.
 org.ldaptive.pool.PooledConnectionFactory[] getConnectionFactories()
          Returns the connection factories.
 org.ldaptive.concurrent.AggregatePooledSearchExecutor getSearchExecutor()
          Returns the search executor.
 SearchTemplates[] getSearchTemplates()
          Returns the search templates.
 org.ldaptive.SearchResult search(Query query)
          Applies the supplied query to a search templates and aggregates all results into a single search result.
protected  org.ldaptive.SearchResult search(org.ldaptive.SearchFilter[] filters, String[] returnAttrs, Integer fromResult, Integer toResult)
          Performs an LDAP search with the supplied filters and aggregates all the search results together.
 void setConnectionFactories(org.ldaptive.pool.PooledConnectionFactory[] factories)
          Sets the connection factories.
 void setSearchExecutor(org.ldaptive.concurrent.AggregatePooledSearchExecutor executor)
          Sets the search executor.
 void setSearchTemplates(SearchTemplates[] templates)
          Sets the search templates.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

SearchTemplatesExecutor

public SearchTemplatesExecutor()
Default constructor.


SearchTemplatesExecutor

public SearchTemplatesExecutor(org.ldaptive.concurrent.AggregatePooledSearchExecutor executor,
                               org.ldaptive.pool.PooledConnectionFactory[] factories,
                               SearchTemplates... templates)
Creates a new templates search executor.

Parameters:
executor - aggregate pooled search executor
factories - pooled connection factories
templates - search templates
Method Detail

getSearchExecutor

public org.ldaptive.concurrent.AggregatePooledSearchExecutor getSearchExecutor()
Returns the search executor.

Returns:
aggregate pooled search executor

setSearchExecutor

public void setSearchExecutor(org.ldaptive.concurrent.AggregatePooledSearchExecutor executor)
Sets the search executor.

Parameters:
executor - aggregate pooled search executor

getConnectionFactories

public org.ldaptive.pool.PooledConnectionFactory[] getConnectionFactories()
Returns the connection factories.

Returns:
pooled connection factories

setConnectionFactories

public void setConnectionFactories(org.ldaptive.pool.PooledConnectionFactory[] factories)
Sets the connection factories.

Parameters:
factories - pooled connection factory

getSearchTemplates

public SearchTemplates[] getSearchTemplates()
Returns the search templates.

Returns:
search templates

setSearchTemplates

public void setSearchTemplates(SearchTemplates[] templates)
Sets the search templates.

Parameters:
templates - search templates

search

public org.ldaptive.SearchResult search(Query query)
                                 throws org.ldaptive.LdapException
Applies the supplied query to a search templates and aggregates all results into a single search result.

Parameters:
query - to execute
Returns:
ldap result
Throws:
org.ldaptive.LdapException - if the search fails

search

protected org.ldaptive.SearchResult search(org.ldaptive.SearchFilter[] filters,
                                           String[] returnAttrs,
                                           Integer fromResult,
                                           Integer toResult)
                                    throws org.ldaptive.LdapException
Performs an LDAP search with the supplied filters and aggregates all the search results together.

Parameters:
filters - to execute
returnAttrs - attributes to return from the search
fromResult - index to return results from
toResult - index to return results to
Returns:
ldap result containing all results
Throws:
org.ldaptive.LdapException - if the search fails

close

public void close()
Closes any resources associated with this object.


toString

public String toString()

Overrides:
toString in class Object


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