Interface DataSourceFactory<Q extends Query,R extends QueryResult>
-
- Type Parameters:
Q
- The queryR
- The query result
- All Known Implementing Classes:
LdapDataSourceFactory
,SqlDataSourceFactory
public interface DataSourceFactory<Q extends Query,R extends QueryResult>
The DataSource Factory is responsible for building DataSource and Query objects. It handles one or several DataSource/Query types.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Q
buildQuery(String id, String type, String name, String description, Query.ResultType resultType, String dataSourceId, Map<String,String> additionalConfiguration)
Build a query with the specified information.R
execute(Q query, Map<String,String> parameterValues)
Execute the query with the specified parameter values.R
execute(Q query, Map<String,String> parameterValues, int offset, int limit)
Execute the query with the specified parameter values.Collection<DataSourceClientInteraction.DataSourceType>
getHandledTypes()
Get the types that the factory can build.Collection<String>
getQueryConfigurationParameters(String type)
The configuration parameters needed to build a Query of the specified type.
-
-
-
Method Detail
-
getHandledTypes
Collection<DataSourceClientInteraction.DataSourceType> getHandledTypes()
Get the types that the factory can build.- Returns:
- the handled types as a Collection.
-
getQueryConfigurationParameters
Collection<String> getQueryConfigurationParameters(String type)
The configuration parameters needed to build a Query of the specified type.- Parameters:
type
- the type of the Query.- Returns:
- the configuration parameters as a Collection.
-
buildQuery
Q buildQuery(String id, String type, String name, String description, Query.ResultType resultType, String dataSourceId, Map<String,String> additionalConfiguration) throws DataInclusionException
Build a query with the specified information.- Parameters:
id
- the Query ID.type
- the Query type.name
- the Query name.description
- the Query description.resultType
- the Query result type (single/multiple).dataSourceId
- the id of data sourceadditionalConfiguration
- additional query configuration parameter values as a Map<parameterName, parameterValue>.- Returns:
- the query.
- Throws:
DataInclusionException
- if an error occurs trying to create the Query.
-
execute
R execute(Q query, Map<String,String> parameterValues) throws DataInclusionException
Execute the query with the specified parameter values.- Parameters:
query
- The queryparameterValues
- the parameter values as a Map (name -> value).- Returns:
- the query result.
- Throws:
DataInclusionException
- if an error occurs while executing the query
-
execute
R execute(Q query, Map<String,String> parameterValues, int offset, int limit) throws DataInclusionException
Execute the query with the specified parameter values.- Parameters:
query
- The queryparameterValues
- the parameter values as a Map (name -> value).offset
- The start index of searchlimit
- The max number of result to return- Returns:
- the query result.
- Throws:
DataInclusionException
- if an error occurs while executing the query
-
-