EAF 7.6 API

com.lutris.appserver.server.sql
Interface LogicalDatabase


public interface LogicalDatabase

Interface for a logical database. Each logical database must provide services for connection and object id allocation.

Since:
LBS1.8
Version:
$Revision: 1.1 $
Author:
Paul Morgan

Method Summary
 DBConnection allocateConnection()
          Return a connection to this logical database.
 ObjectId allocateObjectId()
          Return an object id for this logical database.
 void checkOId(ObjectId oid)
          Check does oid belong to Object id's range [minOId, currentOId]
 DBQuery createQuery()
          Return a query for use on this logical database.
 DBTransaction createTransaction()
          Return a transaction for use on this logical database.
 int getActiveConnectionCount()
          Return the number of currently active connections.
 int getMaxConnectionCount()
          Return the maximum number of connections active at one time.
 java.util.Date getMaxConnectionCountDate()
          Return the time when the maximum connection count occured.
 java.lang.String getName()
          Return the symbolic name of this logical database.
 long getRequestCount()
          Return the number of database requests.
 java.lang.String getType()
          Return a description of the logical database type.
 void init(java.lang.String dbName, com.lutris.util.Config dbConfig)
          Initialize the logical database.
 void resetMaxConnectionCount()
          Reset the maximum connection count and date.
 void shutdown()
          Immediately shutdown the logical database.
 

Method Detail

init

void init(java.lang.String dbName,
          com.lutris.util.Config dbConfig)
          throws ConfigException,
                 java.sql.SQLException
Initialize the logical database.

Throws:
ConfigException - if there is an error in the configuration.
java.sql.SQLException - if a SQL error occurs.

allocateConnection

DBConnection allocateConnection()
                                throws java.sql.SQLException
Return a connection to this logical database.

Returns:
The connection.
Throws:
java.sql.SQLException - if a SQL error occurs.

allocateObjectId

ObjectId allocateObjectId()
                          throws ObjectIdException
Return an object id for this logical database.

Returns:
The object id.
Throws:
ObjectIdException - if an object id cannot be allocated.

checkOId

void checkOId(ObjectId oid)
              throws ObjectIdException
Check does oid belong to Object id's range [minOId, currentOId]

Parameters:
oid - oid which will be checked.
Throws:
ObjectIdException - If a oid does't belong to range.

createTransaction

DBTransaction createTransaction()
                                throws java.sql.SQLException
Return a transaction for use on this logical database.

Returns:
The transaction object.
Throws:
java.sql.SQLException - if a SQL error occurs.

createQuery

DBQuery createQuery()
                    throws java.sql.SQLException
Return a query for use on this logical database.

Returns:
The query object.
Throws:
java.sql.SQLException - if a SQL error occurs.

shutdown

void shutdown()
Immediately shutdown the logical database. All connections should be closed and any other cleanup performed.


getName

java.lang.String getName()
Return the symbolic name of this logical database.

Returns:
The symbolic name.

getType

java.lang.String getType()
Return a description of the logical database type.

Returns:
The type.

getActiveConnectionCount

int getActiveConnectionCount()
Return the number of currently active connections.

Returns:
The number of connections.

getMaxConnectionCount

int getMaxConnectionCount()
Return the maximum number of connections active at one time.

Returns:
The number of connections.

getMaxConnectionCountDate

java.util.Date getMaxConnectionCountDate()
Return the time when the maximum connection count occured.

Returns:
The Date when the maximum connection count occured.

resetMaxConnectionCount

void resetMaxConnectionCount()
Reset the maximum connection count and date.


getRequestCount

long getRequestCount()
Return the number of database requests.

Returns:
The number of database requests (queries or transactions).

EAF 7.6 API