OpenNMS API 1.2.3

org.opennms.netmgt.capsd.snmp
Class IfXTableEntry

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.TreeMap
          extended byorg.opennms.netmgt.capsd.snmp.IfXTableEntry
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable, java.util.SortedMap

public final class IfXTableEntry
extends java.util.TreeMap

This object contains a list of all the elements defined in the MIB-II interface extensions 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: ifName,ifInMulticastPts ,ifInBroadcastPkts,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 RFC1573 from the IETF.

Version:
1.1.1.1
Author:
Mike , Weave , OpenNMS
See Also:
RFC1573 , Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.TreeMap
 
Nested classes inherited from class java.util.AbstractMap
 
Field Summary
static java.lang.String IF_ALIAS
           
static java.lang.String IF_CONNECTOR_PRESENT
           
static java.lang.String IF_COUNTER_DISCONTINUITY_TIME
           
static java.lang.String IF_HC_IN_BCAST_PKTS
           
static java.lang.String IF_HC_IN_MCAST_PKTS
           
static java.lang.String IF_HC_IN_OCTETS
           
static java.lang.String IF_HC_IN_UCAST_PKTS
           
static java.lang.String IF_HC_OUT_BCAST_PKTS
           
static java.lang.String IF_HC_OUT_MCAST_PKTS
           
static java.lang.String IF_HC_OUT_OCTETS
           
static java.lang.String IF_HC_OUT_UCAST_PKTS
           
static java.lang.String IF_HIGH_SPEED
           
static java.lang.String IF_IN_BCAST_PKTS
           
static java.lang.String IF_IN_MCAST_PKTS
           
static java.lang.String IF_INDEX
           
static java.lang.String IF_LINK_UP_DOWN_TRAP_ENABLE
           
static java.lang.String IF_NAME
          Lookup strings for specific table entries
static java.lang.String IF_OUT_BCAST_PKTS
           
static java.lang.String IF_OUT_MCAST_PKTS
           
static java.lang.String IF_PROMISCUOUS_MODE
           
private static NamedSnmpVar[] ms_elemList
           The keys that will be supported by default from the TreeMap base class.
(package private) static int NUM_OIDS
          Number of object identfiers making up the interface extensions table WARNING: This value must be incremented by one for each new object added to the ms_elemList variable
static SnmpObjectId ROOT
           The SnmpObjectId that represents the root of the interface tree.
static java.lang.String TABLE_OID
           The TABLE_OID is the object identifier that represents the root of the interface extensions table in the MIB forest.
 
Fields inherited from class java.util.TreeMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
IfXTableEntry()
           Creates a default instance of the interface table entry map.
IfXTableEntry(SnmpVarBind[] vars)
           The class constructor used to initialize the object to its initial state.
 
Method Summary
static SnmpPduPacket getBulkPdu(int numInterfaces)
           This method is used to get a generic SNMPv2 GETBULK PDU that contains a single varbind -- the ifXTable root oid.
static int getElementListSize()
           Returns the number of entries in the MIB-II ifXTable element list.
static SnmpPduRequest getIfNumberPdu()
           This method will generate a packet that will go out and retrieve the ifNumber variable from the MIB, the variable that states the number of interfaces for the device.
static SnmpPduPacket getNextPdu()
           This method is used to get a generic SNMPv1 GETNEXT PDU that contains one varbind per member element.
static SnmpObjectId stop_oid()
           This method will determine where the cut off point will be for valid data from the response to the GETBULK packet.
 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
clear, clone, comparator, containsKey, containsValue, entrySet, firstKey, get, headMap, keySet, lastKey, put, putAll, remove, size, subMap, tailMap, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, isEmpty, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode, isEmpty
 

Field Detail

IF_NAME

public static final java.lang.String IF_NAME
Lookup strings for specific table entries

See Also:
Constant Field Values

IF_IN_MCAST_PKTS

public static final java.lang.String IF_IN_MCAST_PKTS
See Also:
Constant Field Values

IF_IN_BCAST_PKTS

