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
 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 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.
 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

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