com.espertech.esper.core.service
Class EPAdministratorImpl

java.lang.Object
  extended by com.espertech.esper.core.service.EPAdministratorImpl
All Implemented Interfaces:
EPAdministrator, EPAdministratorSPI

public class EPAdministratorImpl
extends java.lang.Object
implements EPAdministratorSPI

Implementation for the admin interface.


Constructor Summary
EPAdministratorImpl(EPAdministratorContext adminContext)
          Constructor - takes the services context as argument.
 
Method Summary
 AnnotationPart compileAnnotationToSODA(java.lang.String annotationExpression)
          Compile annotation expressions.
 EPStatementObjectModel compileEPL(java.lang.String eplStatement)
          Compiles a given EPL into an object model representation of the query.
 StatementSpecRaw compileEPLToRaw(java.lang.String epl)
           
 ExprNode compileExpression(java.lang.String expression)
          Compile expression.
 Expression compileExpressionToSODA(java.lang.String expression)
          Compile expression.
 MatchRecognizeRegEx compileMatchRecognizePatternToSODA(java.lang.String matchRecogPatternExpression)
          Compile match recognize pattern expression.
 EvalFactoryNode compilePatternToNode(java.lang.String pattern)
          Compile pattern.
 PatternExpr compilePatternToSODA(java.lang.String expression)
          Compile pattern.
 EPStatementObjectModel compilePatternToSODAModel(java.lang.String expression)
          Compile pattern.
 EPStatement create(EPPreparedStatement prepared)
          Creates and starts a prepared statement.
 EPStatement create(EPPreparedStatement prepared, java.lang.String statementName)
          Creates and starts a prepared statement.
 EPStatement create(EPPreparedStatement prepared, java.lang.String statementName, java.lang.Object userObject)
          Creates and starts a prepared statement.
 EPStatement create(EPPreparedStatement prepared, java.lang.String statementName, java.lang.Object userObject, java.lang.String statementId)
           
 EPStatement create(EPStatementObjectModel sodaStatement)
          Creates and starts an EPL statement.
 EPStatement create(EPStatementObjectModel sodaStatement, java.lang.String statementName)
          Creates and starts an EPL statement.
 EPStatement create(EPStatementObjectModel sodaStatement, java.lang.String statementName, java.lang.Object userObject)
          Creates and starts an EPL statement.
 EPStatement create(EPStatementObjectModel sodaStatement, java.lang.String statementName, java.lang.Object userObject, java.lang.String statementId)
           
 EPStatement createEPL(java.lang.String eplStatement)
          Creates and starts an EPL statement.
 EPStatement createEPL(java.lang.String eplStatement, java.lang.Object userObject)
          Create and starts an EPL statement.
 EPStatement createEPL(java.lang.String eplStatement, java.lang.String statementName)
          Create and starts an EPL statement.
 EPStatement createEPL(java.lang.String eplStatement, java.lang.String statementName, java.lang.Object userObject)
          Create and starts an EPL statement.
 EPStatement createEPLStatementId(java.lang.String eplStatement, java.lang.String statementName, java.lang.Object userObject, java.lang.String statementId)
           
 EPStatement createModelStatementId(EPStatementObjectModel sodaStatement, java.lang.String statementName, java.lang.Object userObject, java.lang.String statementId)
           
 EPStatement createPattern(java.lang.String onExpression)
          Create and starts an event pattern statement for the expressing string passed.
 EPStatement createPattern(java.lang.String expression, java.lang.Object userObject)
          Create and starts an event pattern statement for the expressing string passed and assign the name passed.
 EPStatement createPattern(java.lang.String expression, java.lang.String statementName)
          Create and starts an event pattern statement for the expressing string passed and assign the name passed.
 EPStatement createPattern(java.lang.String expression, java.lang.String statementName, java.lang.Object userObject)
          Create and starts an event pattern statement for the expressing string passed and assign the name passed.
 EPStatement createPatternStatementId(java.lang.String pattern, java.lang.String statementName, java.lang.Object userObject, java.lang.String statementId)
           
 EPStatement createPreparedEPLStatementId(EPPreparedStatementImpl prepared, java.lang.String statementName, java.lang.Object userObject, java.lang.String statementId)
           
 void destroy()
          Destroys an engine instance.
 void destroyAllStatements()
          Stops and destroys all statements.
 ConfigurationOperations getConfiguration()
          Returns configuration operations for runtime engine configuration.
 EPContextPartitionAdmin getContextPartitionAdmin()
          Returns the administrative interface for context partitions.
 EPDeploymentAdmin getDeploymentAdmin()
          Returns deployment administrative services.
 EPStatement getStatement(java.lang.String name)
          Returns the statement by the given statement name.
 java.lang.String getStatementNameForId(java.lang.String statementId)
           
 java.lang.String[] getStatementNames()
          Returns the statement names of all started and stopped statements.
 EPStatementObjectModel mapRawToSODA(StatementSpecRaw raw)
           
 StatementSpecRaw mapSODAToRaw(EPStatementObjectModel model)
           
 EPPreparedStatement prepareEPL(java.lang.String eplExpression)
          Prepares a statement for the given EPL, which can include substitution parameters marked via question mark '?'.
 EPPreparedStatement preparePattern(java.lang.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(EPAdministratorContext adminContext)
Constructor - takes the services context as argument.

Parameters:
adminContext - - administrative context
Method Detail

getDeploymentAdmin

public EPDeploymentAdmin getDeploymentAdmin()
Description copied from interface: EPAdministrator
Returns deployment administrative services.

Specified by:
getDeploymentAdmin in interface EPAdministrator
Returns:
deployment administration

createPattern

public EPStatement createPattern(java.lang.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

createEPL

public EPStatement createEPL(java.lang.String eplStatement)
                      throws EPException
Description copied from interface: EPAdministrator
Creates and starts an EPL statement.

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

Specified by:
createEPL in interface EPAdministrator
Parameters:
eplStatement - 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(java.lang.String expression,
                                 java.lang.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 managing the statement
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

createPattern

public EPStatement createPattern(java.lang.String expression,
                                 java.lang.String statementName,
                                 java.lang.Object userObject)
                          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.

Accepts an application defined user data object associated with the statement. The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

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 managing the statement
userObject - is the application-defined user object
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

createEPL

public EPStatement createEPL(java.lang.String eplStatement,
                             java.lang.String statementName)
                      throws EPException
Description copied from interface: EPAdministrator
Create and starts an EPL 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:
createEPL in interface EPAdministrator
Parameters:
eplStatement - is the query language statement
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

createEPLStatementId

public EPStatement createEPLStatementId(java.lang.String eplStatement,
                                        java.lang.String statementName,
                                        java.lang.Object userObject,
                                        java.lang.String statementId)
                                 throws EPException
Specified by:
createEPLStatementId in interface EPAdministratorSPI
Throws:
EPException

createEPL

public EPStatement createEPL(java.lang.String eplStatement,
                             java.lang.String statementName,
                             java.lang.Object userObject)
                      throws EPException
Description copied from interface: EPAdministrator
Create and starts an EPL 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.

Accepts an application defined user data object associated with the statement. The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

Specified by:
createEPL in interface EPAdministrator
Parameters:
eplStatement - is the query language statement
statementName - is the name to assign to the statement for use in managing the statement
userObject - is the application-defined user object
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the expression was not valid

createPattern

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

Accepts an application defined user data object associated with the statement. The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

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

createPatternStatementId

public EPStatement createPatternStatementId(java.lang.String pattern,
                                            java.lang.String statementName,
                                            java.lang.Object userObject,
                                            java.lang.String statementId)
                                     throws EPException
Specified by:
createPatternStatementId in interface EPAdministratorSPI
Throws:
EPException

createEPL

public EPStatement createEPL(java.lang.String eplStatement,
                             java.lang.Object userObject)
                      throws EPException
Description copied from interface: EPAdministrator
Create and starts an EPL statement.

Accepts an application defined user data object associated with the statement. The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

Specified by:
createEPL in interface EPAdministrator
Parameters:
eplStatement - is the query language statement
userObject - is the application-defined user object
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 EPL 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

createModelStatementId

public EPStatement createModelStatementId(EPStatementObjectModel sodaStatement,
                                          java.lang.String statementName,
                                          java.lang.Object userObject,
                                          java.lang.String statementId)
                                   throws EPException
Specified by:
createModelStatementId in interface EPAdministratorSPI
Throws:
EPException

create

public EPStatement create(EPStatementObjectModel sodaStatement,
                          java.lang.String statementName,
                          java.lang.Object userObject)
                   throws EPException
Description copied from interface: EPAdministrator
Creates and starts an EPL 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.

Accepts an application defined user data object associated with the statement. The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

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
userObject - is the application-defined user object
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,
                          java.lang.String statementName,
                          java.lang.Object userObject,
                          java.lang.String statementId)
                   throws EPException
Throws:
EPException

create

public EPStatement create(EPStatementObjectModel sodaStatement,
                          java.lang.String statementName)
                   throws EPException
Description copied from interface: EPAdministrator
Creates and starts an EPL 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

prepareEPL

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

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

preparePattern

public EPPreparedStatement preparePattern(java.lang.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,
                          java.lang.String statementName,
                          java.lang.Object userObject,
                          java.lang.String statementId)
                   throws EPException
Throws:
EPException

create

public EPStatement create(EPPreparedStatement prepared,
                          java.lang.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 managing 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,
                          java.lang.String statementName,
                          java.lang.Object userObject)
                   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.

Accepts an application defined user data object associated with the statement. The user object is a single, unnamed field that is stored with every statement. Applications may put arbitrary objects in this field or a null value.

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 managing the statement
userObject - is the application-defined user object
Returns:
EPStatement to poll data from or to add listeners to
Throws:
EPException - when the prepared statement was not valid

createPreparedEPLStatementId

public EPStatement createPreparedEPLStatementId(EPPreparedStatementImpl prepared,
                                                java.lang.String statementName,
                                                java.lang.Object userObject,
                                                java.lang.String statementId)
                                         throws EPException
Specified by:
createPreparedEPLStatementId in interface EPAdministratorSPI
Throws:
EPException

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

compileEPL

public EPStatementObjectModel compileEPL(java.lang.String eplStatement)
                                  throws EPException
Description copied from interface: EPAdministrator
Compiles a given EPL into an object model representation of the query.

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

getStatement

public EPStatement getStatement(java.lang.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

getStatementNameForId

public java.lang.String getStatementNameForId(java.lang.String statementId)
Specified by:
getStatementNameForId in interface EPAdministratorSPI

getStatementNames

public java.lang.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.

Specified by:
destroy in interface EPAdministratorSPI

compileEPLToRaw

public StatementSpecRaw compileEPLToRaw(java.lang.String epl)
Specified by:
compileEPLToRaw in interface EPAdministratorSPI

mapRawToSODA

public EPStatementObjectModel mapRawToSODA(StatementSpecRaw raw)
Specified by:
mapRawToSODA in interface EPAdministratorSPI

mapSODAToRaw

public StatementSpecRaw mapSODAToRaw(EPStatementObjectModel model)
Specified by:
mapSODAToRaw in interface EPAdministratorSPI

compilePatternToNode

public EvalFactoryNode compilePatternToNode(java.lang.String pattern)
                                     throws EPException
Description copied from interface: EPAdministratorSPI
Compile pattern.

Specified by:
compilePatternToNode in interface EPAdministratorSPI
Parameters:
pattern - to compile
Returns:
compiled expression
Throws:
EPException - if compile failed

compilePatternToSODAModel

public EPStatementObjectModel compilePatternToSODAModel(java.lang.String expression)
                                                 throws EPException
Description copied from interface: EPAdministratorSPI
Compile pattern.

Specified by:
compilePatternToSODAModel in interface EPAdministratorSPI
Parameters:
expression - to compile
Returns:
compiled expression
Throws:
EPException - if compile failed

compileExpression

public ExprNode compileExpression(java.lang.String expression)
                           throws EPException
Description copied from interface: EPAdministratorSPI
Compile expression.

Specified by:
compileExpression in interface EPAdministratorSPI
Parameters:
expression - to compile
Returns:
compiled expression
Throws:
EPException - if compile failed

compileExpressionToSODA

public Expression compileExpressionToSODA(java.lang.String expression)
                                   throws EPException
Description copied from interface: EPAdministratorSPI
Compile expression.

Specified by:
compileExpressionToSODA in interface EPAdministratorSPI
Parameters:
expression - to compile
Returns:
compiled expression
Throws:
EPException - if compile failed

compilePatternToSODA

public PatternExpr compilePatternToSODA(java.lang.String expression)
                                 throws EPException
Description copied from interface: EPAdministratorSPI
Compile pattern.

Specified by:
compilePatternToSODA in interface EPAdministratorSPI
Parameters:
expression - to compile
Returns:
compiled expression
Throws:
EPException - if compile failed

compileAnnotationToSODA

public AnnotationPart compileAnnotationToSODA(java.lang.String annotationExpression)
Description copied from interface: EPAdministratorSPI
Compile annotation expressions.

Specified by:
compileAnnotationToSODA in interface EPAdministratorSPI
Parameters:
annotationExpression - to compile
Returns:
model representation

compileMatchRecognizePatternToSODA

public MatchRecognizeRegEx compileMatchRecognizePatternToSODA(java.lang.String matchRecogPatternExpression)
Description copied from interface: EPAdministratorSPI
Compile match recognize pattern expression.

Specified by:
compileMatchRecognizePatternToSODA in interface EPAdministratorSPI
Parameters:
matchRecogPatternExpression - to compile
Returns:
model representation

getContextPartitionAdmin

public EPContextPartitionAdmin getContextPartitionAdmin()
Description copied from interface: EPAdministrator
Returns the administrative interface for context partitions.

Specified by:
getContextPartitionAdmin in interface EPAdministrator
Returns:
context partition administrative interface

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com