Class DatabaseConfigServiceImpl
java.lang.Object
com.espertech.esper.common.internal.epl.historical.database.connection.DatabaseConfigServiceImpl
- All Implemented Interfaces:
DatabaseConfigService
,DatabaseConfigServiceCompileTime
,DatabaseConfigServiceRuntime
public class DatabaseConfigServiceImpl
extends Object
implements DatabaseConfigServiceCompileTime, DatabaseConfigServiceRuntime
Implementation provides database instance services such as connection factory and
connection settings.
-
Constructor Summary
ConstructorDescriptionDatabaseConfigServiceImpl
(Map<String, ConfigurationCommonDBRef> mapDatabaseRef, ClasspathImportService classpathImportService) Ctor. -
Method Summary
Modifier and TypeMethodDescriptiongetConnectionCache
(String databaseName, String preparedStatementText) getConnectionFactory
(String databaseName) Returns a connection factory for a configured database.getDataCache
(String databaseName, AgentInstanceContext agentInstanceContext, int streamNumber, int scheduleCallbackId) Returns a new cache implementation for this database.getQuerySetting
(String databaseName) Returns the column metadata settings for the database.
-
Constructor Details
-
DatabaseConfigServiceImpl
public DatabaseConfigServiceImpl(Map<String, ConfigurationCommonDBRef> mapDatabaseRef, ClasspathImportService classpathImportService) Ctor.- Parameters:
mapDatabaseRef
- is a map of database name and database configuration entriesclasspathImportService
- imports
-
-
Method Details
-
getConnectionFactory
public DatabaseConnectionFactory getConnectionFactory(String databaseName) throws DatabaseConfigException Description copied from interface:DatabaseConfigService
Returns a connection factory for a configured database.- Specified by:
getConnectionFactory
in interfaceDatabaseConfigService
- 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
-
getQuerySetting
Description copied from interface:DatabaseConfigServiceCompileTime
Returns the column metadata settings for the database.- Specified by:
getQuerySetting
in interfaceDatabaseConfigServiceCompileTime
- Parameters:
databaseName
- is the database name- Returns:
- indicators for change case, metadata retrieval strategy and others
- Throws:
DatabaseConfigException
- if the name was not configured
-
getDataCache
public HistoricalDataCache getDataCache(String databaseName, AgentInstanceContext agentInstanceContext, int streamNumber, int scheduleCallbackId) throws DatabaseConfigException Description copied from interface:DatabaseConfigServiceRuntime
Returns a new cache implementation for this database.- Specified by:
getDataCache
in interfaceDatabaseConfigServiceRuntime
- Parameters:
databaseName
- is the name of the database to return a new cache implementation for foragentInstanceContext
- agent instance contextstreamNumber
- stream numberscheduleCallbackId
- callback id- Returns:
- cache implementation
- Throws:
DatabaseConfigException
- is thrown to indicate database configuration errors
-
getConnectionCache
public ConnectionCache getConnectionCache(String databaseName, String preparedStatementText) throws DatabaseConfigException - Specified by:
getConnectionCache
in interfaceDatabaseConfigServiceRuntime
- Throws:
DatabaseConfigException
-