Esri Geoportal Server
1.0

com.esri.gpt.catalog.search
Class SearchEngineFactory

java.lang.Object
  extended by com.esri.gpt.catalog.search.ASearchEngine
      extended by com.esri.gpt.catalog.search.SearchEngineFactory
All Implemented Interfaces:
IRequest<SearchRequestDefinition>

public abstract class SearchEngineFactory
extends ASearchEngine

A factory for creating Search Data Access Objects. Factory caches the engines in session.


Constructor Summary
protected SearchEngineFactory()
          Instantiates a new search DAO factory.
 
Method Summary
static ASearchEngine createSearchEngine(SearchCriteria criteria, SearchResult result, RequestContext context, MessageBroker messageBroker)
          Creates a new SearchDAO object.
static ASearchEngine createSearchEngine(SearchCriteria criteria, SearchResult result, RequestContext context, String key, MessageBroker messageBroker)
          Creates a new SearchEngine object.
static ASearchEngine createSearchEngine(SearchCriteria criteria, SearchResult result, RequestContext context, String key, MessageBroker messageBroker, String username, String password)
          Creates a new Search
 ASearchEngine createSearchEngine(String endPointUrl, String endPointData, SearchPointOptions options)
          Creates a new SearchEngine object.
static Map<String,Object> createSearchEngines(SearchCriteria criteria, SearchResult result, RequestContext context, StringSet rids, MessageBroker messageBroker, String username, String password)
          Creates a new SearchEngine object.
static ASearchEngine getSearchEngine(String className, String key, RequestContext context)
          Gets the search engine.
 
Methods inherited from class com.esri.gpt.catalog.search.ASearchEngine
checkPagination, createInstances, doSearch, getConnectionTimeoutMs, getConnectionUri, getCredentials, getFactoryAttributes, getHitsOnly, getKey, getKeyAbstract, getMessageBroker, getMetadataAsSearchResultRecord, getMetadataAsText, getMetadataUrl, getRequestContext, getRequestDefinition, getResourceLinkBuilder, getResponseTimeoutMs, getSearchQuery, getSearchTimeInMillis, getTimeInSeconds, init, readInputCharacters, readIsExternalSearch, setConnectionTimeoutMs, setConnectionUri, setCredentials, setFactoryAttributes, setHitsOnly, setKey, setMessageBroker, setRequestContext, setRequestDefinition, setResourceLinkBuilder, setResponseTimeout, setSearchTimeInMillis
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchEngineFactory

protected SearchEngineFactory()
Instantiates a new search DAO factory.

Method Detail

createSearchEngine

public static ASearchEngine createSearchEngine(SearchCriteria criteria,
                                               SearchResult result,
                                               RequestContext context,
                                               MessageBroker messageBroker)
                                        throws SearchException
Creates a new SearchDAO object. This will return default searchEngine.

Parameters:
criteria - the criteria to be used by the search
result - the result reference where the results will be stored after \ search.
context - Used for connection information. Can be null if you intend to use CSW only.
messageBroker - the message broker
Returns:
the search Data Access
Throws:
SearchException - when URI to search cannot be found

createSearchEngine

public static ASearchEngine createSearchEngine(SearchCriteria criteria,
                                               SearchResult result,
                                               RequestContext context,
                                               String key,
                                               MessageBroker messageBroker)
                                        throws SearchException
Creates a new SearchEngine object.

Parameters:
criteria - the criteria (should never be null)
result - the result (should never be null)
context - the context (should never be null)
key - the key to find the corresponding search engine(should never be null)
messageBroker - the message broker
Returns:
search engine
Throws:
SearchException - the search exception
See Also:
createSearchEngine(SearchCriteria, SearchResult, RequestContext, String, MessageBroker, String, String)

createSearchEngine

public static ASearchEngine createSearchEngine(SearchCriteria criteria,
                                               SearchResult result,
                                               RequestContext context,
                                               String key,
                                               MessageBroker messageBroker,
                                               String username,
                                               String password)
                                        throws SearchException
Creates a new Search

Parameters:
criteria - the criteria (should never be null)
result - the result (should never be null)
context - the context (should never be null)
key - the key to find the corresponding search engine(should never be null) (Should be a string to be used with regex on the SearchConfig.getSearchFactoryRepos() key
username - the username
password - the password
Returns:
the a search engine (never null, default search engine returned if no engine is found corresponding to key
Throws:
SearchException - Thrown if any parameters are null and on other faults

createSearchEngine

public ASearchEngine createSearchEngine(String endPointUrl,
                                        String endPointData,
                                        SearchPointOptions options)
Creates a new SearchEngine object.

Parameters:
endPointUrl - the end point url
endPointData - the end point data
options - the options
Returns:
the a search engine

getSearchEngine

public static ASearchEngine getSearchEngine(String className,
                                            String key,
                                            RequestContext context)
                                     throws SearchException
Gets the search engine. Sto/res it in the session incase it is encountered again.

Parameters:
className - the class name
key - the key
context - the context
Returns:
the search engine (never null)
Throws:
SearchException - if class cannot be constructed

createSearchEngines

public static Map<String,Object> createSearchEngines(SearchCriteria criteria,
                                                     SearchResult result,
                                                     RequestContext context,
                                                     StringSet rids,
                                                     MessageBroker messageBroker,
                                                     String username,
                                                     String password)
                                              throws SearchException
Creates a new SearchEngine object.

Parameters:
criteria - the criteria
result - the result
context - the context
rids - the rids
messageBroker - the message broker
username - the username
password - the password
Returns:
the map
Throws:
SearchException - the search exception

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.