Class 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.
    • Constructor Detail

      • SearchTemplatesExecutor

        public SearchTemplatesExecutor()
        Default constructor.
      • SearchTemplatesExecutor

        public SearchTemplatesExecutor​(AggregatePooledSearchExecutor executor,
                                       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 AggregatePooledSearchExecutor getSearchExecutor()
        Returns the search executor.
        Returns:
        aggregate pooled search executor
      • setSearchExecutor

        public void setSearchExecutor​(AggregatePooledSearchExecutor executor)
        Sets the search executor.
        Parameters:
        executor - aggregate pooled search executor
      • getConnectionFactories

        public PooledConnectionFactory[] getConnectionFactories()
        Returns the connection factories.
        Returns:
        pooled connection factories
      • setConnectionFactories

        public void setConnectionFactories​(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 SearchResult search​(Query query)
                            throws 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:
        LdapException - if the search fails
      • search

        protected SearchResult search​(SearchFilter[] filters,
                                      String[] returnAttrs,
                                      Integer fromResult,
                                      Integer toResult)
                               throws 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:
        LdapException - if the search fails
      • close

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