|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.common.core.informationsystem.client.impl.AbstractClient
public abstract class AbstractClient
Partial implementation of the ISClient.
Subclasses implement specific methods to load implementations of standard {link ISQuery ISQueries},
and to execute those queries against the associated Information System.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.gcube.common.core.informationsystem.client.ISClient |
|---|
ISClient.ISMalformedQueryException, ISClient.ISMalformedResultException, ISClient.ISUnsupportedQueryException |
| Field Summary | |
|---|---|
protected static Map<String,String> |
genericQueries
Query implementations indexed by their implementation-defined name. |
protected static Map<Class<? extends ISQuery<?>>,Class<? extends ISQuery<?>>> |
implementationMap
Query implementations indexed by their standard interface. |
protected GCUBELog |
logger
Object logger. |
| Constructor Summary | |
|---|---|
AbstractClient()
Creates a new instance and loads query implementations if not previously done. |
|
| Method Summary | ||
|---|---|---|
protected void |
checkQuery(ISQuery<?> query)
Invoked internally by execute(ISQuery, GCUBEScope) to check that a
can be handled by the implementation and is in fact well-formed. |
|
abstract
|
execute(ISQuery<RESULT> query,
GCUBEScope scope)
Evaluates a query in a given scope and returns its results a local list. |
|
abstract
|
executeByRef(ISQuery<RESULT> query,
GCUBEScope scope)
Implement to execute the query against the associated Information System in a given scope, and to return the locator of a resultset which contains the unparsed result serialisations. |
|
|
getQuery(Class<QUERY> clazz)
Returns a query from the interface or class which defines its type. |
|
protected Class<? extends AbstractQuery> |
getQueryBaseClass()
Returns the subtype of AbstractQuery used as the base class for query implementations. |
|
protected abstract void |
loadGenericQueries(Map<String,String> queryMap)
Implement to load query implementations in a map which indexes by their standard interfaces. |
|
protected abstract void |
loadQueries(Map<Class<? extends ISQuery<?>>,Class<? extends ISQuery<?>>> queryMap)
Implement to load query implementations in a map which indexes by their standard interfaces. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.gcube.common.core.informationsystem.client.ISClient |
|---|
getQuery |
| Field Detail |
|---|
protected GCUBELog logger
protected static Map<Class<? extends ISQuery<?>>,Class<? extends ISQuery<?>>> implementationMap
protected static Map<String,String> genericQueries
| Constructor Detail |
|---|
public AbstractClient()
| Method Detail |
|---|
protected abstract void loadQueries(Map<Class<? extends ISQuery<?>>,Class<? extends ISQuery<?>>> queryMap)
queryMap - the map.protected abstract void loadGenericQueries(Map<String,String> queryMap)
queryMap - the map.
public <RESULT,QUERY extends ISQuery<RESULT>> QUERY getQuery(Class<QUERY> clazz)
throws ISClient.ISUnsupportedQueryException,
InstantiationException,
IllegalAccessException
getQuery in interface ISClientRESULT - the type of the query results.QUERY - the type of the query which produces results of type RESULT.clazz - the query interface or class.
ISClient.ISUnsupportedQueryException
InstantiationException
IllegalAccessException
public abstract <RESULT> List<RESULT> execute(ISQuery<RESULT> query,
GCUBEScope scope)
throws ISClient.ISUnsupportedQueryException,
ISException
execute in interface ISClientRESULT - The type of the query results.query - the query.scope - the scope.
ISMalformedResultException
ISClient.ISMalformedQueryException - if the query is incorrectly formulated and cannot produce results.
ISException - if the evaluation could not be completed.
ISClient.ISUnsupportedQueryException
protected void checkQuery(ISQuery<?> query)
throws ISClient.ISMalformedQueryException,
ISClient.ISUnsupportedQueryException
execute(ISQuery, GCUBEScope) to check that a
can be handled by the implementation and is in fact well-formed.
By default it checks that the query is an AbstractQuery and can thus be handled by subclasses.
Subclasses may wish to override the method to enforce more specific checks.
query - the query.
ISMalformedQueryException - if the query is not well-formed.
ISInvalidQueryException - if the query if of a type which cannot be processed by the implementatio
ISClient.ISMalformedQueryException
ISClient.ISUnsupportedQueryException
public abstract <RESULT> ISInputStream<RESULT> executeByRef(ISQuery<RESULT> query,
GCUBEScope scope)
throws ISClient.ISMalformedQueryException,
ISClient.ISUnsupportedQueryException,
ISException
AbstractQuery used by the implementation, as runtime checks.
have already been performed.
executeByRef in interface ISClientRESULT - The type of the query results.query - the query.scope - the scope.
ISException - if the query could not be executed
ISClient.ISMalformedQueryException - if the query is incorrectly formulated and cannot produce results.
ISClient.ISUnsupportedQueryExceptionprotected Class<? extends AbstractQuery> getQueryBaseClass()
AbstractQuery used as the base class for query implementations.
This is used by the client to check the validity of queries once and where most convenient
on behalf of its subclasses.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||