org.ametys.plugins.datainclusion.data
Interface Query

All Known Implementing Classes:
AbstractQuery, LdapQuery, SqlQuery

public interface Query

Data interrogation query class.

Defines an interrogation query (SQL select, LDAP search, ...) on a specified data source, with optional parameters, which returns either a single result (i.e. name of a person in a LDAP directory), or a list of multiple structured results (i.e. list of products from a SQL database).


Nested Class Summary
static class Query.ResultType
          Query result type.
 
Field Summary
static Pattern PARAMETER_MATCHER
          Parameter matcher.
static String PARAMETER_PATTERN
          Parameter pattern.
 
Method Summary
<R extends QueryResult>
R
execute(Map<String,String> parameterValues)
          Execute the query with the specified parameter values.
 Map<String,String> getAdditionalConfiguration()
          Get the additional query configuration information.
<T extends DataSource>
T
getDataSource()
          Get the datasource on which depends this query.
 String getDescription()
          Get the query description.
 String getId()
          Get the query ID.
 String getName()
          Get the query name.
 List<String> getParameterNames()
          Get the query parameter names.
 Query.ResultType getResultType()
          Get the query result type.
 String getType()
          Get the query type.
 

Field Detail

PARAMETER_PATTERN

static final String PARAMETER_PATTERN
Parameter pattern.

See Also:
Constant Field Values

PARAMETER_MATCHER

static final Pattern PARAMETER_MATCHER
Parameter matcher.

Method Detail

getId

String getId()
Get the query ID.

Returns:
the query ID.

getName

String getName()
Get the query name.

Returns:
the query name.

getDescription

String getDescription()
Get the query description.

Returns:
the query description.

getType

String getType()
Get the query type.

Returns:
the query type.

getParameterNames

List<String> getParameterNames()
Get the query parameter names.

Returns:
the query parameter names as a Collection.

getResultType

Query.ResultType getResultType()
Get the query result type.

Returns:
the query result type.

getAdditionalConfiguration

Map<String,String> getAdditionalConfiguration()
Get the additional query configuration information.

Returns:
the additional query configuration information as a Map of String -> String.

getDataSource

<T extends DataSource> T getDataSource()
Get the datasource on which depends this query.

Type Parameters:
T - class implementing DataSource.
Returns:
the datasource on which depends this query.

execute

<R extends QueryResult> R execute(Map<String,String> parameterValues)
                              throws DataInclusionException
Execute the query with the specified parameter values.

Type Parameters:
R -
Parameters:
parameterValues - the parameter values as a Map (name -> value).
Returns:
the query result.
Throws:
DataInclusionException


Copyright © 2010 Anyware Services. All Rights Reserved.