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
 java.util.Set<java.lang.String> getCollectionByFieldRelationLang(java.util.Map<java.lang.String,java.util.List<java.lang.String>> fieldRelationMap, java.lang.String language, java.util.List<java.lang.String> projections)
          Get the collections for a number of criteria and a specific language.
 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getCollectionLangsByFieldRelation(java.util.Map<java.lang.String,java.util.List<java.lang.String>> fieldRelationMap, java.util.List<java.lang.String> projections)
          Get the collection-languages pairs for a number of criteria.
 java.util.Set<java.lang.String> getLanguageByFieldRelationCol(java.util.Map<java.lang.String,java.util.List<java.lang.String>> fieldRelationMap, java.lang.String collection, java.util.List<java.lang.String> projections)
          Get the languages for a number of criteria and a specific collection.
 java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> getProjectionsPerSource(java.util.Set<java.lang.String> sources, java.util.Set<java.lang.String> projectionsNeeded, java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> colLangs)
          Get the fields projected by each of the sources of the input.
 java.util.Set<java.lang.String> getSourceIdsForFieldRelationCollectionLanguage(java.lang.String field, java.lang.String relation, java.lang.String collection, java.lang.String language, java.lang.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

java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> getProjectionsPerSource(java.util.Set<java.lang.String> sources,
                                                                                                java.util.Set<java.lang.String> projectionsNeeded,
                                                                                                java.util.HashMap<java.lang.String,java.util.HashSet<java.lang.String>> colLangs)
                                                                                                throws java.lang.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:
java.lang.Exception

getCollectionLangsByFieldRelation

java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getCollectionLangsByFieldRelation(java.util.Map<java.lang.String,java.util.List<java.lang.String>> fieldRelationMap,
                                                                                                  java.util.List<java.lang.String> projections)
                                                                                                  throws java.lang.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:
java.lang.Exception

getCollectionByFieldRelationLang

java.util.Set<java.lang.String> getCollectionByFieldRelationLang(java.util.Map<java.lang.String,java.util.List<java.lang.String>> fieldRelationMap,
                                                                 java.lang.String language,
                                                                 java.util.List<java.lang.String> projections)
                                                                 throws java.lang.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:
java.lang.Exception

getLanguageByFieldRelationCol

java.util.Set<java.lang.String> getLanguageByFieldRelationCol(java.util.Map<java.lang.String,java.util.List<java.lang.String>> fieldRelationMap,
                                                              java.lang.String collection,
                                                              java.util.List<java.lang.String> projections)
                                                              throws java.lang.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:
java.lang.Exception

getSourceIdsForFieldRelationCollectionLanguage

java.util.Set<java.lang.String> getSourceIdsForFieldRelationCollectionLanguage(java.lang.String field,
                                                                               java.lang.String relation,
                                                                               java.lang.String collection,
                                                                               java.lang.String language,
                                                                               java.lang.String indication)
                                                                               throws java.lang.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:
java.lang.Exception