OpenNMS API 1.2.3

org.opennms.netmgt.capsd.snmp
Class IpAddrTableEntry

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

public final class IpAddrTableEntry
extends java.util.TreeMap

The IpAddrTableEntry class is designed to hold all the MIB-II information for one entry in the ipAddrTable. The table effectively contains a list of these entries, each entry having information about one address. The entry contains an IP Address, its netmask, interface binding, broadcast address, and maximum packet reassembly size.

This object is used by the IpAddrTable to hold infomation single entries in the table. See the IpAddrTable documentation form more information.

Author:
Sowmya , Weave , Jon Whetzel , OpenNMS
See Also:
IpAddrTable, RFC1213 , 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 IP_ADDR_ENT_ADDR
           
static java.lang.String IP_ADDR_ENT_BCASTADDR
           
static java.lang.String IP_ADDR_ENT_NETMASK
           
static java.lang.String IP_ADDR_IF_INDEX
           
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 IP Address table in the MIB forest.
 
Fields inherited from class java.util.TreeMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
IpAddrTableEntry()
           Creates a default instance of the IP Address table entry map.
IpAddrTableEntry(SnmpVarBind[] vars)
           The class constructor used to initialize the object to its initial state.
 
Method Summary
static int getElementListSize()
           Returns the number of entries in the MIB-II ipAddrTable element list.
static SnmpPduPacket getNextPdu(int version)
           If the SNMP version is V1, this method is used to get a generic SNMP 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

IP_ADDR_ENT_ADDR

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

IP_ADDR_IF_INDEX

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

IP_ADDR_ENT_NETMASK

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

IP_ADDR_ENT_BCASTADDR

public static final java.lang.String IP_ADDR_ENT_BCASTADDR
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.


TABLE_OID

public static final java.lang.String TABLE_OID

The TABLE_OID is the object identifier that represents the root of the IP Address 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

IpAddrTableEntry

public IpAddrTableEntry()

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


IpAddrTableEntry

public IpAddrTableEntry(SnmpVarBind[] vars)

The class constructor used to initialize the object to its initial state. Although the object's member variables can change after an instance is created, this constructor will initialize all the variables as per their named variable from the passed array of SNMP varbinds.

If the information in the object should not be modified then a final modifier can be applied to the created object.

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 address row.

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

Parameters:
vars - The variables in the interface row.

getNextPdu

public static SnmpPduPacket getNextPdu(int version)

If the SNMP version is V1, this method is used to get a generic SNMP GETNEXT PDU that contains one varbind per member element.

If the SNMP version is V2, this method is used to get an SNMP GETBULK PDU with a single varbind containing the TABLE_OID object identifier.

The PDU can then be used to perform an SNMP walk of the MIB-II IP Address table of a remote host.

Parameters:
version - SnmpSMI.SNMPV1 or SnmpSMI.SNMPV2
Returns:
An SnmpPduPacket object with a command of GETNEXT (for SNMPv1) or GETBULK (for SNMPv2).

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.


getElementListSize

public static int getElementListSize()

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


OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.