edu.cmu.aura.service.query
Class Query

java.lang.Object
  |
  +--edu.cmu.aura.service.query.Query
Direct Known Subclasses:
PostedQuery

public class Query
extends java.lang.Object

Represents a service query. A query selects a given set of attributes from a service (or services). A "select" expression specifies for which cases attributes are to be returned for. Attribute requirements, such as over what time interval a value is to be sampled, may be specified. A time limit on the query processing informs the service how much query processing time the client can tolerate. This is usually not set.

See Also:
AttribReq, ExpressionNode

Constructor Summary
Query(java.util.ArrayList sAttribs, java.util.ArrayList serviceNames, ExpressionNode expression, java.util.ArrayList attribReqs, long timeLimit)
          Construct a Query.
Query(java.util.ArrayList sAttribs, java.util.ArrayList serviceNames, ExpressionNode expression, long timeLimit)
          Construct a Query that has no attribute requirements.
 
Method Summary
 java.util.ArrayList getAttribReqs()
          Returns the attribute requirements for this query.
 ExpressionNode getExpression()
          Returns this query's "select" expression.
 java.util.ArrayList getSAttribs()
          Returns the selected attributes of this query.
 java.util.ArrayList getServiceNames()
          Returns the target service names of this query.
 long getTimeLimit()
          Returns the time limit of the query.
 java.lang.String toSQLForm()
          Returns an SQL like representation of this query.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query(java.util.ArrayList sAttribs,
             java.util.ArrayList serviceNames,
             ExpressionNode expression,
             java.util.ArrayList attribReqs,
             long timeLimit)
Construct a Query.

Parameters:
sAttribs - the attributes to select
serviceNames - the services that are to be queried
expression - the "select" expression of this query
attribReqs - the requirements of attributes
timeLimit - the query processing time limit

Query

public Query(java.util.ArrayList sAttribs,
             java.util.ArrayList serviceNames,
             ExpressionNode expression,
             long timeLimit)
Construct a Query that has no attribute requirements.

Parameters:
sAttribs - the attributes to select
serviceNames - the services that are to be queried
expression - the "select" expression of this query
timeLimit - the query processing time limit
Method Detail

getSAttribs

public java.util.ArrayList getSAttribs()
Returns the selected attributes of this query.

Returns:
the selected attributes of this query

getServiceNames

public java.util.ArrayList getServiceNames()
Returns the target service names of this query.

Returns:
the target services names of this query

getExpression

public ExpressionNode getExpression()
Returns this query's "select" expression.

Returns:
this query's expression

getAttribReqs

public java.util.ArrayList getAttribReqs()
Returns the attribute requirements for this query.

Returns:
the attribute requirements for this query

getTimeLimit

public long getTimeLimit()
Returns the time limit of the query.

Returns:
the time limit of the query

toSQLForm

public java.lang.String toSQLForm()
Returns an SQL like representation of this query. All numeric literals will not be quoted (Double, Float, Long, Integer, Short, Byte); all other literals will be.

Returns:
an SQL like representation of this query

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object