KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > common > jmx > mbeans > DataCollectorMBean


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: sequoia@continuent.org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * Initial developer(s): Nicolas Modrzyk.
20  * Contributor(s):
21  */

22
23 package org.continuent.sequoia.common.jmx.mbeans;
24
25 import org.continuent.sequoia.common.exceptions.DataCollectorException;
26 import org.continuent.sequoia.common.jmx.monitoring.AbstractDataCollector;
27
28 /**
29  * DataCollector interface to used via JMX. This interface defines the entry
30  * point to collect dynamic data for all Sequoia components.
31  *
32  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
33  */

34 public interface DataCollectorMBean
35 {
36
37   // ****************************************//
38
// *************** Controller Data ********//
39
// ****************************************//
40

41   /**
42    * Get general information on the load of the controller. Get the number of
43    * threads and total memory used up
44    *
45    * @throws DataCollectorException if collection of information fails
46    * @return array of strings
47    */

48   String JavaDoc[][] retrieveControllerLoadData() throws DataCollectorException;
49
50   /**
51    * Get dynamic data of the different virtual databases, like pending
52    * connections size, currentNb of threads and number of active threads.
53    *
54    * @throws DataCollectorException if collection of information fails
55    * @return array of strings
56    */

57   String JavaDoc[][] retrieveVirtualDatabasesData() throws DataCollectorException;
58
59   /**
60    * Try to see if a virtual database exists from its name
61    *
62    * @param name of the virtual database
63    * @return true if exists, false otherwise
64    */

65   boolean hasVirtualDatabase(String JavaDoc name);
66
67   // ****************************************//
68
// *************** Database Data **********//
69
// ****************************************//
70

71   /**
72    * Get the current SQL statistics for all databases
73    *
74    * @throws DataCollectorException if collection of information fails
75    * @return the statistics
76    */

77   String JavaDoc[][] retrieveSQLStats() throws DataCollectorException;
78
79   /**
80    * Get the current cache content for all databases
81    *
82    * @throws DataCollectorException if collection of information fails
83    * @return the cache content
84    */

85   String JavaDoc[][] retrieveCacheData() throws DataCollectorException;
86
87   /**
88    * Get the current cache stats content for all databases
89    *
90    * @throws DataCollectorException if collection of information fails
91    * @return the cache stats content
92    */

93   String JavaDoc[][] retrieveCacheStatsData() throws DataCollectorException;
94
95   /**
96    * Get the current list of backends data for all databases
97    *
98    * @throws DataCollectorException if collection of information fails
99    * @return the backend list content
100    */

101   String JavaDoc[][] retrieveBackendsData() throws DataCollectorException;
102
103   /**
104    * Get the current list of current users and associated data for all databases
105    *
106    * @throws DataCollectorException if collection of information fails
107    * @return data on users
108    */

109   String JavaDoc[][] retrieveClientsData() throws DataCollectorException;
110
111   /**
112    * Get the current SQL statistics
113    *
114    * @param virtualDatabasename of the database to get the data from
115    * @return the statistics
116    * @throws DataCollectorException if collection of information fails
117    */

118   String JavaDoc[][] retrieveSQLStats(String JavaDoc virtualDatabasename)
119       throws DataCollectorException;
120
121   /**
122    * Get the current cache content
123    *
124    * @param virtualDatabasename of the database to get the data from
125    * @return the cache content
126    * @throws DataCollectorException if collection of information fails
127    */

128   String JavaDoc[][] retrieveCacheData(String JavaDoc virtualDatabasename)
129       throws DataCollectorException;
130
131   /**
132    * Get the current cache stats content
133    *
134    * @param virtualDatabasename of the database to get the data from
135    * @return the cache stats content
136    * @throws DataCollectorException if collection of information fails
137    */

138   String JavaDoc[][] retrieveCacheStatsData(String JavaDoc virtualDatabasename)
139       throws DataCollectorException;
140
141   /**
142    * Get the current list of backends data
143    *
144    * @param virtualDatabasename of the database to get the data from
145    * @return the backend list content
146    * @throws DataCollectorException if collection of information fails
147    */

148   String JavaDoc[][] retrieveBackendsData(String JavaDoc virtualDatabasename)
149       throws DataCollectorException;
150
151   /**
152    * Retrive information about the scheduler, like number of pending requests,
153    * number of writes executed and number of read executed
154    *
155    * @param virtualDatabasename of the database to get the data from
156    * @return data on the associated scheduler
157    * @throws DataCollectorException if collection of data fails
158    */

159   String JavaDoc[][] retrieveSchedulerData(String JavaDoc virtualDatabasename)
160       throws DataCollectorException;
161
162   /**
163    * Get the current list of current users and associated data
164    *
165    * @param virtualDatabasename of the database to get the data from
166    * @return data on users
167    * @throws DataCollectorException if collection of information fails
168    */

169   String JavaDoc[][] retrieveClientsData(String JavaDoc virtualDatabasename)
170       throws DataCollectorException;
171
172   // ****************************************//
173
// *************** Fine grain Data ********//
174
// ****************************************//
175
/**
176    * Get some data information on a fine grain approach
177    *
178    * @param collector for the data to be accessed
179    * @return <code>long</code> value of the data
180    * @throws DataCollectorException if collection of information fails
181    */

182   long retrieveData(AbstractDataCollector collector)
183       throws DataCollectorException;
184
185   /**
186    * Get starting point for exchanging data on a particular target
187    *
188    * @param dataType as given in the DataCollection interface
189    * @param targetName if needed (like backendname,clientName ...)
190    * @param virtualDbName if needed
191    * @return collector instance
192    * @throws DataCollectorException if fails to get proper collector instance
193    * @see org.continuent.sequoia.common.jmx.monitoring.DataCollection
194    */

195   AbstractDataCollector retrieveDataCollectorInstance(int dataType,
196       String JavaDoc targetName, String JavaDoc virtualDbName) throws DataCollectorException;
197
198   /**
199    * Gets content data of the recovery log
200    *
201    * @param databaseName the virtual database name
202    * @return data on the recovery log
203    * @throws DataCollectorException if collection of information fails
204    */

205   String JavaDoc[][] retrieveRecoveryLogData(String JavaDoc databaseName) throws DataCollectorException;
206
207 }
Popular Tags