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 Details

    • logger

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

      private SearchOperationWorker searchOperationWorker
      Search executor.
    • searchTemplates

      private SearchTemplates[] searchTemplates
      Search templates.
  • Constructor Details

    • SearchTemplatesOperation

      public SearchTemplatesOperation()
      Default constructor.
    • SearchTemplatesOperation

      public SearchTemplatesOperation(SearchOperationWorker worker, SearchTemplates... templates)
      Creates a new search templates operation.
      Parameters:
      worker - search operation worker
      templates - search templates
  • Method Details

    • 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 execute templates.
      Parameters:
      templates - execute 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 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
    • close

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

      public String toString()
      Overrides:
      toString in class Object