KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*_############################################################################
2   _##
3   _## SNMP4J-AgentJMX - JMXIndexSupport.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 package org.snmp4j.agent.mo.jmx;
23
24 import org.snmp4j.smi.OID;
25 import javax.management.ObjectName JavaDoc;
26
27 /**
28  * The <code>JMXIndexSupport</code> provides a mapping between an Object and
29  * a SNMP index OID. Optionally, the Object can also be mapped directly to
30  * a MBean instance identified by an {@link ObjectName}.
31  *
32  * @author Frank Fock
33  * @version 1.0
34  */

35 public interface JMXIndexSupport {
36
37   /**
38    * Maps a native object identifying a row or alternatively the row's index
39    * into an internal array (e.g., an array returned by a MBean method).
40    *
41    * @param nativeRowId
42    * an Object identifying a row.
43    * @param nativeIndex
44    * optionally the index of the row into an internal array.
45    * @return
46    * a key Object that can be directly mapped to a row index OID.
47    */

48   Object JavaDoc getRowIdentifier(Object JavaDoc nativeRowId, int nativeIndex);
49
50   /**
51    * Maps a row identifier (i.e., an Object returned by
52    * {@link #getRowIdentifier}) to a row index.
53    * @param rowIdentifier
54    * an Object describing a row index.
55    * @return
56    * a row index OID.
57    */

58   OID mapToIndex(Object JavaDoc rowIdentifier);
59
60   /**
61    * Maps a row index OID to an object describing a row index internally.
62    * @param rowIndex
63    * a row index OID.
64    * @return
65    * an Object describing a row index.
66    */

67   Object JavaDoc mapToRowIdentifier(OID rowIndex);
68
69   /**
70    * Maps a row identifier to a MBean object name. If a row cannot be accessed
71    * directly via an index, for example, because the rows are mapped from
72    * a list or array, then <code>null</code> is returned.
73    *
74    * @param rowIdentifier
75    * the row identifier which may be also a native index value into an
76    * array or list of MBean attribute values.
77    * @return ObjectName
78    * the object name of the MBean representing the row identified by
79    * <code>rowIdentifier</code>. If <code>rowIdentifier</code> is a
80    * <code>Integer</code> and <code>null</code> is returned, the caller
81    * should use the rowIdentifier value as index into the value list.
82    */

83   ObjectName JavaDoc mapToRowMBean(Object JavaDoc rowIdentifier);
84 }
85
Popular Tags