org.objectweb.cjdbc.controller.monitoring.datacollector
Class DataCollector

java.lang.Object
  extended byjavax.management.StandardMBean
      extended byorg.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
          extended byorg.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector
All Implemented Interfaces:
DataCollectorMBean, javax.management.DynamicMBean, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class DataCollector
extends AbstractStandardMBean
implements DataCollectorMBean

This class implements retrieval of data to all possible objects in the controller or other c-jdbc components. It gets its interface from the corresponding MBean.

Author:
Nicolas Modrzyk , Emmanuel Cecchet

Nested Class Summary
 
Nested classes inherited from class javax.management.StandardMBean
 
Field Summary
static java.lang.String AUTHENTICATION_FAILED
          Authentication failed
static java.lang.String BACKEND_CANNOT_BE_DISABLED
          Cannot disable backend exception
static java.lang.String BACKEND_NOT_ACCESSIBLE
          Cannot get access to backend exception
static java.lang.String CLIENT_NOT_FOUND
          Client not found exception
(package private)  Controller controller
           
static java.lang.String DATABASE_NOT_FOUND
          Database not found
static java.lang.String INVALID_COLLECTOR_TYPE
          Invalid Data type for collector
(package private) static Trace logger
          Logger instance
static java.lang.String NO_CACHE_ENABLED
          No cache enabled exception
static java.lang.String NOT_IMPLEMENTED
          Not Implemented exception
 
Fields inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
 
Fields inherited from class javax.management.StandardMBean
 
Constructor Summary
DataCollector(Controller controller)
          Create a new DataCollector associated to this controller.
 
Method Summary
 java.lang.String getAssociatedString()
          Allow to retrieve internationalization description on mbeans as well
 Controller getController()
           
private  VirtualDatabase getVirtualDatabase(java.lang.String name)
          Try to get a virtual database from its name
 boolean hasVirtualDatabase(java.lang.String name)
          Try to see if a virtual database exists from its name
 java.lang.String[][] retrieveBackendsData()
          Get the current list of backends data for all databases
 java.lang.String[][] retrieveBackendsData(java.lang.String virtualDatabasename)
          Get the current list of backends data
 java.lang.String[][] retrieveCacheData()
          Get the current cache content for all databases
 java.lang.String[][] retrieveCacheData(java.lang.String virtualDatabasename)
          Get the current cache content
 java.lang.String[][] retrieveCacheStatsData()
          Get the current cache stats content for all databases
 java.lang.String[][] retrieveCacheStatsData(java.lang.String virtualDatabasename)
          Get the current cache stats content
 java.lang.String[][] retrieveClientsData()
          Get the current list of current users and associated data for all databases
 java.lang.String[][] retrieveClientsData(java.lang.String virtualDatabasename)
          Get the current list of current users and associated data
 java.lang.String[][] retrieveControllerLoadData()
          Get general information on the load of the controller.
 long retrieveData(AbstractDataCollector collector)
          Get some data information on a fine grain approach
 AbstractDataCollector retrieveDataCollectorInstance(int dataType, java.lang.String targetName, java.lang.String virtualDbName)
          Get starting point for exchanging data on a particular target
 java.lang.String[][] retrieveRecoveryLogData(java.lang.String databaseName)
          Gets content data of the recovery log
 java.lang.String[][] retrieveSchedulerData(java.lang.String virtualDatabasename)
          Retrive information about the scheduler, like number of pending requests, number of writes executed and number of read executed
 java.lang.String[][] retrieveSQLStats()
          Get the current SQL statistics for all databases
 java.lang.String[][] retrieveSQLStats(java.lang.String virtualDatabasename)
          Get the current SQL statistics
 java.lang.String[][] retrieveVirtualDatabasesData()
          Get dynamic data of the different virtual databases, like pending connections size, currentNb of threads and number of active threads.
 
Methods inherited from class org.objectweb.cjdbc.controller.jmx.AbstractStandardMBean
addNotificationListener, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getNotificationInfo, getParameterName, getParameterName, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, invoke, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static Trace logger
Logger instance


controller

Controller controller

NO_CACHE_ENABLED

public static final java.lang.String NO_CACHE_ENABLED
No cache enabled exception

See Also:
Constant Field Values

NOT_IMPLEMENTED

