001: /**
002: * Sequoia: Database clustering technology.
003: * Copyright (C) 2006 Continuent.
004: * Contact: sequoia@continuent.org
005: *
006: * Licensed under the Apache License, Version 2.0 (the "License");
007: * you may not use this file except in compliance with the License.
008: * You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: *
018: * Initial developer(s): Jeff Mesnil.
019: * Contributor(s): ______________________.
020: */package org.continuent.sequoia.common.jmx.mbeans;
021:
022: import java.util.Map;
023:
024: import javax.management.openmbean.TabularData;
025:
026: /**
027: * MBean Interface to manage the recovery log of a virtual database.
028: *
029: * @see org.continuent.sequoia.common.jmx.JmxConstants#getRecoveryLogObjectName(String)
030: */
031: public interface RecoveryLogControlMBean {
032:
033: /**
034: * Dumps the content of the recovery log table as a TabularData from a given
035: * starting index.<br />
036: * The number of entries retrieved by a call to this method is given by
037: * <code>getEntriesPerPage()</code>. It can not be more than that (but it
038: * can be less).<br />
039: * To retrieve the whole content of the recovery log from its start, the
040: * client has to call this method with <code>from = 0</code> and
041: * subsenquentely with the index value of the last feteched entry until the
042: * tabular data returned by the method is empty. <br />
043: * The returned type is TabularData for 2 reasons: 1/ it makes it compatible
044: * with generic JMX clients 2/ it shields the JMX clients (including ours)
045: * from the internal representation of the recovery log table
046: *
047: * @param from starting index of the entries to dump (<code>0</code> to
048: * dump from the beginning of the recovery log)
049: * @return a TabularData representing the content of the recovery log table
050: * starting from the <code>from</code> index
051: * @see #getEntriesPerDump()
052: */
053: TabularData dump(long from);
054:
055: TabularData getRequestsInTransaction(long tid);
056:
057: /**
058: * Returns the max number of entries which can be returned by the
059: * <code>dump(int)</code> method.
060: *
061: * @return the max number of entries which can be returned by the
062: * <code>dump(int)</code> method
063: * @see #dump(int)
064: */
065: int getEntriesPerDump();
066:
067: /**
068: * Returns an array of String representing the column names of the recovery
069: * log table.<br />
070: * <em>This array can be used as an hint to order the content of the recovery log retrieved
071: * as a TabularData.</em>
072: *
073: * @return an array of String representing the column names of the recovery
074: * lgo table
075: */
076: String[] getHeaders();
077:
078: /**
079: * Returns an array of <strong>2</strong> <code>long</code> representing
080: * the min and max indexes currently contained in the recovery log.
081: * <ul>
082: * <li>the first <code>long</code> corresponds to the <em>min index</em>
083: * in the recovery log</li>
084: * <li>the second <code>long</code> corresponds to the <em>max index</em>
085: * in the recovery log</li>
086: * </ul>
087: *
088: * @return an array of <strong>2</strong> <code>long</code> representing
089: * the min and max indexes currently contained in the recovery log or
090: * <code>null</code> if the indexes have not been computed
091: */
092: long[] getIndexes();
093:
094: /**
095: * Returns the number of entries currently contained in the recovery log.
096: *
097: * @return an long representing the number of entries currently contained in
098: * the recovery log or <code>-1</code> if the number of entries is
099: * unknown
100: */
101: long getEntries();
102:
103: /**
104: * Returns a <code>Map<String, String></code> where the keys are the
105: * checkpoint names and the values are the corresponding IDs in the recovery
106: * log. The returned Map is ordered by log ID (newest first).
107: *
108: * @return an ordered <code>Map<String, String></code> where the keys
109: * are the checkpoint names and the values are the log IDs
110: */
111: Map/* <String, String> */getCheckpoints();
112: }
|