org.globus.wsrf.topicexpression
Interface TopicExpressionEvaluator

All Known Implementing Classes:
SimpleTopicExpressionEvaluator

public interface TopicExpressionEvaluator

A TopicExpressionEvaluator is used to implement a topic expression evaluation against a TopicList. An evaluator can be registered with a TopicExpressionEngine, which in turn calls the evaluator when a matching expression is found.

See Also:
TopicList, TopicExpressionEngine

Method Summary
 java.util.List getConcreteTopicPath(TopicExpressionType expression)
          Converts the expression from dialect specific form to a ordered list of QNames.
 java.lang.String[] getDialects()
          Gets the URIs for the dialects that this evaluator can handle
 java.util.Collection resolve(TopicExpressionType expression, TopicList topicList)
          Evaluates the expression over a TopicList and returns the result.
 TopicExpressionType toTopicExpression(java.util.List topicPath)
          Converts a topic path (list of QNames) to a dialect specific concrete topic expression.
 

Method Detail

resolve

public java.util.Collection resolve(TopicExpressionType expression,
                                    TopicList topicList)
                             throws UnsupportedTopicExpressionDialectException,
                                    TopicExpressionResolutionException,
                                    InvalidTopicExpressionException,
                                    TopicExpressionException
Evaluates the expression over a TopicList and returns the result.

Parameters:
expression - object passed by client representing the topic expression
topicList - topic list associated with the service/resource
Returns:
the result of the evaluation which depends on the expression.
Throws:
UnsupportedTopicExpressionDialectException - if the topic expression dialect is not supported
TopicExpressionResolutionException - if the expression could not be evaluated
InvalidTopicExpressionException - if the topic expression is invalid
TopicExpressionException - if any other error occurs

getDialects

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

Returns:
array of URIs supported by this evaluator

getConcreteTopicPath

public java.util.List getConcreteTopicPath(TopicExpressionType expression)
                                    throws UnsupportedTopicExpressionDialectException,
                                           InvalidTopicExpressionException,
                                           TopicExpressionException
Converts the expression from dialect specific form to a ordered list of QNames. This method throws an exception if the expression does not evaluate to a concrete topic path.

Parameters:
expression - object passed by client representing the topic expression
Returns:
a list of QNames describing the concrete topic path
Throws:
UnsupportedTopicExpressionDialectException - if the topic expression dialect is not supported
InvalidTopicExpressionException - if the topic expression is invalid
TopicExpressionException - if any other error occurs

toTopicExpression

public TopicExpressionType toTopicExpression(java.util.List topicPath)
                                      throws InvalidTopicExpressionException,
                                             TopicExpressionException
Converts a topic path (list of QNames) to a dialect specific concrete topic expression.

Parameters:
topicPath - containing a list of QNames describing a concrete topic path
Returns:
dialect specific version of the topic path
Throws:
InvalidTopicExpressionException - if the conrete topic path is invalid
TopicExpressionException - if any other error occurs