public static final java.lang.String IF_IN_BCAST_PKTS
See Also:
Constant Field Values

IF_OUT_MCAST_PKTS

public static final java.lang.String IF_OUT_MCAST_PKTS
See Also:
Constant Field Values

IF_OUT_BCAST_PKTS

public static final java.lang.String IF_OUT_BCAST_PKTS
See Also:
Constant Field Values

IF_HC_IN_OCTETS

public static final java.lang.String IF_HC_IN_OCTETS
See Also:
Constant Field Values

IF_HC_IN_UCAST_PKTS

public static final java.lang.String IF_HC_IN_UCAST_PKTS
See Also:
Constant Field Values

IF_HC_IN_MCAST_PKTS

public static final java.lang.String IF_HC_IN_MCAST_PKTS
See Also:
Constant Field Values

IF_HC_IN_BCAST_PKTS

public static final java.lang.String IF_HC_IN_BCAST_PKTS
See Also:
Constant Field Values

IF_HC_OUT_OCTETS

public static final java.lang.String IF_HC_OUT_OCTETS
See Also:
Constant Field Values

IF_HC_OUT_UCAST_PKTS

public static final java.lang.String IF_HC_OUT_UCAST_PKTS
See Also:
Constant Field Values

IF_HC_OUT_MCAST_PKTS

public static final java.lang.String IF_HC_OUT_MCAST_PKTS
See Also:
Constant Field Values

IF_HC_OUT_BCAST_PKTS

public static final java.lang.String IF_HC_OUT_BCAST_PKTS
See Also:
Constant Field Values

IF_LINK_UP_DOWN_TRAP_ENABLE

public static final java.lang.String IF_LINK_UP_DOWN_TRAP_ENABLE
See Also:
Constant Field Values

IF_HIGH_SPEED

public static final java.lang.String IF_HIGH_SPEED
See Also:
Constant Field Values

IF_PROMISCUOUS_MODE

public static final java.lang.String IF_PROMISCUOUS_MODE
See Also:
Constant Field Values

IF_CONNECTOR_PRESENT

public static final java.lang.String IF_CONNECTOR_PRESENT
See Also:
Constant Field Values

IF_ALIAS

public static final java.lang.String IF_ALIAS
See Also:
Constant Field Values

IF_COUNTER_DISCONTINUITY_TIME

public static final java.lang.String IF_COUNTER_DISCONTINUITY_TIME
See Also:
Constant Field Values

IF_INDEX

public static final java.lang.String IF_INDEX
See Also:
Constant Field Values

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.


NUM_OIDS

static int NUM_OIDS
Number of object identfiers making up the interface extensions table WARNING: This value must be incremented by one for each new object added to the ms_elemList variable


TABLE_OID

public static final java.lang.String TABLE_OID

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

See Also:
Constant Field Values

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

IfXTableEntry

public IfXTableEntry()

Creates a default instance of the interface table entry map. The map represents a singular instance of the interface extensions 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.


IfXTableEntry

public IfXTableEntry(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

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 ifXEntry row that does not have a definition.

Parameters:
vars - The variables in the interface row.

getNextPdu

public static SnmpPduPacket getNextPdu()

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

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

getBulkPdu

public static SnmpPduPacket getBulkPdu(int numInterfaces)

This method is used to get a generic SNMPv2 GETBULK PDU that contains a single varbind -- the ifXTable root oid. The PDU can then be used to perform an SNMP walk of the MIB-II interface extensions table on remote host via SNMPv2 GETBULK REQUESTS.

Returns:
An SnmpPduPacket with the command of GETBULK.

stop_oid

public static SnmpObjectId stop_oid()

This method will determine where the cut off point will be for valid data from the response to the GETBULK packet. By using the size of the element list, listed above, we can determine the proper index for this task.


getIfNumberPdu

public static SnmpPduRequest getIfNumberPdu()

This method will generate a packet that will go out and retrieve the ifNumber variable from the MIB, the variable that states the number of interfaces for the device.


getElementListSize

public static int getElementListSize()

Returns the number of entries in the MIB-II ifXTable element list.


OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.