org.gcube.searchsystem.environmentadaptor
Interface EnvironmentAdaptor

All Known Implementing Classes:
ResourceRegistryAdapter

public interface EnvironmentAdaptor

Classes that implement this interface provide the basic functionality needed by the search system, in order to discover the sources that could be part of a search operation

Author:
vasilis verroios

Method Summary
 Set<String> getCollectionByFieldRelationLang(Map<String,List<String>> fieldRelationMap, String language, List<String> projections)
          Get the collections for a number of criteria and a specific language.
 Map<String,Set<String>> getCollectionLangsByFieldRelation(Map<String,List<String>> fieldRelationMap, List<String> projections)
          Get the collection-languages pairs for a number of criteria.
 Set<String> getLanguageByFieldRelationCol(Map<String,List<String>> fieldRelationMap, String collection, List<String> projections)
          Get the languages for a number of criteria and a specific collection.
 long getLastUpdate()
           
 HashMap<String,HashSet<String>> getProjectionsPerSource(Set<String> sources, Set<String> projectionsNeeded, HashMap<String,HashSet<String>> colLangs)
          Get the fields projected by each of the sources of the input.
 Set<String> getSourceIdsForFieldRelationCollectionLanguage(String field, String relation, String collection, String language, String indication)
          Get source identifiers for all the sources that publish a searchable field for a specific collection and language AND they also support the specified relation, and they provide the capability(e.g.
 

Method Detail

getProjectionsPerSource

HashMap<String,HashSet<String>> getProjectionsPerSource(Set<String> sources,
                                                        Set<String> projectionsNeeded,
                                                        HashMap<String,HashSet<String>> colLangs)
                                                        throws Exception
Get the fields projected by each of the sources of the input. For including a field in the output(for a specific source) this field must be presentable for all the collection-language pairs specified in the input(for this specific source)

Parameters:
sources - - the sources of interest
projectionsNeeded - - the fields of interest
colLangs - - the collection-language pairs of interest
Returns:
a map containing the fields for each source
Throws:
Exception

getCollectionLangsByFieldRelation

Map<String,Set<String>> getCollectionLangsByFieldRelation(Map<String,List<String>> fieldRelationMap,
                                                          List<String> projections)
                                                          throws Exception
Get the collection-languages pairs for a number of criteria. The criteria are specified by field-relation pairs. The return map will have all the collection-language pairs for which there are sources for all the searchable field - supported relation pairs specified. The projections is an optional field, which specifies which are the presentable fields that must be published by sources for a collection-language pair

Parameters:
fieldRelationMap - - the search criteria specified
projections - - the presentation criteria specified
Returns:
the collection-language pairs satisfying the criteria
Throws:
Exception

getCollectionByFieldRelationLang

Set<String> getCollectionByFieldRelationLang(Map<String,List<String>> fieldRelationMap,
                                             String language,
                                             List<String> projections)
                                             throws Exception
Get the collections for a number of criteria and a specific language. The criteria are specified by field-relation pairs. The return map will have all the collections for which there are sources for all the (language+searchable)(meaning that the source publishes this field as searchable for this specific language and a collection X) field - supported relation pairs specified. The projections is an optional field, which specifies which are the (language+presentable) fields that must be published by sources for a collection

Parameters:
fieldRelationMap - - the search criteria specified
language - - the language specifed
projections - - the presentation criteria specified
Returns:
the list of collections satisfying the criteria for the language specified
Throws:
Exception

getLanguageByFieldRelationCol

Set<String> getLanguageByFieldRelationCol(Map<String,List<String>> fieldRelationMap,
                                          String collection,
                                          List<String> projections)
                                          throws Exception
Get the languages for a number of criteria and a specific collection. The criteria are specified by field-relation pairs. The return map will have all the languages for which there are sources for all the (collection+searchable)(meaning that the source publishes this field as searchable for this specific collection and a language X) field - supported relation pairs specified. The projections is an optional field, which specifies which are the (collection+presentable) fields that must be published by sources for a language

Parameters:
fieldRelationMap - - the search criteria specified
collection - - the collection specified
projections - - the presentation criteria specified
Returns:
the list of languages satisfying the criteria for the collection specified
Throws:
Exception

getSourceIdsForFieldRelationCollectionLanguage

Set<String> getSourceIdsForFieldRelationCollectionLanguage(String field,
                                                           String relation,
                                                           String collection,
                                                           String language,
                                                           String indication)
                                                           throws Exception
Get source identifiers for all the sources that publish a searchable field for a specific collection and language AND they also support the specified relation, and they provide the capability(e.g. rank) specified in the indication argument.

Parameters:
field - - the searchable field specified
relation - - the relation specified
collection - - the collection specified
language - - the language specified
indication - - the capability specified
Returns:
the set of source identifiers - note that these identifiers can be internal to the adaptor and in the next search stages(e.g. workflow), the same adaptor must be used.
Throws:
Exception

getLastUpdate

long getLastUpdate()


Copyright © 2013. All Rights Reserved.