net.esper.client.soda
Class EPStatementObjectModel

java.lang.Object
  extended by net.esper.client.soda.EPStatementObjectModel
All Implemented Interfaces:
Serializable

public class EPStatementObjectModel
extends Object
implements Serializable

Object model of an EQL statement.

Applications can create an object model by instantiating this class and then setting the various clauses. When done, use EPAdministrator to create a statement from the model.

Alternativly, a given textual EQL can be compiled into an object model representation via the compile method on EPAdministrator.

Use the toEQL method to generate a textual EQL from an object model.

Minimally, and EQL statement consists of the select-clause and the where-clause. These are represented by SelectClause and FromClause respectively.

Here is a short example that create a simple EQL statement such as "select page, responseTime from PageLoad" :

 EPStatementObjectModel model = new EPStatementObjectModel();
 model.setSelectClause(SelectClause.create("page", "responseTime"));
 model.setFromClause(FromClause.create(FilterStream.create("PageLoad")));
 

The select-clause and from-clause must be set for the statement object model to be useable by the administrative API. All other clauses a optional.

Please see the documentation set for further examples.

See Also:
Serialized Form

Constructor Summary
EPStatementObjectModel()
          Ctor.
 
Method Summary
 FromClause getFromClause()
          Return the from-clause.
 GroupByClause getGroupByClause()
          Return the group-by-clause, or null to indicate that the clause is absent.
 Expression getHavingClause()
          Return the having-clause, or null to indicate that the clause is absent.
 InsertIntoClause getInsertInto()
          Return the insert-into-clause, or null to indicate that the clause is absent.
 OrderByClause getOrderByClause()
          Return the order-by-clause, or null to indicate that the clause is absent.
 OutputLimitClause getOutputLimitClause()
          Return the output-rate-limiting-clause, or null to indicate that the clause is absent.
 SelectClause getSelectClause()
          Return the select-clause.
 Expression getWhereClause()
          Return the where-clause, or null to indicate that the clause is absent.
 EPStatementObjectModel setFromClause(FromClause fromClause)
          Specify a from-clause.
 EPStatementObjectModel setGroupByClause(GroupByClause groupByClause)
          Specify a group-by-clause.
 EPStatementObjectModel setHavingClause(Expression havingClause)
          Specify a having-clause.
 EPStatementObjectModel setInsertInto(InsertIntoClause insertInto)
          Specify an insert-into-clause.
 EPStatementObjectModel setOrderByClause(OrderByClause orderByClause)
          Specify an order-by-clause.
 EPStatementObjectModel setOutputLimitClause(OutputLimitClause outputLimitClause)
          Specify an output-rate-limiting-clause.
 EPStatementObjectModel setSelectClause(SelectClause selectClause)
          Specify a select-clause.
 EPStatementObjectModel setWhereClause(Expression whereClause)
          Specify a where-clause.
 String toEQL()
          Renders the object model in it's EQL syntax textual representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPStatementObjectModel

public EPStatementObjectModel()
Ctor.

Method Detail

setInsertInto

public EPStatementObjectModel setInsertInto(InsertIntoClause insertInto)
Specify an insert-into-clause.

Parameters:
insertInto - specifies the insert-into-clause, or null to indicate that the clause is absent
Returns:
model

getInsertInto

public InsertIntoClause getInsertInto()
Return the insert-into-clause, or null to indicate that the clause is absent.

Returns:
specification of the insert-into-clause, or null if none present

setSelectClause

public EPStatementObjectModel setSelectClause(SelectClause selectClause)
Specify a select-clause.

Parameters:
selectClause - specifies the select-clause, the select-clause cannot be null and must be set
Returns:
model

getSelectClause

public SelectClause getSelectClause()
Return the select-clause.

Returns:
specification of the select-clause

setFromClause

public EPStatementObjectModel setFromClause(FromClause fromClause)
Specify a from-clause.

Parameters:
fromClause - specifies the from-clause, the from-clause cannot be null and must be set
Returns:
model

getWhereClause

public Expression getWhereClause()
Return the where-clause, or null to indicate that the clause is absent.

Returns:
specification of the where-clause, or null if none present

setWhereClause

public EPStatementObjectModel setWhereClause(Expression whereClause)
Specify a where-clause.

Parameters:
whereClause - specifies the where-clause, which is optional and can be null
Returns:
model

getFromClause

public FromClause getFromClause()
Return the from-clause.

Returns:
specification of the from-clause

getGroupByClause

public GroupByClause getGroupByClause()
Return the group-by-clause, or null to indicate that the clause is absent.

Returns:
specification of the group-by-clause, or null if none present

setGroupByClause

public EPStatementObjectModel setGroupByClause(GroupByClause groupByClause)
Specify a group-by-clause.

Parameters:
groupByClause - specifies the group-by-clause, which is optional and can be null
Returns:
model

getHavingClause

public Expression getHavingClause()
Return the having-clause, or null to indicate that the clause is absent.

Returns:
specification of the having-clause, or null if none present

setHavingClause

public EPStatementObjectModel setHavingClause(Expression havingClause)
Specify a having-clause.

Parameters:
havingClause - specifies the having-clause, which is optional and can be null
Returns:
model

getOrderByClause

public OrderByClause getOrderByClause()
Return the order-by-clause, or null to indicate that the clause is absent.

Returns:
specification of the order-by-clause, or null if none present

setOrderByClause

public EPStatementObjectModel setOrderByClause(OrderByClause orderByClause)
Specify an order-by-clause.

Parameters:
orderByClause - specifies the order-by-clause, which is optional and can be null
Returns:
model

getOutputLimitClause

public OutputLimitClause getOutputLimitClause()
Return the output-rate-limiting-clause, or null to indicate that the clause is absent.

Returns:
specification of the output-rate-limiting-clause, or null if none present

setOutputLimitClause

public EPStatementObjectModel setOutputLimitClause(OutputLimitClause outputLimitClause)
Specify an output-rate-limiting-clause.

Parameters:
outputLimitClause - specifies the output-rate-limiting-clause, which is optional and can be null
Returns:
model

toEQL

public String toEQL()
Renders the object model in it's EQL syntax textual representation.

Returns:
EQL representing the statement object model
Throws:
IllegalStateException - if required clauses do not exist