@Experimental public final class SearchEngineRegistry extends Object
SearchEngineRegistry
manages the registered SearchEngine
s. Therefore
SearchEngines can be registered with a priority
(registerSearchEngine(SearchEngine, int)
) and can also be deregistered individually
(deregisterSearchEngine(SearchEngine)
).
By default the DefaultSearchEngine
is registered. Even if DefaultSearchEngine is
deregistered, it will still be used if no matching SearchEngine is found for a requested search.
From the registered SearchEngines the best one for a search with the specified
SearchConfiguration
is determined
(getBestSearchEngine(SearchConfiguration, Boolean)
).
Modifier and Type | Method and Description |
---|---|
void |
changePriority(SearchEngine searchEngine,
int priority)
Change the priority of a already registered SearchEngine.
|
void |
deregisterSearchEngine(SearchEngine searchEngine)
If the SearchEngine is registered the SearchEngine gets deregistered.
|
boolean |
executableSearchEngine(SearchConfiguration searchConfiguration)
It gets checked whether at least one of the registered search engines is executable for the
current SearchConfiguration.
|
SearchEngine |
getBestSearchEngine(SearchConfiguration searchConfiguration,
Boolean considerFeasibility)
Determines the best SearchEngine for this search based on the Quality.
|
SearchEngine |
getDefaultSearchEngine()
Getter for the default-SearchEngine.
|
static SearchEngineRegistry |
getInstance() |
Set<SearchEngine> |
getKeySetOfRegisteredSearchEngines() |
void |
registerSearchEngine(SearchEngine searchEngine,
int priority)
SearchEngines get registered if they are not already registered.
|
public static SearchEngineRegistry getInstance()
public SearchEngine getBestSearchEngine(SearchConfiguration searchConfiguration, Boolean considerFeasibility)
searchConfiguration
- provides information about the demanded searchconsiderFeasibility
- specifies whether the feasibility of a SearchEngine
should
be taken into accountpublic void registerSearchEngine(SearchEngine searchEngine, int priority)
searchEngine
- the SearchEngine to be registeredpriority
- the priority of the SearchEnginepublic void deregisterSearchEngine(SearchEngine searchEngine)
searchEngine
- the SearchEngine to be deregisteredpublic void changePriority(SearchEngine searchEngine, int priority)
searchEngine
- the SearchEngine whose priority is being changedpriority
- the new prioritypublic SearchEngine getDefaultSearchEngine()
public Set<SearchEngine> getKeySetOfRegisteredSearchEngines()
public boolean executableSearchEngine(SearchConfiguration searchConfiguration)
DefaultSearchEngine
,
which is then set by default, is checked for feasibility.Copyright © 2024 levigo holding gmbh. All rights reserved.