|
DODS 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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. |
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 |
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. |
Field Detail |
public static final boolean debug
Method Detail |
public com.lutris.util.Config getConfig()
public 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.public 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)
public 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.public 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)
public 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.public 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.public 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.public 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)
public 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.public 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)
public java.lang.String logicalDatabaseType(java.lang.String dbNAme) 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)
public 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)
public 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.public java.lang.String getDefaultDB()
public void shutdown()
public java.lang.String[] getLogicalDatabaseNames()
public java.lang.String getType(java.lang.String dbName) throws DatabaseManagerException
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.public long getRequestCount(java.lang.String dbName) throws DatabaseManagerException
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.public int getActiveConnectionCount(java.lang.String dbName) throws DatabaseManagerException
dbName
- The logical database name.
DatabaseManagerException
- If a nonexistent logical database name is supplied.public 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.public 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.public 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.
|
DODS 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |