org.ametys.plugins.datainclusion.data
Interface DataSourceFactory

All Known Implementing Classes:
LdapDataSourceFactory, SqlDataSourceFactory

public interface DataSourceFactory

The DataSource Factory is responsible for building DataSource and Query objects. It handles one or several DataSource/Query types.


Method Summary
 DataSource buildDataSource(String id, String type, String name, String description, Map<String,String> additionalConfiguration)
          Build a data source with the specified information.
 Query buildQuery(String id, String type, String name, String description, Query.ResultType resultType, DataSource dataSource, Map<String,String> additionalConfiguration)
          Build a query with the specified information.
 Collection<String> getDataSourceConfigurationParameters(String type)
          The configuration parameters needed to build a DataSource of the specified type.
 Collection<String> 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<String> getHandledTypes()
Get the types that the factory can build.

Returns:
the handled types as a Collection.

getDataSourceConfigurationParameters

Collection<String> getDataSourceConfigurationParameters(String type)
The configuration parameters needed to build a DataSource of the specified type.

Parameters:
type - the type of the DataSource.
Returns:
the configuration parameters 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.

buildDataSource

DataSource buildDataSource(String id,
                           String type,
                           String name,
                           String description,
                           Map<String,String> additionalConfiguration)
                           throws DataInclusionException
Build a data source with the specified information.

Parameters:
id - the DataSource ID.
type - the DataSource type.
name - the DataSource name.
description - the DataSource description.
additionalConfiguration - additional data source configuration parameter values as a Map<parameterName, parameterValue>.
Returns:
the data source.
Throws:
DataInclusionException - if an error occurs trying to create the DataSource.

buildQuery

Query buildQuery(String id,
                 String type,
                 String name,
                 String description,
                 Query.ResultType resultType,
                 DataSource dataSource,
                 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).
dataSource - the DataSource the Query depends on.
additionalConfiguration - additional query configuration parameter values as a Map<parameterName, parameterValue>.
Returns:
the query.
Throws:
DataInclusionException - if an error occurs trying to create the Query.


Copyright © 2010 Anyware Services. All Rights Reserved.