org.opennms.bb.dp.capsd.snmp
Class IfTableEntry

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.TreeMap
              |
              +--org.opennms.bb.dp.capsd.snmp.IfTableEntry
All Implemented Interfaces:
Cloneable, Map, Serializable, SortedMap

public final class IfTableEntry
extends TreeMap

This object contains a list of all the elements defined in the MIB-II interface table. An instance object is initialized by calling the constructor and passing in a variable list from an SNMP PDU. The actual data can be recovered via the base class map interface.

Once an instance is created and its data set either via the constructor or from the update method, the actual elements can be retreived using the instance names. The names include: ifIndex, ifDescr, ifSpeed, etc al. The information can also be accessed by using the complete object identifer for the entry.

For more information on the individual fields, and to find out their respective object identifiers see RFC1213 from the IETF.

Version:
$Revision: 1.9 $
Author:
Sowmya, Weave, OpenNMS
See Also:
RFC1213, Serialized Form

Inner classes inherited from class java.util.TreeMap
TreeMap.Entry
 
Inner classes inherited from class java.util.Map
Map.Entry
 
Field Summary
private static NamedSnmpVar[] ms_elemList
          The keys that will be supported by default from the TreeMap base class.
static SnmpObjectId ROOT
          The SnmpObjectId that represents the root of the interface tree.
static String TABLE_OID
          The TABLE_OID is the object identifier that represents the root of the interface table in the MIB forest.
 
Fields inherited from class java.util.TreeMap
BLACK, comparator, ENTRIES, entrySet, KEYS, keySet, modCount, RED, root, serialVersionUID, size, values, VALUES
 
Constructor Summary
IfTableEntry()
          Creates a default instance of the interface table entry map.
IfTableEntry(SnmpVarBind[] vars)
          The class constructor used to initialize the object to its initial state.
 
Method Summary
(package private) static void ()
          Initialize the element list for the class.
static SnmpPduRequest getNextPdu()
          This method is used to get a generic SNMP GETNEXT PDU that constains one varbind per member element.
 void update(SnmpVarBind[] vars)
          This method is used to update the map with the current information from the agent.
 
Methods inherited from class java.util.TreeMap
addAllForTreeSet, buildFromSorted, buildFromSorted, clear, clone, colorOf, comparator, compare, computeRedLevel, containsKey, containsValue, decrementSize, deleteEntry, entrySet, firstEntry, firstKey, fixAfterDeletion, fixAfterInsertion, get, getCeilEntry, getEntry, getPrecedingEntry, headMap, incrementSize, key, keySet, lastEntry, lastKey, leftOf, parentOf, put, putAll, readObject, readTreeSet, remove, rightOf, rotateLeft, rotateRight, setColor, size, subMap, successor, swapPosition, tailMap, valEquals, values, valueSearchNonNull, valueSearchNull, writeObject
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Field Detail

ms_elemList

private static NamedSnmpVar[] ms_elemList

The keys that will be supported by default from the TreeMap base class. Each of the elements in the list are an instance of the SNMP Interface table. Objects in this list should be used by multiple instances of this class.


TABLE_OID

public static final String TABLE_OID

The TABLE_OID is the object identifier that represents the root of the interface table in the MIB forest.


ROOT

public static final SnmpObjectId ROOT

The SnmpObjectId that represents the root of the interface tree. It is created when the class is initialized and contains the value of TABLE_OID.

See Also:
TABLE_OID
Constructor Detail

IfTableEntry

public IfTableEntry()

Creates a default instance of the interface table entry map. The map represents a singular instance of the interface table. Each column in the table for the loaded instance may be retreived either through its name or object identifier.

The initial table is constructied with zero elements in the map.


IfTableEntry

public IfTableEntry(SnmpVarBind[] vars)

The class constructor used to initialize the object to its initial state. Although the object's attributes and data can be changed after its created, this constructor will initialize all the variables as per their named varbind in the passed array. This array should have been collected from an SnmpPduRequest that was received from a remote host.

Parameters:
vars - The array of variable bindings.
Method Detail

static void ()

Initialize the element list for the class. This is class wide data, but will be used by each instance.


update

public void update(SnmpVarBind[] vars)

This method is used to update the map with the current information from the agent. The array of variables should be all the elements in the interfaces row.

This does not clear out any column in the actual ifEntry row that does not have a definition.

Parameters:
vars - The variables in the interface row.

getNextPdu

public static SnmpPduRequest getNextPdu()

This method is used to get a generic SNMP GETNEXT PDU that constains one varbind per member element. The PDU can then be used to perform an SNMP walk of the MIB-II interface table a remote host.

Returns:
An SnmpPduRequest with the command of GETNEXT and one varbind for each member variable.