public static final java.lang.String NOT_IMPLEMENTED
Not Implemented exception

See Also:
Constant Field Values

BACKEND_NOT_ACCESSIBLE

public static final java.lang.String BACKEND_NOT_ACCESSIBLE
Cannot get access to backend exception

See Also:
Constant Field Values

BACKEND_CANNOT_BE_DISABLED

public static final java.lang.String BACKEND_CANNOT_BE_DISABLED
Cannot disable backend exception

See Also:
Constant Field Values

CLIENT_NOT_FOUND

public static final java.lang.String CLIENT_NOT_FOUND
Client not found exception

See Also:
Constant Field Values

INVALID_COLLECTOR_TYPE

public static final java.lang.String INVALID_COLLECTOR_TYPE
Invalid Data type for collector

See Also:
Constant Field Values

AUTHENTICATION_FAILED

public static final java.lang.String AUTHENTICATION_FAILED
Authentication failed

See Also:
Constant Field Values

DATABASE_NOT_FOUND

public static final java.lang.String DATABASE_NOT_FOUND
Database not found

See Also:
Constant Field Values
Constructor Detail

DataCollector

public DataCollector(Controller controller)
              throws javax.management.NotCompliantMBeanException,
                     JmxException
Create a new DataCollector associated to this controller.

Parameters:
controller - to collect data from
Throws:
javax.management.NotCompliantMBeanException - - if the mbeanInterface does not follow JMX design patterns for Management Interfaces, or if this does not implement the specified interface.
JmxException - the bean could not be registered
Method Detail

getAssociatedString

public java.lang.String getAssociatedString()
Description copied from class: AbstractStandardMBean
Allow to retrieve internationalization description on mbeans as well

Specified by:
getAssociatedString in class AbstractStandardMBean
Returns:
part of the key to look for in the translation file.
See Also:
AbstractStandardMBean.getAssociatedString()

getVirtualDatabase

private VirtualDatabase getVirtualDatabase(java.lang.String name)
                                    throws DataCollectorException
Try to get a virtual database from its name

Parameters:
name - of the virtual database
Returns:
virtual database object
Throws:
DataCollectorException - if does not exist

retrieveBackendsData

public java.lang.String[][] retrieveBackendsData()
                                          throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current list of backends data for all databases

Specified by:
retrieveBackendsData in interface DataCollectorMBean
Returns:
the backend list content
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveBackendsData()

retrieveBackendsData

public java.lang.String[][] retrieveBackendsData(java.lang.String virtualDatabasename)
                                          throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current list of backends data

Specified by:
retrieveBackendsData in interface DataCollectorMBean
Parameters:
virtualDatabasename - of the database to get the data from
Returns:
the backend list content
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveBackendsData(java.lang.String)

retrieveCacheData

public java.lang.String[][] retrieveCacheData()
                                       throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current cache content for all databases

Specified by:
retrieveCacheData in interface DataCollectorMBean
Returns:
the cache content
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveCacheData()

retrieveRecoveryLogData

public java.lang.String[][] retrieveRecoveryLogData(java.lang.String databaseName)
                                             throws DataCollectorException
Description copied from interface: DataCollectorMBean
Gets content data of the recovery log

Specified by:
retrieveRecoveryLogData in interface DataCollectorMBean
Parameters:
databaseName - the virtual database name
Returns:
data on the recovery log
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveRecoveryLogData(java.lang.String)

retrieveCacheData

public java.lang.String[][] retrieveCacheData(java.lang.String virtualDatabasename)
                                       throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current cache content

Specified by:
retrieveCacheData in interface DataCollectorMBean
Parameters:
virtualDatabasename - of the database to get the data from
Returns:
the cache content
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveCacheData(java.lang.String)

retrieveCacheStatsData

public java.lang.String[][] retrieveCacheStatsData()
                                            throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current cache stats content for all databases

Specified by:
retrieveCacheStatsData in interface DataCollectorMBean
Returns:
the cache stats content
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveCacheStatsData()

retrieveCacheStatsData

public java.lang.String[][] retrieveCacheStatsData(java.lang.String virtualDatabasename)
                                            throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current cache stats content

Specified by:
retrieveCacheStatsData in interface DataCollectorMBean
Parameters:
virtualDatabasename - of the database to get the data from
Returns:
the cache stats content
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveCacheStatsData(java.lang.String)

