Package org.ldaptive.templates
Class SearchTemplatesOperation
- java.lang.Object
-
- org.ldaptive.templates.SearchTemplatesOperation
-
public class SearchTemplatesOperation 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected Logger
logger
Logger for this class.private SearchOperationWorker
searchOperationWorker
Search executor.private SearchTemplates[]
searchTemplates
Search templates.
-
Constructor Summary
Constructors Constructor Description SearchTemplatesOperation()
Default constructor.SearchTemplatesOperation(SearchOperationWorker worker, SearchTemplates... templates)
Creates a new search templates operation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes any resources associated with this object.protected SearchResponse
execute(FilterTemplate[] templates, String[] returnAttrs, Integer fromResult, Integer toResult)
Performs an LDAP search with the supplied templates and aggregates all the search results together.SearchResponse
execute(Query query)
Applies the supplied query to a search templates and aggregates all results into a single search result.SearchOperationWorker
getSearchOperationWorker()
Returns the search operation worker.SearchTemplates[]
getSearchTemplates()
Returns the search templates.void
setSearchOperationWorker(SearchOperationWorker worker)
Sets the search operation worker.void
setSearchTemplates(SearchTemplates[] templates)
Sets the search templates.String
toString()
-
-
-
Field Detail
-
logger
protected final Logger logger
Logger for this class.
-
searchOperationWorker
private SearchOperationWorker searchOperationWorker
Search executor.
-
searchTemplates
private SearchTemplates[] searchTemplates
Search templates.
-
-
Constructor Detail
-
SearchTemplatesOperation
public SearchTemplatesOperation()
Default constructor.
-
SearchTemplatesOperation
public SearchTemplatesOperation(SearchOperationWorker worker, SearchTemplates... templates)
Creates a new search templates operation.- Parameters:
worker
- search operation workertemplates
- search templates
-
-
Method Detail
-
getSearchOperationWorker
public SearchOperationWorker getSearchOperationWorker()
Returns the search operation worker.- Returns:
- search operation worker
-
setSearchOperationWorker
public void setSearchOperationWorker(SearchOperationWorker worker)
Sets the search operation worker.- Parameters:
worker
- search operation worker
-
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
-
execute
public SearchResponse execute(Query query)
Applies the supplied query to a search templates and aggregates all results into a single search result.- Parameters:
query
- to execute- Returns:
- ldap result
-
execute
protected SearchResponse execute(FilterTemplate[] templates, String[] returnAttrs, Integer fromResult, Integer toResult)
Performs an LDAP search with the supplied templates and aggregates all the search results together.- Parameters:
templates
- to executereturnAttrs
- attributes to return from the searchfromResult
- index to return results fromtoResult
- index to return results to- Returns:
- ldap result containing all results
-
close
public void close()
Closes any resources associated with this object.
-
-