Class 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 Detail

      • logger

        protected final Logger logger
        Logger for this class.
      • 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 worker
        templates - 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 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.