Package ru.curs.celesta
Class Celesta
- java.lang.Object
-
- ru.curs.celesta.Celesta
-
- All Implemented Interfaces:
AutoCloseable,ICelesta
public final class Celesta extends Object implements ICelesta
Celesta instance.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Stops working of Celesta.static CelestacreateInstance()Creates Celesta instance with properties specified in celesta.properties file.static CelestacreateInstance(Properties properties)Creates Celesta instance with the specified properties and internal connection pool.static CelestacreateInstance(Properties properties, DataSource dataSource)Creates Celesta instance with specified properties andDataSource.static CelestacreateInstance(Properties properties, ConnectionPool connectionPool)Creates Celesta instance with specified properties and ConnectionPool.ConnectionPoolgetConnectionPool()Returns aConnectionPoolof this celesta instance.DBAdaptorgetDBAdaptor()Returns aDBAdaptorof this celesta instance.ILoggingManagergetLoggingManager()Returns aILoggingManagerof this celesta instance.IPermissionManagergetPermissionManager()Returns aIPermissionManagerof this celesta instance.IProfilergetProfiler()Returns aIProfilerof this celesta instance.ScoregetScore()Returns Celesta metadata (tables description).PropertiesgetSetupProperties()Returns properties that were used to initialize Celesta.TriggerDispatchergetTriggerDispatcher()Returns aTriggerDispatcherof this celesta instance.booleanisProfilemode()Returns if profiling mode is set (whether the time of method calls is written to 'calllog' table).static PropertiesloadPropertiesDynamically()Reads and returns properties from celesta.properties file.booleannullsFirst()Returns the behaviorNULLS FIRSTof current database.voidsetProfilemode(boolean profilemode)Sets profiling mode.
-
-
-
Field Detail
-
VERSION
public static final String VERSION
Celesta version.- See Also:
CelestaVersion
-
-
Method Detail
-
getSetupProperties
public Properties getSetupProperties()
Description copied from interface:ICelestaReturns properties that were used to initialize Celesta. Attention: it makes sense using this object as read only, dynamic change of these properties does lead to nothing.- Specified by:
getSetupPropertiesin interfaceICelesta
-
getPermissionManager
public IPermissionManager getPermissionManager()
Description copied from interface:ICelestaReturns aIPermissionManagerof this celesta instance.- Specified by:
getPermissionManagerin interfaceICelesta- Returns:
- a permission manager of this celesta instance.
-
getLoggingManager
public ILoggingManager getLoggingManager()
Description copied from interface:ICelestaReturns aILoggingManagerof this celesta instance.- Specified by:
getLoggingManagerin interfaceICelesta- Returns:
- a logging manager of this celesta instance.
-
getConnectionPool
public ConnectionPool getConnectionPool()
Description copied from interface:ICelestaReturns aConnectionPoolof this celesta instance.- Specified by:
getConnectionPoolin interfaceICelesta- Returns:
- a connection poll of this celesta instance.
-
getProfiler
public IProfiler getProfiler()
Description copied from interface:ICelestaReturns aIProfilerof this celesta instance.- Specified by:
getProfilerin interfaceICelesta- Returns:
- a profiler of this celesta instance.
-
getDBAdaptor
public DBAdaptor getDBAdaptor()
Description copied from interface:ICelestaReturns aDBAdaptorof this celesta instance.- Specified by:
getDBAdaptorin interfaceICelesta- Returns:
- a db adaptor of this celesta instance.
-
getTriggerDispatcher
public TriggerDispatcher getTriggerDispatcher()
Description copied from interface:ICelestaReturns aTriggerDispatcherof this celesta instance.- Specified by:
getTriggerDispatcherin interfaceICelesta- Returns:
- a trigger dispatcher of this celesta instance.
-
getScore
public Score getScore()
Description copied from interface:ICelestaReturns Celesta metadata (tables description).
-
close
public void close()
Stops working of Celesta. After the call the instance of Celesta becomes unusable.- Specified by:
closein interfaceAutoCloseable
-
createInstance
public static Celesta createInstance(Properties properties, DataSource dataSource)
Creates Celesta instance with specified properties andDataSource.- Parameters:
properties- Celesta initialization properties. All the properties regarding db connection will be ignored, butrdbms.connection.urlis still required in order for Celesta to define the database type (you may pass only the prefix, e. g.jdbc:postgresql)dataSource- Provided data source.- Returns:
-
createInstance
public static Celesta createInstance(Properties properties, ConnectionPool connectionPool)
Creates Celesta instance with specified properties and ConnectionPool.- Parameters:
properties- Celesta initialization properties. All the properties regarding db connection will be ignored, butrdbms.connection.urlis still required in order for Celesta to define the database type (you may pass only the prefix, e. g.jdbc:postgresql)connectionPool- Provided connection pool (eitherDatasourceConnectionPoolorInternalConnectionPool).- Returns:
-
createInstance
public static Celesta createInstance(Properties properties)
Creates Celesta instance with the specified properties and internal connection pool.- Parameters:
properties- Celesta initialization properties- Returns:
-
createInstance
public static Celesta createInstance()
Creates Celesta instance with properties specified in celesta.properties file.- Returns:
-
loadPropertiesDynamically
public static Properties loadPropertiesDynamically()
Reads and returns properties from celesta.properties file.- Returns:
-
isProfilemode
public boolean isProfilemode()
Returns if profiling mode is set (whether the time of method calls is written to 'calllog' table).- Returns:
-
nullsFirst
public boolean nullsFirst()
Returns the behaviorNULLS FIRSTof current database.- Returns:
-
setProfilemode
public void setProfilemode(boolean profilemode)
Sets profiling mode.- Parameters:
profilemode- profiling mode
-
-