org.snmp4j.agent.mo.jmx
Class MBeanAttributeMOTableSupport

java.lang.Object
  extended by org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
      extended by org.snmp4j.agent.mo.jmx.MBeanAttributeMOTableSupport
All Implemented Interfaces:
JMXTableSupport

public class MBeanAttributeMOTableSupport
extends AbstractMBeanSupport
implements JMXTableSupport

The MBeanAttributeMOTableSupport maps SNMP conceptual tables (MOTable) to MBean attributes and vice versa.

Version:
1.0
Author:
Frank Fock

Field Summary
 
Fields inherited from class org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
oid2MBeanMap, server
 
Constructor Summary
MBeanAttributeMOTableSupport(javax.management.MBeanServerConnection server)
           
 
Method Summary
 void add(org.snmp4j.smi.OID tableOID, MBeanAttributeMOTableInfo mBeanInfo)
          Adds a table to MBean attributes mapping.
 void addAll(java.lang.Object[][] tableDescriptions)
          Adds a list of table to MBean attributes mappings.
 org.snmp4j.smi.OID getLastIndex(org.snmp4j.smi.OID tableOID)
          Gets the last SNMP index currently supported by the specified table.
 int getRow(org.snmp4j.smi.OID tableOID, org.snmp4j.agent.mo.MOTableRow row)
          Gets the row values for the specified row.
 int getRowCount(org.snmp4j.smi.OID tableOID)
          Returns the number of rows of the specified table.
 org.snmp4j.smi.OID mapToIndex(org.snmp4j.smi.OID tableOID, java.lang.Object nativeRowId, int nativeIndex)
          Maps a native MBean row identifier object or index to a SNMP table index OID.
 java.lang.Object mapToRowId(org.snmp4j.smi.OID tableOID, org.snmp4j.smi.OID rowIndex)
          Maps a SNMP row index to a native row identifier object.
 java.util.Iterator rowIdIterator(org.snmp4j.smi.OID tableOID)
          Returns an Iterator over the row identifiers of the table.
 java.util.Iterator rowIdTailIterator(org.snmp4j.smi.OID tableOID, java.lang.Object firstRowId)
          Returns a tail iterator over the row identifiers of the table.
 int setRow(org.snmp4j.smi.OID tableOID, org.snmp4j.agent.mo.MOTableRow row, int column)
          Sets the value of a column (cell) of a row from the corresponding SNMP conceptual row.
 
Methods inherited from class org.snmp4j.agent.mo.jmx.AbstractMBeanSupport
getMBeanMOInfo, removeMBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanAttributeMOTableSupport

public MBeanAttributeMOTableSupport(javax.management.MBeanServerConnection server)
Method Detail

add

public void add(org.snmp4j.smi.OID tableOID,
                MBeanAttributeMOTableInfo mBeanInfo)
Adds a table to MBean attributes mapping.

Parameters:
tableOID - the entry OID of the table (including the .1).
mBeanInfo - a MBeanAttributeMOTableInfo instance describing the actual mapping.

addAll

public void addAll(java.lang.Object[][] tableDescriptions)
Adds a list of table to MBean attributes mappings.

Parameters:
tableDescriptions - an two dimensional array of table descriptions. Each description contains two elements:
  1. the OID of the table entry (thus including the .1),
  2. a MBeanAttributeMOTableInfo instance.

getLastIndex

public org.snmp4j.smi.OID getLastIndex(org.snmp4j.smi.OID tableOID)
Description copied from interface: JMXTableSupport
Gets the last SNMP index currently supported by the specified table.

Specified by:
getLastIndex in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
Returns:
the last SNMP row index of the specified table.

getRow

public int getRow(org.snmp4j.smi.OID tableOID,
                  org.snmp4j.agent.mo.MOTableRow row)
Description copied from interface: JMXTableSupport
Gets the row values for the specified row.

Specified by:
getRow in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
row - a MOTableRow instance which will be modified to hold the SNMP values of the row specified by row's index value.
Returns:
a SNMP error status that indicates whether to operation succeeded or not.

setRow

public int setRow(org.snmp4j.smi.OID tableOID,
                  org.snmp4j.agent.mo.MOTableRow row,
                  int column)
Description copied from interface: JMXTableSupport
Sets the value of a column (cell) of a row from the corresponding SNMP conceptual row.

Specified by:
setRow in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
row - a MOTableRow instance that identifies the target row by its row index (indirectly) and that contains the SNMP values that replace the corresponding native values.
column - the zero-based column index to set.
Returns:
a SNMP error status that indicates whether to operation succeeded or not.

getRowCount

public int getRowCount(org.snmp4j.smi.OID tableOID)
Description copied from interface: JMXTableSupport
Returns the number of rows of the specified table.

Specified by:
getRowCount in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
Returns:
the number of rows in the table.

rowIdIterator

public java.util.Iterator rowIdIterator(org.snmp4j.smi.OID tableOID)
Description copied from interface: JMXTableSupport
Returns an Iterator over the row identifiers of the table.

Specified by:
rowIdIterator in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
Returns:
an Iterator of row identifiers.

mapToIndex

public org.snmp4j.smi.OID mapToIndex(org.snmp4j.smi.OID tableOID,
                                     java.lang.Object nativeRowId,
                                     int nativeIndex)
Description copied from interface: JMXTableSupport
Maps a native MBean row identifier object or index to a SNMP table index OID.

Specified by:
mapToIndex in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
nativeRowId - the native row ID object which identifies the row. If null then nativeIndex identifies the row.
nativeIndex - the native enumerating index if rows are not identified by an object.
Returns:
the SNMP row index OID (suffix).

mapToRowId

public java.lang.Object mapToRowId(org.snmp4j.smi.OID tableOID,
                                   org.snmp4j.smi.OID rowIndex)
Description copied from interface: JMXTableSupport
Maps a SNMP row index to a native row identifier object.

Specified by:
mapToRowId in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
rowIndex - a SNMP row index of the table specified by tableOID.
Returns:
a native row identifier.

rowIdTailIterator

public java.util.Iterator rowIdTailIterator(org.snmp4j.smi.OID tableOID,
                                            java.lang.Object firstRowId)
Description copied from interface: JMXTableSupport
Returns a tail iterator over the row identifiers of the table.

Specified by:
rowIdTailIterator in interface JMXTableSupport
Parameters:
tableOID - the OID of the table ManagedObject (including the .1 of the entry object) for which indexes are mapped.
firstRowId - the lower bound (including) of the row identifiers to return.
Returns:
an Iterator of row identifiers.

Copyright 2006-2007 Frank Fock (SNMP4J.org)