|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.TreeMap
org.opennms.netmgt.capsd.snmp.IfTableEntry
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.
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_ADMIN_STATUS
|
static java.lang.String |
IF_DESCR
|
static java.lang.String |
IF_IN_DISCARDS
|
static java.lang.String |
IF_IN_ERRORS
|
static java.lang.String |
IF_IN_NUCAST
|
static java.lang.String |
IF_IN_OCTETS
|
static java.lang.String |
IF_IN_UCAST
|
static java.lang.String |
IF_IN_UKNOWN_PROTOS
|
static java.lang.String |
IF_INDEX
|
static java.lang.String |
IF_LAST_CHANGE
|
static java.lang.String |
IF_MTU
|
static java.lang.String |
IF_OPER_STATUS
|
static java.lang.String |
IF_OUT_DISCARDS
|
static java.lang.String |
IF_OUT_ERRORS
|
static java.lang.String |
IF_OUT_NUCAST
|
static java.lang.String |
IF_OUT_OCTETS
|
static java.lang.String |
IF_OUT_QLEN
|
static java.lang.String |
IF_OUT_UCAST
|
static java.lang.String |
IF_PHYS_ADDR
|
static java.lang.String |
IF_SPECIFIC
|
static java.lang.String |
IF_SPEED
|
static java.lang.String |
IF_TYPE
|
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 java.lang.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 |
|
Fields inherited from class java.util.AbstractMap |
|
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 | |
static SnmpPduPacket |
getBulkPdu(int numInterfaces)
This method is used to get a generic SNMPv2 GETBULK PDU that contains a single varbind -- the ifTable root oid. |
static int |
getElementListSize()
Returns the number of entries in the MIB-II ifTable 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 |
public static final java.lang.String IF_INDEX
public static final java.lang.String IF_DESCR
public static final java.lang.String IF_TYPE
public static final java.lang.String IF_MTU
public static final java.lang.String IF_SPEED
public static final java.lang.String IF_PHYS_ADDR
public static final java.lang.String IF_ADMIN_STATUS
public static final java.lang.String IF_OPER_STATUS
public static final java.lang.String IF_LAST_CHANGE
public static final java.lang.String IF_IN_OCTETS
public static final java.lang.String IF_IN_UCAST
public static final java.lang.String IF_IN_NUCAST
public static final java.lang.String IF_IN_DISCARDS
public static final java.lang.String IF_IN_ERRORS
public static final java.lang.String IF_IN_UKNOWN_PROTOS
public static final java.lang.String IF_OUT_OCTETS
public static final java.lang.String IF_OUT_UCAST
public static final java.lang.String IF_OUT_NUCAST
public static final java.lang.String IF_OUT_DISCARDS
public static final java.lang.String IF_OUT_ERRORS
public static final java.lang.String IF_OUT_QLEN
public static final java.lang.String IF_SPECIFIC
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.
public static final java.lang.String TABLE_OID
The TABLE_OID is the object identifier that represents the root of the interface table in the MIB forest.
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.
TABLE_OID
Constructor Detail |
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.
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.
vars
- The array of variable bindings.Method Detail |
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.
vars
- The variables in the interface row.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.
public static SnmpPduPacket getBulkPdu(int numInterfaces)
This method is used to get a generic SNMPv2 GETBULK PDU that contains a single varbind -- the ifTable root oid. The PDU can then be used to perform an SNMP walk of the MIB-II interface table on remote host via SNMPv2 GETBULK REQUESTS.
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.
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.
public static int getElementListSize()
Returns the number of entries in the MIB-II ifTable element list.
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |