org.globus.wsrf.query.targetedXPath
Class BaseTargetedXPathExpressionEvaluator

java.lang.Object
  extended by org.globus.wsrf.query.targetedXPath.BaseTargetedXPathExpressionEvaluator
All Implemented Interfaces:
ExpressionEvaluator
Direct Known Subclasses:
XalanTargetedXPathExpressionEvaluator

public abstract class BaseTargetedXPathExpressionEvaluator
extends java.lang.Object
implements ExpressionEvaluator

Abstract base class used for TargetedXPath implementations. Peforms basic argument sanity checking for derived classes.


Field Summary
private static java.lang.String[] DIALECTS
           
private  int enumDuration
           
private  int enumPersistenceSize
           
private static org.globus.util.I18n i18n
           
(package private) static org.apache.commons.logging.Log logger
           
 
Constructor Summary
BaseTargetedXPathExpressionEvaluator()
           
 
Method Summary
 java.lang.Object evaluate(QueryExpressionType expression, ResourcePropertySet resourcePropertySet)
          Evaluates the expression over a ResourcePropertySet and returns the result.
protected abstract  java.util.List evaluateQuery(QueryExpressionType expression, ResourcePropertySet resourcePropertySet)
           
protected  java.util.List getAsEnumeration(java.util.List results)
           
 java.lang.String[] getDialects()
          Gets the list of dialects that this evaluator can handle.
 int getEnumerationDuration()
           
 int getEnumerationPersistenceSize()
           
protected static org.w3c.dom.Element getNamespaceRoot(NamespaceMappingType[] mappings, org.w3c.dom.Element element)
           
 void setEnumerationDuration(int duration)
          Sets the duration of the enumeration.
 void setEnumerationPersistenceSize(int size)
          Sets the size of the query result after which the results will be persisted to a file (only when the query result is returned as an enumeration).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static org.apache.commons.logging.Log logger

i18n

private static org.globus.util.I18n i18n

DIALECTS

private static final java.lang.String[] DIALECTS

enumDuration

private int enumDuration

enumPersistenceSize

private int enumPersistenceSize
Constructor Detail

BaseTargetedXPathExpressionEvaluator

public BaseTargetedXPathExpressionEvaluator()
Method Detail

setEnumerationPersistenceSize

public void setEnumerationPersistenceSize(int size)
Sets the size of the query result after which the results will be persisted to a file (only when the query result is returned as an enumeration).

Parameters:
size - the size of the query result after which the results will be persisted to a file.

getEnumerationPersistenceSize

public int getEnumerationPersistenceSize()

setEnumerationDuration

public void setEnumerationDuration(int duration)
Sets the duration of the enumeration. The enumeration will expire after the specified time.

Parameters:
duration - the duration of the enumeration in minutes. If zero the enumeration will not expire.

getEnumerationDuration

public int getEnumerationDuration()

getDialects

public java.lang.String[] getDialects()
Description copied from interface: ExpressionEvaluator
Gets the list of dialects that this evaluator can handle.

Specified by:
getDialects in interface ExpressionEvaluator
Returns:
list of dialects supported by this evaluator.

evaluate

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

Specified by:
evaluate in interface ExpressionEvaluator
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

evaluateQuery

protected abstract java.util.List evaluateQuery(QueryExpressionType expression,
                                                ResourcePropertySet resourcePropertySet)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getNamespaceRoot

protected static org.w3c.dom.Element getNamespaceRoot(NamespaceMappingType[] mappings,
                                                      org.w3c.dom.Element element)
                                               throws javax.xml.parsers.ParserConfigurationException
Throws:
javax.xml.parsers.ParserConfigurationException

getAsEnumeration

protected java.util.List getAsEnumeration(java.util.List results)
                                   throws java.lang.Exception
Throws:
java.lang.Exception