com.espertech.esper.epl.db
Class DatabaseConfigServiceImpl

java.lang.Object
  extended by com.espertech.esper.epl.db.DatabaseConfigServiceImpl
All Implemented Interfaces:
DatabaseConfigService

public class DatabaseConfigServiceImpl
extends java.lang.Object
implements DatabaseConfigService

Implementation provides database instance services such as connection factory and connection settings.


Constructor Summary
DatabaseConfigServiceImpl(java.util.Map<java.lang.String,ConfigurationDBRef> mapDatabaseRef, SchedulingService schedulingService, ScheduleBucket scheduleBucket)
          Ctor.
 
Method Summary
 ConnectionCache getConnectionCache(java.lang.String databaseName, java.lang.String preparedStatementText)
          Returns true to indicate a setting to retain connections between lookups.
 DatabaseConnectionFactory getConnectionFactory(java.lang.String databaseName)
          Returns a connection factory for a configured database.
 DataCache getDataCache(java.lang.String databaseName, EPStatementAgentInstanceHandle epStatementAgentInstanceHandle)
          Returns a new cache implementation for this database.
 ColumnSettings getQuerySetting(java.lang.String databaseName)
          Returns the column metadata settings for the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseConfigServiceImpl

public DatabaseConfigServiceImpl(java.util.Map<java.lang.String,ConfigurationDBRef> mapDatabaseRef,
                                 SchedulingService schedulingService,
                                 ScheduleBucket scheduleBucket)
Ctor.

Parameters:
mapDatabaseRef - is a map of database name and database configuration entries
schedulingService - is for scheduling callbacks for a cache
scheduleBucket - is a system bucket for all scheduling callbacks for caches
Method Detail

getConnectionCache

public ConnectionCache getConnectionCache(java.lang.String databaseName,
                                          java.lang.String preparedStatementText)
                                   throws DatabaseConfigException
Description copied from interface: DatabaseConfigService
Returns true to indicate a setting to retain connections between lookups.

Specified by:
getConnectionCache in interface DatabaseConfigService
Parameters:
databaseName - is the name of the database
preparedStatementText - is the sql text
Returns:
a cache implementation to cache connection and prepared statements
Throws:
DatabaseConfigException - is thrown to indicate database configuration errors

getConnectionFactory

public DatabaseConnectionFactory getConnectionFactory(java.lang.String databaseName)
                                               throws DatabaseConfigException
Description copied from interface: DatabaseConfigService
Returns a connection factory for a configured database.

Specified by:
getConnectionFactory in interface DatabaseConfigService
Parameters:
databaseName - is the name of the database
Returns:
is a connection factory to use to get connections to the database
Throws:
DatabaseConfigException - is thrown to indicate database configuration errors

getDataCache

public DataCache getDataCache(java.lang.String databaseName,
                              EPStatementAgentInstanceHandle epStatementAgentInstanceHandle)
                       throws DatabaseConfigException
Description copied from interface: DatabaseConfigService
Returns a new cache implementation for this database.

Specified by:
getDataCache in interface DatabaseConfigService
Parameters:
databaseName - is the name of the database to return a new cache implementation for for
epStatementAgentInstanceHandle - is the statements-own handle for use in registering callbacks with services
Returns:
cache implementation
Throws:
DatabaseConfigException - is thrown to indicate database configuration errors

getQuerySetting

public ColumnSettings getQuerySetting(java.lang.String databaseName)
                               throws DatabaseConfigException
Description copied from interface: DatabaseConfigService
Returns the column metadata settings for the database.

Specified by:
getQuerySetting in interface DatabaseConfigService
Parameters:
databaseName - is the database name
Returns:
indicators for change case, metadata retrieval strategy and others
Throws:
DatabaseConfigException - if the name was not configured

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