retrieveClientsData

public java.lang.String[][] retrieveClientsData()
                                         throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current list of current users and associated data for all databases

Specified by:
retrieveClientsData in interface DataCollectorMBean
Returns:
data on users
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveClientsData()

retrieveClientsData

public java.lang.String[][] retrieveClientsData(java.lang.String virtualDatabasename)
                                         throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current list of current users and associated data

Specified by:
retrieveClientsData in interface DataCollectorMBean
Parameters:
virtualDatabasename - of the database to get the data from
Returns:
data on users
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveClientsData(java.lang.String)

retrieveControllerLoadData

public java.lang.String[][] retrieveControllerLoadData()
Description copied from interface: DataCollectorMBean
Get general information on the load of the controller. Get the number of threads and total memory used up

Specified by:
retrieveControllerLoadData in interface DataCollectorMBean
Returns:
array of strings
See Also:
DataCollectorMBean.retrieveControllerLoadData()

retrieveSQLStats

public java.lang.String[][] retrieveSQLStats()
                                      throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current SQL statistics for all databases

Specified by:
retrieveSQLStats in interface DataCollectorMBean
Returns:
the statistics
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveSQLStats()

retrieveSQLStats

public java.lang.String[][] retrieveSQLStats(java.lang.String virtualDatabasename)
                                      throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get the current SQL statistics

Specified by:
retrieveSQLStats in interface DataCollectorMBean
Parameters:
virtualDatabasename - of the database to get the data from
Returns:
the statistics
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveSQLStats()

retrieveVirtualDatabasesData

public java.lang.String[][] retrieveVirtualDatabasesData()
Description copied from interface: DataCollectorMBean
Get dynamic data of the different virtual databases, like pending connections size, currentNb of threads and number of active threads.

Specified by:
retrieveVirtualDatabasesData in interface DataCollectorMBean
Returns:
array of strings
See Also:
DataCollectorMBean.retrieveVirtualDatabasesData()

getController

public Controller getController()
Returns:
Returns the controller.

retrieveSchedulerData

public java.lang.String[][] retrieveSchedulerData(java.lang.String virtualDatabasename)
                                           throws DataCollectorException
Description copied from interface: DataCollectorMBean
Retrive information about the scheduler, like number of pending requests, number of writes executed and number of read executed

Specified by:
retrieveSchedulerData in interface DataCollectorMBean
Parameters:
virtualDatabasename - of the database to get the data from
Returns:
data on the associated scheduler
Throws:
DataCollectorException - if collection of data fails
See Also:
DataCollectorMBean.retrieveSchedulerData(java.lang.String)

retrieveDataCollectorInstance

public AbstractDataCollector retrieveDataCollectorInstance(int dataType,
                                                           java.lang.String targetName,
                                                           java.lang.String virtualDbName)
                                                    throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get starting point for exchanging data on a particular target

Specified by:
retrieveDataCollectorInstance in interface DataCollectorMBean
Parameters:
dataType - as given in the DataCollection interface
targetName - if needed (like backendname,clientName ...)
virtualDbName - if needed
Returns:
collector instance
Throws:
DataCollectorException - if fails to get proper collector instance
See Also:
DataCollectorMBean.retrieveDataCollectorInstance(int, java.lang.String, java.lang.String)

retrieveData

public long retrieveData(AbstractDataCollector collector)
                  throws DataCollectorException
Description copied from interface: DataCollectorMBean
Get some data information on a fine grain approach

Specified by:
retrieveData in interface DataCollectorMBean
Parameters:
collector - for the data to be accessed
Returns:
long value of the data
Throws:
DataCollectorException - if collection of information fails
See Also:
DataCollectorMBean.retrieveData(org.objectweb.cjdbc.common.monitor.AbstractDataCollector)

hasVirtualDatabase

public boolean hasVirtualDatabase(java.lang.String name)
Description copied from interface: DataCollectorMBean
Try to see if a virtual database exists from its name

Specified by:
hasVirtualDatabase in interface DataCollectorMBean
Parameters:
name - of the virtual database
Returns:
true if exists, false otherwise
See Also:
DataCollectorMBean.hasVirtualDatabase(java.lang.String)


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.