net.esper.core
Class EPAdministratorImpl

java.lang.Object
  extended by net.esper.core.EPAdministratorImpl
All Implemented Interfaces:
EPAdministrator

public class EPAdministratorImpl
extends Object
implements EPAdministrator

Implementation for the admin interface.


Constructor Summary
EPAdministratorImpl(EPServicesContext services, ConfigurationOperations configurationOperations)
          Constructor - takes the services context as argument.
 
Method Summary
 EPStatementObjectModel compileEQL(String eqlStatement)
          Compiles a given EQL into an object model representation of the query.
 EPStatement create(EPPreparedStatement prepared)
          Creates and starts a prepared statement.
 EPStatement create(EPPreparedStatement prepared, String statementName)
          Creates and starts a prepared statement.
 EPStatement create(EPStatementObjectModel sodaStatement)
          Creates and starts an EQL statement.
 EPStatement create(EPStatementObjectModel sodaStatement, String statementName)
          Creates and starts an EQL statement.
 EPStatement createEQL(String eqlStatement)
          Creates and starts an EQL statement.
 EPStatement createEQL(String eqlStatement, String statementName)
          Create and starts an EQL statement.
 EPStatement createPattern(String onExpression)
          Create and starts an event pattern statement for the expressing string passed.
 EPStatement createPattern(String expression, String statementName)
          Create and starts an event pattern statement for the expressing string passed and assign the name passed.
 void destroy()
          Destroys an engine instance.
 void destroyAllStatements()
          Stops and destroys all statements.
 ConfigurationOperations getConfiguration()
          Returns configuration operations for runtime engine configuration.
 EPStatement getStatement(String name)
          Returns the statement by the given statement name.
 String[] getStatementNames()
          Returns the statement names of all started and stopped statements.
 EPPreparedStatement prepareEQL(String eqlExpression)
          Prepares a statement for the given EQL, which can include substitution parameters marked via question mark '?'.
 EPPreparedStatement preparePattern(String patternExpression)
          Prepares a statement for the given pattern, which can include substitution parameters marked via question mark '?'.
 void startAllStatements()
          Starts all statements that are in stopped state.
 void stopAllStatements()
          Stops all statements that are in started state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPAdministratorImpl

public EPAdministratorImpl(EPServicesContext services,
                           ConfigurationOperations configurationOperations)
Constructor - takes the services context as argument.

Parameters:
services - - references to services
configurationOperations - - runtime configuration operations
Method Detail

createPattern

public EPStatement createPattern(String onExpression)
                          throws EPException
Description copied from interface: EPAdministrator
Create and starts an event pattern statement for the expressing string passed.

The engine assigns a unique name to the statement.

Specified by:
createPattern in interface EPAdministrator
Parameters:
onExpression - must follow the documented syntax for pattern statements
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

createEQL

public EPStatement createEQL(String eqlStatement)
                      throws EPException
Description copied from interface: EPAdministrator
Creates and starts an EQL statement.

The engine assigns a unique name to the statement. The returned statement is in started state.

Specified by:
createEQL in interface EPAdministrator
Parameters:
eqlStatement - is the query language statement
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

createPattern

public EPStatement createPattern(String expression,
                                 String statementName)
                          throws EPException
Description copied from interface: EPAdministrator
Create and starts an event pattern statement for the expressing string passed and assign the name passed.

The statement name is optimally a unique name. If a statement of the same name has already been created, the engine assigns a postfix to create a unique statement name.

Specified by:
createPattern in interface EPAdministrator
Parameters:
expression - must follow the documented syntax for pattern statements
statementName - is the name to assign to the statement for use in manageing the statement
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

createEQL

public EPStatement createEQL(String eqlStatement,
                             String statementName)
                      throws EPException
Description copied from interface: EPAdministrator
Create and starts an EQL statement.

The statement name is optimally a unique name. If a statement of the same name has already been created, the engine assigns a postfix to create a unique statement name.

Specified by:
createEQL in interface EPAdministrator
Parameters:
eqlStatement - is the query language statement
statementName - is the name to assign to the statement for use in manageing the statement
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

create

public EPStatement create(EPStatementObjectModel sodaStatement)
                   throws EPException
Description copied from interface: EPAdministrator
Creates and starts an EQL statement.

