org.apache.ws.resource.properties.query
Interface QueryEngine

All Known Implementing Classes:
QueryEngineImpl

public interface QueryEngine

The QueryEngine interface is used to map queries on the service data of a service to the appropriate ExpressionEvaluators and then return the result. ExpressionEvaluators can be preconfigured or dynamically added at runtime.

See Also:
ExpressionEvaluator

Method Summary
 java.lang.Object executeQuery(QueryExpression queryExpr, ResourcePropertySet resourcePropSet, org.w3c.dom.Element nsContext)
          Executes a query against a resource property set.
 ExpressionEvaluator getEvaluator(java.net.URI dialect)
          Gets the evaluator currently registered to handle an expression of the specified qualified name (from the top level element of the XML Schema definition of the expression)
 void registerEvaluator(ExpressionEvaluator evaluator)
          registers a new evaluator that can be used to evaluate queries on a service.
 void registerEvaluator(java.net.URI dialect, ExpressionEvaluator evaluator)
          DOCUMENT_ME
 

Method Detail

getEvaluator

public ExpressionEvaluator getEvaluator(java.net.URI dialect)
Gets the evaluator currently registered to handle an expression of the specified qualified name (from the top level element of the XML Schema definition of the expression)

Returns:
the matching expression evaluator or null if none was found

registerEvaluator

public void registerEvaluator(ExpressionEvaluator evaluator)
registers a new evaluator that can be used to evaluate queries on a service.

Parameters:
evaluator - implementation of evaluator to be used for evaluating queries specified in its XML Schema definition.

registerEvaluator

public void registerEvaluator(java.net.URI dialect,
                              ExpressionEvaluator evaluator)
                       throws UnknownQueryExpressionDialectException
DOCUMENT_ME

Parameters:
dialect - DOCUMENT_ME
evaluator - DOCUMENT_ME
Throws:
UnknownQueryExpressionDialectException - DOCUMENT_ME

executeQuery

public java.lang.Object executeQuery(QueryExpression queryExpr,
                                     ResourcePropertySet resourcePropSet,
                                     org.w3c.dom.Element nsContext)
                              throws UnknownQueryExpressionDialectException,
                                     QueryEvaluationErrorException,
                                     InvalidQueryExpressionException
Executes a query against a resource property set. The appropraite ExpressionEvaluator is used for the query based on the dialect attribute.

Parameters:
queryExpr - query expression
resourcePropSet - resource properties set to execute the query against
nsContext - a DOM element to use as the context for resolving namespace prefixes
Returns:
the result of the evaluation which depends on the expression. The results must be an xml serializable object in order to be passed back correctly to a remote client. The easiest way of achieving this is to model it as a Bean, or simply return a SOAPElment or DOM Element. If the result object returned is null an empty query result is returned.
Throws:
UnknownQueryExpressionDialectException - if query dialect is unsupported
QueryEvaluationErrorException - if query evaluation fails
InvalidQueryExpressionException - if query expression is invalid


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.