|
EAF 7.4 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DatabaseManager
The database management object interface. This class implementing this interface manages the database connections for one application.
Field Summary | |
---|---|
static boolean |
debug
Flag to enable debug logging of queries and transactions. |
Method Summary | |
---|---|
DBConnection |
allocateConnection()
Allocate a connection to the default logical database. |
DBConnection |
allocateConnection(java.lang.String dbName)
Allocate a connection to the specified logic database. |
ObjectId |
allocateObjectId()
Allocate an object id from the specified logical database. |
ObjectId |
allocateObjectId(java.lang.String dbName)
Allocate an object id from the specified logical database. |
void |
checkOId(ObjectId oid)
Check does oid belong to Object id's range [minOId, currentOId] for default database |
void |
checkOId(java.lang.String dbName,
ObjectId oid)
Check does oid belong to Object id's range [minOId, currentOId] |
DBQuery |
createQuery()
Create a query object for the default logical database. |
DBQuery |
createQuery(java.lang.String dbName)
Create a query object for the specified logical database. |
DBTransaction |
createTransaction()
Create a transaction object for the default logical database. |
DBTransaction |
createTransaction(java.lang.String dbName)
Create a transaction object for the specified logical database. |
LogicalDatabase |
findLogicalDatabase(java.lang.String dbName)
|
int |
getActiveConnectionCount(java.lang.String dbName)
Returns the number of currently active connections for the supplied logical database name. |
com.lutris.util.Config |
getConfig()
Return main configuration class |
java.lang.String |
getDefaultDB()
Return default database name (given in config file) |
java.lang.String[] |
getLogicalDatabaseNames()
Returns the list of managed logical databases. |
int |
getMaxConnectionCount(java.lang.String dbName)
Returns the maximum number of concurent connections that existed at any time since this object was created, or resetMaxConnectionCount() was called. |
java.util.Date |
getMaxConnectionCountDate(java.lang.String dbName)
Returns the time when the maximum refered to by maxConnectionCount() occured. |
long |
getRequestCount(java.lang.String dbName)
Returns the number of requests made to the database since startup time. |
java.lang.String |
getType(java.lang.String dbName)
Returns a description of the logical database type. |
java.lang.String |
logicalDatabaseType()
Return a logical database type for the default logical database. |
java.lang.String |
logicalDatabaseType(java.lang.String dbName)
Return a logical database type for the default logical database. |
void |
registerMBeans(java.lang.String appPrefix,
com.lutris.util.Config appConfig,
java.lang.ClassLoader clsLoader)
|
void |
resetMaxConnectionCount(java.lang.String dbName)
Reset the maximum connection count. |
void |
setDefaultDatabase(java.lang.String dbName)
Set the default logical database. |
void |
shutdown()
Shutdown the database manager. |
void |
unregisterMBeans()
|
Field Detail |
---|
static final boolean debug
Method Detail |
---|
com.lutris.util.Config getConfig()
DBConnection allocateConnection(java.lang.String dbName) throws DatabaseManagerException, java.sql.SQLException
dbName
- Logical name of the database to allocate a connection to.
DatabaseManagerException
- If a nonexistent logical database name is supplied.
java.sql.SQLException
- If a SQL error occures.DBConnection allocateConnection() throws DatabaseManagerException, java.sql.SQLException
DatabaseManagerException
- If a nonexistent default logical database name is supplied.
java.sql.SQLException
- If a SQL error occures.setDefaultDatabase(java.lang.String)
ObjectId allocateObjectId(java.lang.String dbName) throws DatabaseManagerException, ObjectIdException
dbName
- Logical name of the database from which to obtain an object id.
DatabaseManagerException
- If a nonexistent logical database name is supplied.
ObjectIdException
- If a problem (e.g. SQL error) occured in obtaining the OID.ObjectId allocateObjectId() throws DatabaseManagerException, ObjectIdException
DatabaseManagerException
- If a nonexistent default logical database has been set.
ObjectIdException
- If a problem (e.g. SQL error) occured in obtaining the OID.setDefaultDatabase(java.lang.String)
void checkOId(java.lang.String dbName, ObjectId oid) throws DatabaseManagerException, ObjectIdException
dbName
- Logical name of the database from which to check an object id.oid
- oid which will be checked.
DatabaseManagerException
- If a nonexistent logical database name is supplied.
ObjectIdException
- If a oid does't belong to range.void checkOId(ObjectId oid) throws DatabaseManagerException, ObjectIdException
oid
- oid which will be checked.
DatabaseManagerException
- If a nonexistent default logical database has been set.
ObjectIdException
- If a oid does't belong to range.DBTransaction createTransaction(java.lang.String dbName) throws DatabaseManagerException, java.sql.SQLException
dbName
- Logical name of the database from which to obtain a transaction.
DatabaseManagerException
- If a nonexistent or invalid logical database name is supplied.
java.sql.SQLException
- If a problem occured creating the transaction.DBTransaction createTransaction() throws DatabaseManagerException, java.sql.SQLException
DatabaseManagerException
- If a nonexistent default logical database has been set.
java.sql.SQLException
- If a problem occured creating the transaction.setDefaultDatabase(java.lang.String)
DBQuery createQuery(java.lang.String dbName) throws DatabaseManagerException, java.sql.SQLException
dbName
- Logical name of the database from which to obtain a query.
DatabaseManagerException
- If a nonexistent or invalid logical database name is supplied.
java.sql.SQLException
- If a problem occured creating the query.DBQuery createQuery() throws DatabaseManagerException, java.sql.SQLException
DatabaseManagerException
- If a nonexistent default logical database has been set.
java.sql.SQLException
- If a problem occured creating the query.setDefaultDatabase(java.lang.String)
java.lang.String logicalDatabaseType(java.lang.String dbName) throws DatabaseManagerException, java.sql.SQLException
dbName
- Logical name of the database from which to obtain a query.
DatabaseManagerException
- If a nonexistent default logical database has been set.
java.sql.SQLException
- If a problem occured creating the query.setDefaultDatabase(java.lang.String)
java.lang.String logicalDatabaseType() throws DatabaseManagerException, java.sql.SQLException
DatabaseManagerException
- If a nonexistent default logical database has been set.
java.sql.SQLException
- If a problem occured creating the query.setDefaultDatabase(java.lang.String)
void setDefaultDatabase(java.lang.String dbName) throws DatabaseManagerException
dbName
- The default logical dabase name.
DatabaseManagerException
- If a nonexistent or illegal logical database name is supplied.java.lang.String getDefaultDB()
void shutdown()
java.lang.String[] getLogicalDatabaseNames()
java.lang.String getType(java.lang.String dbName) throws DatabaseManagerException
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.long getRequestCount(java.lang.String dbName) throws DatabaseManagerException
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.int getActiveConnectionCount(java.lang.String dbName) throws DatabaseManagerException
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.int getMaxConnectionCount(java.lang.String dbName) throws DatabaseManagerException
resetMaxConnectionCount()
was called.
This is a historical highwater mark.
If not implemented, then -1 is returned.
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.java.util.Date getMaxConnectionCountDate(java.lang.String dbName) throws DatabaseManagerException
maxConnectionCount()
occured.
If not implemented, then null is returned.
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.void resetMaxConnectionCount(java.lang.String dbName) throws DatabaseManagerException
maxConnectionCount()
. The highwater mark should be
reset to the current number of connections.
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.LogicalDatabase findLogicalDatabase(java.lang.String dbName) throws DatabaseManagerException
DatabaseManagerException
void registerMBeans(java.lang.String appPrefix, com.lutris.util.Config appConfig, java.lang.ClassLoader clsLoader)
void unregisterMBeans()
|
EAF 7.4 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |