EAF 7.4 Implementation

org.enhydra.server
Class DatabaseInfo

java.lang.Object
  extended by org.enhydra.server.DatabaseInfo

public class DatabaseInfo
extends java.lang.Object

This class is used for obtaining information about particular application connected to its database properties. Information are provided from the DatabaseManager instance associated to specified application.


Constructor Summary
DatabaseInfo(com.lutris.appserver.server.Application app, com.lutris.util.Config appConfig)
          Construction with asociated application and coresponded configuration parameters represented via Config object.
 
Method Summary
 java.lang.String getActiveConnections(java.lang.String dBname)
          Gets the number of currently active connections for the supplied logical database name.
 java.lang.String getDbManagerType()
          Gets the type of DatabaseManager instance.
 java.lang.String getDbType(java.lang.String dBname)
          Gets database type for given database name from DatabaseManager instance.
 java.lang.String getDefaultLogicalDbName()
          Gets the default logical database name.
 java.lang.String[] getLogicalDbNames()
          Returns list of logical database names obtained from application DatabaseManager object.
 java.lang.String getPeakConnections(java.lang.String dBname)
          Gets the maximum number of concurent connections that existed at any time since this object was created.
 java.util.Date getPeakConnectionsDate(java.lang.String dBname)
          Gets the date and time when maximum number of concurent connections occurs since this object was created.
 java.lang.String getTotalRequests(java.lang.String dBname)
          Gets the number of requests made to the database since startup time
 void resetMaxConnectionCount(java.lang.String dBname)
          Reset the maximum connection count for the given logical database name.
 void setDefaultLogicalDbName(java.lang.String dBname)
          Sets the default logical database name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseInfo

public DatabaseInfo(com.lutris.appserver.server.Application app,
                    com.lutris.util.Config appConfig)
             throws com.lutris.appserver.server.sql.DatabaseManagerException,
                    com.lutris.util.KeywordValueException
Construction with asociated application and coresponded configuration parameters represented via Config object.

Parameters:
app - associate aplication
appConfig - cofiguration file parameters represented as Config object
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException
com.lutris.util.KeywordValueException
Method Detail

getLogicalDbNames

public java.lang.String[] getLogicalDbNames()
Returns list of logical database names obtained from application DatabaseManager object.

Returns:
list of logical database names represented as array of Strings, or null if application has no corresponding databases.

getDbManagerType

public java.lang.String getDbManagerType()
Gets the type of DatabaseManager instance.

Returns:
type of DatabaseManager instance represented as String, or N/A if this property is not available.

getDbType

public java.lang.String getDbType(java.lang.String dBname)
                           throws com.lutris.appserver.server.sql.DatabaseManagerException
Gets database type for given database name from DatabaseManager instance.

Parameters:
dBname - name of database.
Returns:
database type represented as String, or N/A if this property is not available.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException

getActiveConnections

public java.lang.String getActiveConnections(java.lang.String dBname)
                                      throws com.lutris.appserver.server.sql.DatabaseManagerException
Gets the number of currently active connections for the supplied logical database name.

Parameters:
dBname - name of database.
Returns:
number of currently active connections represented as String, or N/A if this property is not available.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException

getPeakConnections

public java.lang.String getPeakConnections(java.lang.String dBname)
                                    throws com.lutris.appserver.server.sql.DatabaseManagerException
Gets the maximum number of concurent connections that existed at any time since this object was created.

Parameters:
dBname - name of database.
Returns:
maximum number of concurent connections represented as String, or N/A if this property is not available.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException

getPeakConnectionsDate

public java.util.Date getPeakConnectionsDate(java.lang.String dBname)
                                      throws com.lutris.appserver.server.sql.DatabaseManagerException
Gets the date and time when maximum number of concurent connections occurs since this object was created.

Parameters:
dBname - name of database.
Returns:
date and time when maximum number of concurent connections occurs represented as Date object, or null if this property is not implemented
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException

getTotalRequests

public java.lang.String getTotalRequests(java.lang.String dBname)
                                  throws com.lutris.appserver.server.sql.DatabaseManagerException
Gets the number of requests made to the database since startup time

Parameters:
dBname - name of database.
Returns:
number of requests made to the database represented as String, or N/A if this property is not available.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException

setDefaultLogicalDbName

public void setDefaultLogicalDbName(java.lang.String dBname)
                             throws com.lutris.appserver.server.sql.DatabaseManagerException,
                                    com.lutris.util.KeywordValueException
Sets the default logical database name.

Parameters:
dBname - name of database which will be set as default.
Throws:
com.lutris.util.KeywordValueException
com.lutris.appserver.server.sql.DatabaseManagerException

getDefaultLogicalDbName

public java.lang.String getDefaultLogicalDbName()
Gets the default logical database name.

Returns:
name of database which is set as default.

resetMaxConnectionCount

public void resetMaxConnectionCount(java.lang.String dBname)
                             throws com.lutris.appserver.server.sql.DatabaseManagerException
Reset the maximum connection count for the given logical database name.

Parameters:
dBname - name of database which connection count will be reset.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException

EAF 7.4 Implementation