edu.wpi.cs.dsrg.xmldb.xat.common.operator
Interface XATProperties

All Known Subinterfaces:
Aggregate, All, CartesianProduct, Composer, Delete, Difference, Distinct, Expose, FOR, Function, GroupBy, IfExpr, Insert, Intersection, Join, LeftOuterJoin, LeftSemiJoin, Merge, NameColumn, NavCollection, Navigate, NavUnnest, Or, OrderBy, OuterUnion, Project, Rename, Replace, RightOuterJoin, RightSemiJoin, Select, Source, SpecialOperator, SQLOperator, SQLStmt, Tagger, ThetaJoin, Union, UpdateOperator, XATDataSource, XATDataValue, XATMultiSourceOperator, XATOperator, XATQueryObject, XATTable, XATTree, XATValue, XMLDifference, XMLIntersection, XMLOperator, XMLUnion, XQueryStmt
All Known Implementing Classes:
XATPropertiesImp

public interface XATProperties

This is the top level interface for statistics gathering. This interface is generalized for all statistics gathering and provides a standard means to access properties. These properties will be set by either by the query objects themselves and accessed by outside components (Cost Model, ExecutionEngine, etc) or vice versa. These properties will be used to retrieve information about a query object such as its throughput -or- it will be used by an outside component to customize how the object should run, such as how much work it should do. All property values are strings, although they can be converted into ints or doubles, depending on the property. Each implementation of this interface should provide validation of a given property in the setProperty method. Furthermore, each implementation is responsible for setting the default properties that it will support.

Since:
1.0

Method Summary
 java.util.Enumeration getProperties()
          Returns an enumeration of property names supported by this query object
 java.lang.String getProperty(java.lang.String name)
          Retrieve the value of the property with the given name.
 boolean isValidPropertyName(java.lang.String nameToCheck)
          Checks if the given property is valid for this QueryObject.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the given property to the new value.
 

Method Detail

getProperties

public java.util.Enumeration getProperties()
Returns an enumeration of property names supported by this query object
Returns:
an Enumeration
Since:
1.0

getProperty

public java.lang.String getProperty(java.lang.String name)
Retrieve the value of the property with the given name.
Parameters:
name - the name of the property to return
Returns:
String the value of the property
Throws:
java.lang.IllegalArgumentException - if the given property cannot be found
Since:
1.0

isValidPropertyName

public boolean isValidPropertyName(java.lang.String nameToCheck)
Checks if the given property is valid for this QueryObject.
Parameters:
nameToCheck - is the name to check
Returns:
boolean true if the property is supported by this object, false otherwise.
Since:
1.0

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws java.lang.Exception
Sets the given property to the new value. This method is responsible for validating the given property. An exception is thrown if the value is not correct. Validation should be done in the following manner: First the method should check if the object supports the given property by calling isValidPropertyName(String). If it is not a valid property name, then an exception should be thrown.

Once it is known that the object supports the property, the value must be validated. Each implementor of XATStatistics has a set of properties that are common to all of its types and some that are specific to types. For example, all XATOperators (which implement XATStatistics) have certain properties while an individual XATOperator has specific properties. The indivual types should only validate their own specific types. If the caller is trying to set a common type, it should be validated by the super class by calling super.setProperty(name, value). This will reduce duplicate code.

When it is determined the name / value pair is correct, the pair is updated using setNewPropertyValue()

XATStatisticsImp provides default validation by checking to see if the property's value is >=0. propertyValues that are Strings will just be set. If the property requires more strict constraints than this, it is up to the subclass that created the property to validate it (as described above).

Parameters:
name - the name of the property to set
value - the new value of the property
Throws:
java.lang.Exception - if the given property cannot be found or if the value is not valid for the given property.
Since:
1.0