org.globus.wsrf.query
Interface ExpressionEvaluator

All Known Implementing Classes:
XPathExpressionEvaluator

public interface ExpressionEvaluator

An ExpressionEvaluator is used to implement a query expression evaluation of a ResourcePropertySet. An evaluator can be registered with a QueryEngine, which in turn calls the evaluator when a matching expression is found.

See Also:
ResourcePropertySet, QueryEngine

Method Summary
 java.lang.Object evaluate(QueryExpressionType expression, ResourcePropertySet resourcePropertySet)
          Evaluates the expression over a ResourcePropertySet and returns the result.
 java.lang.String[] getDialects()
          Gets the list of dialects that this evaluator can handle.
 

Method Detail

evaluate

public java.lang.Object evaluate(QueryExpressionType expression,
                                 ResourcePropertySet resourcePropertySet)
                          throws UnsupportedQueryDialectException,
                                 QueryEvaluationException,
                                 InvalidQueryExpressionException,
                                 QueryException
Evaluates the expression over a ResourcePropertySet and returns the result.

Parameters:
expression - object passed by client representing query expression.
resourcePropertySet - ResourcePropertySet associated with resource. The expression is evaluated against this set.
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:
UnsupportedQueryDialectException - if query dialect is unsupported.
QueryEvaluationException - if query evaluation fails.
InvalidQueryExpressionException - if query expression is invalid.
QueryException - if any other error

getDialects

public java.lang.String[] getDialects()
Gets the list of dialects that this evaluator can handle.

Returns:
list of dialects supported by this evaluator.