com.espertech.esper.epl.db
Class DatabasePollingViewableFactory

java.lang.Object
  extended by com.espertech.esper.epl.db.DatabasePollingViewableFactory

public class DatabasePollingViewableFactory
extends Object

Factory for a view onto historical data via SQL statement.


Constructor Summary
DatabasePollingViewableFactory()
           
 
Method Summary
static HistoricalEventViewable createDBStatementView(int streamNumber, DBStatementStreamSpec databaseStreamSpec, DatabaseConfigService databaseConfigService, EventAdapterService eventAdapterService, EPStatementHandle epStatementHandle)
          Creates the viewable for polling via database SQL query.
protected static String lexSampleSQL(String querySQL)
          Lexes the sample SQL and inserts a "where 1=0" where-clause.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabasePollingViewableFactory

public DatabasePollingViewableFactory()
Method Detail

createDBStatementView

public static HistoricalEventViewable createDBStatementView(int streamNumber,
                                                            DBStatementStreamSpec databaseStreamSpec,
                                                            DatabaseConfigService databaseConfigService,
                                                            EventAdapterService eventAdapterService,
                                                            EPStatementHandle epStatementHandle)
                                                     throws ExprValidationException
Creates the viewable for polling via database SQL query.

Parameters:
streamNumber - is the stream number of the view
databaseStreamSpec - provides the SQL statement, database name and additional info
databaseConfigService - for getting database connection and settings
eventAdapterService - for generating event beans from database information
epStatementHandle - is the statements-own handle for use in registering callbacks with services
Returns:
viewable providing poll functionality
Throws:
ExprValidationException - if the validation failed

lexSampleSQL

protected static String lexSampleSQL(String querySQL)
                              throws ExprValidationException
Lexes the sample SQL and inserts a "where 1=0" where-clause.

Parameters:
querySQL - to inspect using lexer
Returns:
sample SQL with where-clause inserted
Throws:
ExprValidationException - to indicate a lexer problem

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com