KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > mo > jmx > JMXTableSupport


1 /*_############################################################################
2   _##
3   _## SNMP4J-AgentJMX - JMXTableSupport.java
4   _##
5   _## Copyright (C) 2006-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## This program is free software; you can redistribute it and/or modify
8   _## it under the terms of the GNU General Public License version 2 as
9   _## published by the Free Software Foundation.
10   _##
11   _## This program is distributed in the hope that it will be useful,
12   _## but WITHOUT ANY WARRANTY; without even the implied warranty of
13   _## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   _## GNU General Public License for more details.
15   _##
16   _## You should have received a copy of the GNU General Public License
17   _## along with this program; if not, write to the Free Software
18   _## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19   _## MA 02110-1301 USA
20   _##
21   _##########################################################################*/

22
23 package org.snmp4j.agent.mo.jmx;
24
25 import org.snmp4j.smi.OID;
26 import org.snmp4j.agent.mo.MOTableRow;
27 import java.util.Iterator JavaDoc;
28
29 /**
30  * The <code>JMXTableSupport</code> defines the necessary interface to
31  * map tabular JMX data to a SNMP4J-Agent table model. The interface
32  * takes care of mapping JMX row identifiers to SNMP table indexes and vice
33  * versa.
34  *
35  * @author Frank Fock
36  * @version 1.0
37  */

38 public interface JMXTableSupport {
39
40   /**
41    * Maps a native MBean row identifier object or index to a SNMP table index
42    * OID.
43    * @param tableOID
44    * the OID of the table ManagedObject (including the .1 of the entry
45    * object) for which indexes are mapped.
46    * @param nativeRowID
47    * the native row ID object which identifies the row. If <code>null</code>
48    * then <code>nativeIndex</code> identifies the row.
49    * @param nativeIndex
50    * the native enumerating index if rows are not identified by an object.
51    * @return
52    * the SNMP row index OID (suffix).
53    */

54   OID mapToIndex(OID tableOID, Object JavaDoc nativeRowID, int nativeIndex);
55
56   /**
57    * Maps a SNMP row index to a native row identifier object.
58    * @param tableOID
59    * the OID of the table ManagedObject (including the .1 of the entry
60    * object) for which indexes are mapped.
61    * @param rowIndex
62    * a SNMP row index of the table specified by <code>tableOID</code>.
63    * @return
64    * a native row identifier.
65    */

66   Object JavaDoc mapToRowId(OID tableOID, OID rowIndex);
67
68   /**
69    * Returns an Iterator over the row identifiers of the table.
70    * @param tableOID
71    * the OID of the table ManagedObject (including the .1 of the entry
72    * object) for which indexes are mapped.
73    * @return
74    * an Iterator of row identifiers.
75    */

76   Iterator JavaDoc rowIdIterator(OID tableOID);
77
78   /**
79    * Returns a tail iterator over the row identifiers of the table.
80    * @param tableOID
81    * the OID of the table ManagedObject (including the .1 of the entry
82    * object) for which indexes are mapped.
83    * @param firstRowId
84    * the lower bound (including) of the row identifiers to return.
85    * @return
86    * an Iterator of row identifiers.
87    */

88   Iterator JavaDoc rowIdTailIterator(OID tableOID, Object JavaDoc firstRowId);
89
90   /**
91    * Gets the last SNMP index currently supported by the specified table.
92    * @param tableOID
93    * the OID of the table ManagedObject (including the .1 of the entry
94    * object) for which indexes are mapped.
95    * @return
96    * the last SNMP row index of the specified table.
97    */

98   OID getLastIndex(OID tableOID);
99
100   /**
101    * Returns the number of rows of the specified table.
102    * @param tableOID
103    * the OID of the table ManagedObject (including the .1 of the entry
104    * object) for which indexes are mapped.
105    * @return
106    * the number of rows in the table.
107    */

108   int getRowCount(OID tableOID);
109
110   /**
111    * Gets the row values for the specified row.
112    * @param tableOID
113    * the OID of the table ManagedObject (including the .1 of the entry
114    * object) for which indexes are mapped.
115    * @param row
116    * a <code>MOTableRow</code> instance which will be modified to hold the
117    * SNMP values of the row specified by <code>row</code>'s index value.
118    * @return
119    * a SNMP error status that indicates whether to operation succeeded or
120    * not.
121    */

122   int getRow(OID tableOID, MOTableRow row);
123
124   /**
125    * Sets the value of a column (cell) of a row from the corresponding SNMP
126    * conceptual row.
127    * @param tableOID
128    * the OID of the table ManagedObject (including the .1 of the entry
129    * object) for which indexes are mapped.
130    * @param row
131    * a <code>MOTableRow</code> instance that identifies the target row by its
132    * row index (indirectly) and that contains the SNMP values that replace
133    * the corresponding native values.
134    * @param column
135    * the zero-based column index to set.
136    * @return
137    * a SNMP error status that indicates whether to operation succeeded or
138    * not.
139    */

140   int setRow(OID tableOID, MOTableRow row, int column);
141
142 }
143
Popular Tags