Specified by:
create in interface EPAdministrator
Parameters:
sodaStatement - is the statement object model
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

create

public EPStatement create(EPStatementObjectModel sodaStatement,
                          String statementName)
                   throws EPException
Description copied from interface: EPAdministrator
Creates and starts an EQL statement.

The statement name is optimally a unique name. If a statement of the same name has already been created, the engine assigns a postfix to create a unique statement name.

Specified by:
create in interface EPAdministrator
Parameters:
sodaStatement - is the statement object model
statementName - is the name to assign to the statement for use in managing the statement
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

prepareEQL

public EPPreparedStatement prepareEQL(String eqlExpression)
                               throws EPException
Description copied from interface: EPAdministrator
Prepares a statement for the given EQL, which can include substitution parameters marked via question mark '?'.

Specified by:
prepareEQL in interface EPAdministrator
Parameters:
eqlExpression - is the statement text to prepare
Returns:
prepared statement
Throws:
EPException - indicates compilation errors.

preparePattern

public EPPreparedStatement preparePattern(String patternExpression)
                                   throws EPException
Description copied from interface: EPAdministrator
Prepares a statement for the given pattern, which can include substitution parameters marked via question mark '?'.

Specified by:
preparePattern in interface EPAdministrator
Parameters:
patternExpression - is the statement text to prepare
Returns:
prepared statement
Throws:
EPException - indicates compilation errors.

create

public EPStatement create(EPPreparedStatement prepared,
                          String statementName)
                   throws EPException
Description copied from interface: EPAdministrator
Creates and starts a prepared statement.

The statement name is optimally a unique name. If a statement of the same name has already been created, the engine assigns a postfix to create a unique statement name.

Specified by:
create in interface EPAdministrator
Parameters:
prepared - is the prepared statement for which all substitution values have been provided
statementName - is the name to assign to the statement for use in manageing the statement
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the prepared statement was not valid

create

public EPStatement create(EPPreparedStatement prepared)
                   throws EPException
Description copied from interface: EPAdministrator
Creates and starts a prepared statement.

Specified by:
create in interface EPAdministrator
Parameters:
prepared - is the prepared statement for which all substitution values have been provided
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

compileEQL

public EPStatementObjectModel compileEQL(String eqlStatement)
                                  throws EPException
Description copied from interface: EPAdministrator
Compiles a given EQL into an object model representation of the query.

Specified by:
compileEQL in interface EPAdministrator
Parameters:
eqlStatement - is the statement text to compile
Returns:
object model of statement
Throws:
EPException - indicates compilation errors.

getStatement

public EPStatement getStatement(String name)
Description copied from interface: EPAdministrator
Returns the statement by the given statement name. Returns null if a statement of that name has not been created, or if the statement by that name has been destroyed.

Specified by:
getStatement in interface EPAdministrator
Parameters:
name - is the statement name to return the statement for
Returns:
statement for the given name, or null if no such started or stopped statement exists

getStatementNames

public String[] getStatementNames()
Description copied from interface: EPAdministrator
Returns the statement names of all started and stopped statements.

This excludes the name of destroyed statements.

Specified by:
getStatementNames in interface EPAdministrator
Returns:
statement names

startAllStatements

public void startAllStatements()
                        throws EPException
Description copied from interface: EPAdministrator
Starts all statements that are in stopped state. Statements in started state are not affected by this method.

Specified by:
startAllStatements in interface EPAdministrator
Throws:
EPException - when an error occured starting statements.

stopAllStatements

public void stopAllStatements()
                       throws EPException
Description copied from interface: EPAdministrator
Stops all statements that are in started state. Statements in stopped state are not affected by this method.

Specified by:
stopAllStatements in interface EPAdministrator
Throws:
EPException - when an error occured stopping statements

destroyAllStatements

public void destroyAllStatements()
                          throws EPException
Description copied from interface: EPAdministrator
Stops and destroys all statements.

Specified by:
destroyAllStatements in interface EPAdministrator
Throws:
EPException - when an error occured stopping or destroying statements

getConfiguration

public ConfigurationOperations getConfiguration()
Description copied from interface: EPAdministrator
Returns configuration operations for runtime engine configuration.

Specified by:
getConfiguration in interface EPAdministrator
Returns:
runtime engine configuration operations

destroy

public void destroy()
Destroys an engine instance.