|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lutris.appserver.server.sql.standard.StandardLogicalDatabase
Represents a logical database. Each logical database has a connection
allocator and a object id allocator. The standard implementation of
a local database is used when the database is described as of
type Standard in
DatabaseManager.DB.dbname.ClassType
The configuration data is specified in the section:
DatabaseManager.DB.dbName
The following is a description of the sub fields:
JdbcDriver
-
The JDBC driver to use to access that database. Manditory.
E.g. "intersolv.jdbc.sequelink.SequeLinkDriver"
Connection
-
This section is passed onto the connection allocator. See
for details on connection allocator sub fields.
ObjectId
-
This section is passed onto the object id allocator. See
for details on object id allocator sub fields.
Field Summary | |
protected ConnectionAllocator |
connectionAllocator
Database connection allocator. |
protected java.lang.String |
dbName
The symbolic name of this logical database. |
protected java.lang.String |
dbType
The database vendor type. |
protected java.sql.Driver |
driver
Driver object object. |
protected ObjectIdAllocator |
objectIdAllocator
Object id manager. |
Constructor Summary | |
StandardLogicalDatabase()
Default constructor to configure a single logical database. |
|
StandardLogicalDatabase(java.lang.String dbName,
Config dbConfig)
Creates and configures a single logical database. |
Method Summary | |
DBConnection |
allocateConnection()
Return the connection allocator object associated with 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,
Config dbConfig)
Initialize a single logical database. |
ConnectionAllocator |
loadConnectionAllocator(Config connectionConfig)
Return the connection allocator. |
ObjectIdAllocator |
loadObjectIdAllocator(Config objIdConfig)
Return the object id allocator. |
void |
resetMaxConnectionCount()
Reset the maximum connection count and date. |
void |
shutdown()
Immediately shutdown the logical database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ConnectionAllocator connectionAllocator
protected ObjectIdAllocator objectIdAllocator
protected java.sql.Driver driver
protected java.lang.String dbName
protected java.lang.String dbType
Constructor Detail |
public StandardLogicalDatabase()
init()
method must be called to
configure the database.
public StandardLogicalDatabase(java.lang.String dbName, Config dbConfig) throws ConfigException, java.sql.SQLException
dbName
- The logical name of the database. Used todbConfig
- The configuration object for this logical database.
get config parameters.
ConfigException
- If there is an error in the configuration file.
java.sql.SQLException
- If a SQL error occurs.Method Detail |
public void init(java.lang.String dbName, Config dbConfig) throws ConfigException, java.sql.SQLException
init
in interface LogicalDatabase
dbName
- The logical name of the database.dbConfig
- The configuration object for this logical database.
ConfigException
- If there is an error in
the configuration file.
java.sql.SQLException
- If a SQL error occurs.public void checkOId(ObjectId oid) throws ObjectIdException
checkOId
in interface LogicalDatabase
oid
- oid which will be checked.
ObjectIdException
- If a oid does't belong to range.public ConnectionAllocator loadConnectionAllocator(Config connectionConfig) throws ConfigException
connectionConfig
- The configuration object for the connection allocator.
ConfigException
- If there is an error in the configuration file.public ObjectIdAllocator loadObjectIdAllocator(Config objIdConfig) throws ConfigException
objIdConfig
- The configuration object for the object id allocator.
ConfigException
- If there is an error in the configuration file.public DBConnection allocateConnection() throws java.sql.SQLException
allocateConnection
in interface LogicalDatabase
java.sql.SQLException
- if SQL error occurs allocating connection.public ObjectId allocateObjectId() throws ObjectIdException
allocateObjectId
in interface LogicalDatabase
ObjectIdException
- if an error occurs allocating an object id.public DBTransaction createTransaction() throws java.sql.SQLException
createTransaction
in interface LogicalDatabase
java.sql.SQLException
- if a SQL error occurs.public DBQuery createQuery() throws java.sql.SQLException
createQuery
in interface LogicalDatabase
java.sql.SQLException
- if a SQL error occurs.public void shutdown()
shutdown
in interface LogicalDatabase
public java.lang.String getName()
getName
in interface LogicalDatabase
public java.lang.String getType()
getType
in interface LogicalDatabase
public int getActiveConnectionCount()
getActiveConnectionCount
in interface LogicalDatabase
public int getMaxConnectionCount()
getMaxConnectionCount
in interface LogicalDatabase
public java.util.Date getMaxConnectionCountDate()
getMaxConnectionCountDate
in interface LogicalDatabase
Date
when the maximum connection
count occured.public void resetMaxConnectionCount()
resetMaxConnectionCount
in interface LogicalDatabase
public long getRequestCount()
getRequestCount
in interface LogicalDatabase
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |