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 void
close()
Stops working of Celesta.static Celesta
createInstance()
Creates Celesta instance with properties specified in celesta.properties file.static Celesta
createInstance(Properties properties)
Creates Celesta instance with the specified properties and internal connection pool.static Celesta
createInstance(Properties properties, DataSource dataSource)
Creates Celesta instance with specified properties andDataSource
.static Celesta
createInstance(Properties properties, ConnectionPool connectionPool)
Creates Celesta instance with specified properties and ConnectionPool.ConnectionPool
getConnectionPool()
Returns aConnectionPool
of this celesta instance.DBAdaptor
getDBAdaptor()
Returns aDBAdaptor
of this celesta instance.ILoggingManager
getLoggingManager()
Returns aILoggingManager
of this celesta instance.IPermissionManager
getPermissionManager()
Returns aIPermissionManager
of this celesta instance.IProfiler
getProfiler()
Returns aIProfiler
of this celesta instance.Score
getScore()
Returns Celesta metadata (tables description).Properties
getSetupProperties()
Returns properties that were used to initialize Celesta.TriggerDispatcher
getTriggerDispatcher()
Returns aTriggerDispatcher
of this celesta instance.boolean
isProfilemode()
Returns if profiling mode is set (whether the time of method calls is written to 'calllog' table).static Properties
loadPropertiesDynamically()
Reads and returns properties from celesta.properties file.boolean
nullsFirst()
Returns the behaviorNULLS FIRST
of current database.void
setProfilemode(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:ICelesta
Returns 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:
getSetupProperties
in interfaceICelesta
-
getPermissionManager
public IPermissionManager getPermissionManager()
Description copied from interface:ICelesta
Returns aIPermissionManager
of this celesta instance.- Specified by:
getPermissionManager
in interfaceICelesta
- Returns:
- a permission manager of this celesta instance.
-
getLoggingManager
public ILoggingManager getLoggingManager()
Description copied from interface:ICelesta
Returns aILoggingManager
of this celesta instance.- Specified by:
getLoggingManager
in interfaceICelesta
- Returns:
- a logging manager of this celesta instance.
-
getConnectionPool
public ConnectionPool getConnectionPool()
Description copied from interface:ICelesta
Returns aConnectionPool
of this celesta instance.- Specified by:
getConnectionPool
in interfaceICelesta
- Returns:
- a connection poll of this celesta instance.
-
getProfiler
public IProfiler getProfiler()
Description copied from interface:ICelesta
Returns aIProfiler
of this celesta instance.- Specified by:
getProfiler
in interfaceICelesta
- Returns:
- a profiler of this celesta instance.
-
getDBAdaptor
public DBAdaptor getDBAdaptor()
Description copied from interface:ICelesta
Returns aDBAdaptor
of this celesta instance.- Specified by:
getDBAdaptor
in interfaceICelesta
- Returns:
- a db adaptor of this celesta instance.
-
getTriggerDispatcher
public TriggerDispatcher getTriggerDispatcher()
Description copied from interface:ICelesta
Returns aTriggerDispatcher
of this celesta instance.- Specified by:
getTriggerDispatcher
in interfaceICelesta
- Returns:
- a trigger dispatcher of this celesta instance.
-
getScore
public Score getScore()
Description copied from interface:ICelesta
Returns Celesta metadata (tables description).
-
close
public void close()
Stops working of Celesta. After the call the instance of Celesta becomes unusable.- Specified by:
close
in 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.url
is 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.url
is 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 (eitherDatasourceConnectionPool
orInternalConnectionPool
).- 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 FIRST
of current database.- Returns:
-
setProfilemode
public void setProfilemode(boolean profilemode)
Sets profiling mode.- Parameters:
profilemode
- profiling mode
-
-