00001 /** 00002 * C-JDBC: Clustered JDBC. 00003 * Copyright (C) 2002-2004 French National Institute For Research In Computer 00004 * Science And Control (INRIA). 00005 * Contact: c-jdbc@objectweb.org 00006 * 00007 * This library is free software; you can redistribute it and/or modify it 00008 * under the terms of the GNU Lesser General Public License as published by the 00009 * Free Software Foundation; either version 2.1 of the License, or any later 00010 * version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but WITHOUT 00013 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 00015 * for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public License 00018 * along with this library; if not, write to the Free Software Foundation, 00019 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 00020 * 00021 * Initial developer(s): Nicolas Modrzyk. 00022 * Contributor(s): 00023 */ 00024 00025 package org.objectweb.cjdbc.common.jmx.mbeans; 00026 00027 import org.objectweb.cjdbc.common.exceptions.DataCollectorException; 00028 import org.objectweb.cjdbc.common.monitor.AbstractDataCollector; 00029 00030 /** 00031 * DataCollector interface to used via JMX. This interface defines the entry 00032 * point to collect dynamic data for all c-jdbc components. 00033 * 00034 * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a> 00035 */ 00036 public interface DataCollectorMBean 00037 { 00038 00039 // ****************************************// 00040 // *************** Controller Data ********// 00041 // ****************************************// 00042 00043 /** 00044 * Get general information on the load of the controller. Get the number of 00045 * threads and total memory used up 00046 * 00047 * @throws DataCollectorException if collection of information fails 00048 * @return array of strings 00049 */ 00050 String[][] retrieveControllerLoadData() throws DataCollectorException; 00051 00052 /** 00053 * Get dynamic data of the different virtual databases, like pending 00054 * connections size, currentNb of threads and number of active threads. 00055 * 00056 * @throws DataCollectorException if collection of information fails 00057 * @return array of strings 00058 */ 00059 String[][] retrieveVirtualDatabasesData() throws DataCollectorException; 00060 00061 /** 00062 * Try to see if a virtual database exists from its name 00063 * 00064 * @param name of the virtual database 00065 * @return true if exists, false otherwise 00066 */ 00067 boolean hasVirtualDatabase(String name); 00068 00069 // ****************************************// 00070 // *************** Database Data **********// 00071 // ****************************************// 00072 00073 /** 00074 * Get the current SQL statistics for all databases 00075 * 00076 * @throws DataCollectorException if collection of information fails 00077 * @return the statistics 00078 */ 00079 String[][] retrieveSQLStats() throws DataCollectorException; 00080 00081 /** 00082 * Get the current cache content for all databases 00083 * 00084 * @throws DataCollectorException if collection of information fails 00085 * @return the cache content 00086 */ 00087 String[][] retrieveCacheData() throws DataCollectorException; 00088 00089 /** 00090 * Get the current cache stats content for all databases 00091 * 00092 * @throws DataCollectorException if collection of information fails 00093 * @return the cache stats content 00094 */ 00095 String[][] retrieveCacheStatsData() throws DataCollectorException; 00096 00097 /** 00098 * Get the current list of backends data for all databases 00099 * 00100 * @throws DataCollectorException if collection of information fails 00101 * @return the backend list content 00102 */ 00103 String[][] retrieveBackendsData() throws DataCollectorException; 00104 00105 /** 00106 * Get the current list of current users and associated data for all databases 00107 * 00108 * @throws DataCollectorException if collection of information fails 00109 * @return data on users 00110 */ 00111 String[][] retrieveClientsData() throws DataCollectorException; 00112 00113 /** 00114 * Get the current SQL statistics 00115 * 00116 * @param virtualDatabasename of the database to get the data from 00117 * @return the statistics 00118 * @throws DataCollectorException if collection of information fails 00119 */ 00120 String[][] retrieveSQLStats(String virtualDatabasename) 00121 throws DataCollectorException; 00122 00123 /** 00124 * Get the current cache content 00125 * 00126 * @param virtualDatabasename of the database to get the data from 00127 * @return the cache content 00128 * @throws DataCollectorException if collection of information fails 00129 */ 00130 String[][] retrieveCacheData(String virtualDatabasename) 00131 throws DataCollectorException; 00132 00133 /** 00134 * Get the current cache stats content 00135 * 00136 * @param virtualDatabasename of the database to get the data from 00137 * @return the cache stats content 00138 * @throws DataCollectorException if collection of information fails 00139 */ 00140 String[][] retrieveCacheStatsData(String virtualDatabasename) 00141 throws DataCollectorException; 00142 00143 /** 00144 * Get the current list of backends data 00145 * 00146 * @param virtualDatabasename of the database to get the data from 00147 * @return the backend list content 00148 * @throws DataCollectorException if collection of information fails 00149 */ 00150 String[][] retrieveBackendsData(String virtualDatabasename) 00151 throws DataCollectorException; 00152 00153 /** 00154 * Retrive information about the scheduler, like number of pending requests, 00155 * number of writes executed and number of read executed 00156 * 00157 * @param virtualDatabasename of the database to get the data from 00158 * @return data on the associated scheduler 00159 * @throws DataCollectorException if collection of data fails 00160 */ 00161 String[][] retrieveSchedulerData(String virtualDatabasename) 00162 throws DataCollectorException; 00163 00164 /** 00165 * Get the current list of current users and associated data 00166 * 00167 * @param virtualDatabasename of the database to get the data from 00168 * @return data on users 00169 * @throws DataCollectorException if collection of information fails 00170 */ 00171 String[][] retrieveClientsData(String virtualDatabasename) 00172 throws DataCollectorException; 00173 00174 // ****************************************// 00175 // *************** Fine grain Data ********// 00176 // ****************************************// 00177 /** 00178 * Get some data information on a fine grain approach 00179 * 00180 * @param collector for the data to be accessed 00181 * @return <code>long</code> value of the data 00182 * @throws DataCollectorException if collection of information fails 00183 */ 00184 long retrieveData(AbstractDataCollector collector) 00185 throws DataCollectorException; 00186 00187 /** 00188 * Get starting point for exchanging data on a particular target 00189 * 00190 * @param dataType as given in the DataCollection interface 00191 * @param targetName if needed (like backendname,clientName ...) 00192 * @param virtualDbName if needed 00193 * @return collector instance 00194 * @throws DataCollectorException if fails to get proper collector instance 00195 * @see org.objectweb.cjdbc.common.monitor.DataCollection 00196 */ 00197 AbstractDataCollector retrieveDataCollectorInstance(int dataType, 00198 String targetName, String virtualDbName) throws DataCollectorException; 00199 00200 /** 00201 * Gets content data of the recovery log 00202 * 00203 * @param databaseName the virtual database name 00204 * @return data on the recovery log 00205 * @throws DataCollectorException if collection of information fails 00206 */ 00207 String[][] retrieveRecoveryLogData(String databaseName) throws DataCollectorException; 00208 00209 }