KickJava   Java API By Example, From Geeks To Geeks.

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


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

21
22 package org.continuent.sequoia.common.jmx.mbeans;
23
24 import java.util.Map JavaDoc;
25
26 import javax.management.openmbean.TabularData JavaDoc;
27
28 /**
29  * MBean Interface to manage the recovery log of a virtual database.
30  *
31  * @see org.continuent.sequoia.common.jmx.JmxConstants#getRecoveryLogObjectName(String)
32  */

33 public interface RecoveryLogControlMBean
34 {
35
36   /**
37    * Dumps the content of the recovery log table as a TabularData from a given
38    * starting index.<br />
39    * The number of entries retrieved by a call to this method is given by
40    * <code>getEntriesPerPage()</code>. It can not be more than that (but it
41    * can be less).<br />
42    * To retrieve the whole content of the recovery log from its start, the
43    * client has to call this method with <code>from = 0</code> and
44    * subsenquentely with the index value of the last feteched entry until the
45    * tabular data returned by the method is empty. <br />
46    * The returned type is TabularData for 2 reasons: 1/ it makes it compatible
47    * with generic JMX clients 2/ it shields the JMX clients (including ours)
48    * from the internal representation of the recovery log table
49    *
50    * @param from starting index of the entries to dump (<code>0</code> to
51    * dump from the beginning of the recovery log)
52    * @return a TabularData representing the content of the recovery log table
53    * starting from the <code>from</code> index
54    * @see #getEntriesPerDump()
55    */

56   TabularData JavaDoc dump(long from);
57
58   /**
59    * Returns the max number of entries which can be returned by the
60    * <code>dump(int)</code> method.
61    *
62    * @return the max number of entries which can be returned by the
63    * <code>dump(int)</code> method
64    * @see #dump(long)
65    */

66   int getEntriesPerDump();
67
68   /**
69    * Returns an array of String representing the column names of the recovery
70    * log table.<br />
71    * <em>This array can be used as an hint to order the content of the recovery log retrieved
72    * as a TabularData.</em>
73    *
74    * @return an array of String representing the column names of the recovery
75    * lgo table
76    */

77   String JavaDoc[] getHeaders();
78
79   /**
80    * Returns an array of <strong>2</strong> <code>long</code> representing
81    * the min and max indexes currently contained in the recovery log.
82    * <ul>
83    * <li>the first <code>long</code> corresponds to the <em>min index</em>
84    * in the recovery log</li>
85    * <li>the second <code>long</code> corresponds to the <em>max index</em>
86    * in the recovery log</li>
87    * </ul>
88    *
89    * @return an array of <strong>2</strong> <code>long</code> representing
90    * the min and max indexes currently contained in the recovery log or
91    * <code>null</code> if the indexes have not been computed
92    */

93   long[] getIndexes();
94
95   /**
96    * Returns the number of entries currently contained in the recovery log.
97    *
98    * @return an long representing the number of entries currently contained in
99    * the recovery log or <code>-1</code> if the number of entries is
100    * unknown
101    */

102   long getEntries();
103
104   /**
105    * Returns a <code>Map&lt;String, String&gt;</code> where the keys are the
106    * checkpoint names and the values are the corresponding IDs in the recovery
107    * log. The returned Map is ordered by log ID (newest first).
108    *
109    * @return an ordered <code>Map&lt;String, String&gt;</code> where the keys
110    * are the checkpoint names and the values are the log IDs
111    */

112   Map JavaDoc/* <String, String> */getCheckpoints();
113 }
114
Popular Tags