org.globus.wsrf.topicexpression
Interface TopicExpressionEngine

All Known Implementing Classes:
TopicExpressionEngineImpl

public interface TopicExpressionEngine

The TopicExpressionEngine interface is used to map queries on a topic list to the appropriate TopicExpressionEvaluators and then return the result. TopicExpressionEvaluators can be preconfigured or dynamically added at runtime.

See Also:
TopicExpressionEvaluator

Method Summary
 java.util.List getConcretePath(TopicExpressionType topicExpression)
          Converts the expression from dialect specific form to a ordered list of QNames.
 TopicExpressionEvaluator getEvaluator(java.lang.String dialect)
          Gets the evaluator currently registered to handle a topic expression of the specified dialect.
 java.lang.String[] getSupportedDialects()
          Returns a list of URIs representing the registered topic expression dialects
 void registerEvaluator(TopicExpressionEvaluator evaluator)
          registers a new evaluator that can be used to evaluate topic expressions
 java.util.Collection resolveTopicExpression(TopicExpressionType topicExpression, TopicList topicList)
          Resolves a topic expression using the passed topic list.
 

Method Detail

registerEvaluator

public void registerEvaluator(TopicExpressionEvaluator evaluator)
registers a new evaluator that can be used to evaluate topic expressions

Parameters:
evaluator - implementation of evaluator to be used for evaluating topic expressions

resolveTopicExpression

public java.util.Collection resolveTopicExpression(TopicExpressionType topicExpression,
                                                   TopicList topicList)
                                            throws UnsupportedTopicExpressionDialectException,
                                                   TopicExpressionResolutionException,
                                                   InvalidTopicExpressionException,
                                                   TopicExpressionException
Resolves a topic expression using the passed topic list. The appropraite TopicExpressionEvaluator is used based on the dialect element.

Parameters:
topicExpression - topic expression
topicList - the topic list to apply the expression to
Returns:
the set of topics the expression evaluated to
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

getConcretePath

public java.util.List getConcretePath(TopicExpressionType topicExpression)
                               throws UnsupportedTopicExpressionDialectException,
                                      TopicExpressionResolutionException,
                                      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:
topicExpression - topic expression
Returns:
a list of QNames describing the concrete topic path
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

getEvaluator

public TopicExpressionEvaluator getEvaluator(java.lang.String dialect)
Gets the evaluator currently registered to handle a topic expression of the specified dialect.

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

getSupportedDialects

public java.lang.String[] getSupportedDialects()
Returns a list of URIs representing the registered topic expression dialects

Returns:
the list of supported dialects