Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.appserver.server.sql
Interface DatabaseManager  view DatabaseManager download DatabaseManager.java

All Known Implementing Classes:
StandardDatabaseManager

public interface DatabaseManager

The database management object interface. This class implementing this interface manages the database connections for one application.

Version:
$Revision: 1.13.12.1 $

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.
 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.
 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.
 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

debug

public static final boolean debug
Flag to enable debug logging of queries and transactions.

See Also:
Constant Field Values
Method Detail

allocateConnection

public DBConnection allocateConnection(java.lang.String dbName)
                                throws DatabaseManagerException,
                                       java.sql.SQLException
Allocate a connection to the specified logic database. The connection should be returned to the pool by calling its release() function. A thread will wait if no connections are available. Interupted exceptions are converted to errors.


allocateConnection

public DBConnection allocateConnection()
                                throws DatabaseManagerException,
                                       java.sql.SQLException
Allocate a connection to the default logical database. The connection should be returned to the pool by calling its release() function. A thread will wait if no connections are available. Interupted exceptions are converted to errors.


allocateObjectId

public ObjectId allocateObjectId(java.lang.String dbName)
                          throws DatabaseManagerException,
                                 ObjectIdException
Allocate an object id from the specified logical database.


allocateObjectId

public ObjectId allocateObjectId()
                          throws DatabaseManagerException,
                                 ObjectIdException
Allocate an object id from the specified logical database.


createTransaction

public DBTransaction createTransaction(java.lang.String dbName)
                                throws DatabaseManagerException,
                                       java.sql.SQLException
Create a transaction object for the specified logical database.


createTransaction

public DBTransaction createTransaction()
                                throws DatabaseManagerException,
                                       java.sql.SQLException
Create a transaction object for the default logical database.


createQuery

public DBQuery createQuery(java.lang.String dbName)
                    throws DatabaseManagerException,
                           java.sql.SQLException
Create a query object for the specified logical database.


createQuery

public DBQuery createQuery()
                    throws DatabaseManagerException,
                           java.sql.SQLException
Create a query object for the default logical database.


setDefaultDatabase

public void setDefaultDatabase(java.lang.String dbName)
                        throws DatabaseManagerException
Set the default logical database. This should be used with caution, but it makes allocating connections easier.


shutdown

public void shutdown()
Shutdown the database manager. All logical databases will be shutdown and all connection closed.


getLogicalDatabaseNames

public java.lang.String[] getLogicalDatabaseNames()
Returns the list of managed logical databases.


getType

public java.lang.String getType(java.lang.String dbName)
                         throws DatabaseManagerException
Returns a description of the logical database type.


getRequestCount

public long getRequestCount(java.lang.String dbName)
                     throws DatabaseManagerException
Returns the number of requests made to the database since startup time.


getActiveConnectionCount

public int getActiveConnectionCount(java.lang.String dbName)
                             throws DatabaseManagerException
Returns the number of currently active connections for the supplied logical database name. If not implemented, then -1 is returned.


getMaxConnectionCount

public int getMaxConnectionCount(java.lang.String dbName)
                          throws DatabaseManagerException
Returns the maximum number of concurent connections that existed at any time since this object was created, or resetMaxConnectionCount() was called. This is a historical highwater mark. If not implemented, then -1 is returned.


getMaxConnectionCountDate

public java.util.Date getMaxConnectionCountDate(java.lang.String dbName)
                                         throws DatabaseManagerException
Returns the time when the maximum refered to by maxConnectionCount() occured. If not implemented, then null is returned.


resetMaxConnectionCount

public void resetMaxConnectionCount(java.lang.String dbName)
                             throws DatabaseManagerException
Reset the maximum connection count. See maxConnectionCount(). The highwater mark should be reset to the current number of connections.