Class IfTable
- java.lang.Object
-
- org.opennms.netmgt.snmp.CollectionTracker
-
- org.opennms.netmgt.snmp.AggregateTracker
-
- org.opennms.netmgt.provision.service.snmp.SnmpTable<IfTableEntry>
-
- org.opennms.netmgt.provision.service.snmp.IfTable
-
- All Implemented Interfaces:
Collectable
,ProxiableTracker
public final class IfTable extends SnmpTable<IfTableEntry>
The IfTable uses a SnmpSession to collect the entries in the remote agent's interface table. It implements the SnmpHandler to receive notifications and handle errors associated with the data collection. Data is collected using a series of GETNEXT PDU request to walk multiple parts of the interface table at once. The number of SNMP packets should not exceed the number of interface + 1, assuming no lost packets or error conditions occur.
Addition by Jon Whetzel
IfTable has an extra class variable for the SNMP version setting. If this is set for SNMPv2, then a GETBULK command will be used for retrieving the necessary data. Otherwise, the method will resort to its previous implementation with GETNEXT commands.
-
-
Constructor Summary
Constructors Constructor Description IfTable(java.net.InetAddress address)
Constructs an IfTable object that is used to collect the interface elements from the remote agent.IfTable(java.net.InetAddress address, java.util.Set<SnmpInstId> ifIndices)
Constructor for IfTable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IfTableEntry
createTableEntry(SnmpObjId base, SnmpInstId inst, java.lang.Object val)
createTableEntryjava.lang.Integer
getAdminStatus(int ifIndex)
getAdminStatusjava.lang.String
getIfDescr(int ifIndex)
getIfDescrjava.util.Set<java.lang.Integer>
getIfIndices()
getIfIndicesjava.lang.Long
getIfSpeed(int ifIndex)
getIfSpeedjava.lang.Integer
getIfType(int ifIndex)
getIfTypejava.lang.Integer
getOperStatus(int ifIndex)
getOperStatusjava.lang.String
getPhysAddr(int ifIndex)
getPhysAddrvoid
updateSnmpInterfaceData(OnmsNode node)
updateSnmpInterfaceDatavoid
updateSnmpInterfaceData(OnmsNode node, java.lang.Integer ifIndex)
updateSnmpInterfaceData-
Methods inherited from class org.opennms.netmgt.provision.service.snmp.SnmpTable
getEntries, getEntry, getEntry, getInstances, reportFatalErr, reportGenErr, reportNonFatalErr, reportNoSuchNameErr, storeResult
-
Methods inherited from class org.opennms.netmgt.snmp.AggregateTracker
buildNextPdu, getWalkRequests, handleWalkResponses, isFinished, setFailed, setMaxRepetitions, setMaxRetries, setTimedOut
-
Methods inherited from class org.opennms.netmgt.snmp.CollectionTracker
failed, getCollectionTracker, getParent, reportTooBigErr, setFinished, setParent, timedOut
-
-
-
-
Constructor Detail
-
IfTable
public IfTable(java.net.InetAddress address)
Constructs an IfTable object that is used to collect the interface elements from the remote agent. Once all the interfaces are collected, or there is an error in the collection the signaler object is notified to inform other threads.
- Parameters:
address
- TODO- See Also:
IfTableEntry
-
IfTable
public IfTable(java.net.InetAddress address, java.util.Set<SnmpInstId> ifIndices)
Constructor for IfTable.
- Parameters:
address
- aInetAddress
object.ifIndices
- aSet
object.
-
-
Method Detail
-
createTableEntry
protected IfTableEntry createTableEntry(SnmpObjId base, SnmpInstId inst, java.lang.Object val)
createTableEntry
- Specified by:
createTableEntry
in classSnmpTable<IfTableEntry>
- Parameters:
base
- aSnmpObjId
object.inst
- aSnmpInstId
object.val
- aObject
object.- Returns:
- a T object.
-
getOperStatus
public java.lang.Integer getOperStatus(int ifIndex)
getOperStatus
- Parameters:
ifIndex
- a int.- Returns:
- a
Integer
object.
-
getAdminStatus
public java.lang.Integer getAdminStatus(int ifIndex)
getAdminStatus
- Parameters:
ifIndex
- a int.- Returns:
- a
Integer
object.
-
getIfType
public java.lang.Integer getIfType(int ifIndex)
getIfType
- Parameters:
ifIndex
- a int.- Returns:
- a
Integer
object.
-
getIfDescr
public java.lang.String getIfDescr(int ifIndex)
getIfDescr
- Parameters:
ifIndex
- a int.- Returns:
- a
String
object.
-
getIfSpeed
public java.lang.Long getIfSpeed(int ifIndex)
getIfSpeed
- Parameters:
ifIndex
- a int.- Returns:
- a
Long
object.
-
getPhysAddr
public java.lang.String getPhysAddr(int ifIndex)
getPhysAddr
- Parameters:
ifIndex
- a int.- Returns:
- a
String
object.
-
updateSnmpInterfaceData
public void updateSnmpInterfaceData(OnmsNode node)
updateSnmpInterfaceData
- Parameters:
node
- aOnmsNode
object.
-
updateSnmpInterfaceData
public void updateSnmpInterfaceData(OnmsNode node, java.lang.Integer ifIndex)
updateSnmpInterfaceData
- Parameters:
node
- aOnmsNode
object.ifIndex
- aInteger
object.
-
getIfIndices
public java.util.Set<java.lang.Integer> getIfIndices()
getIfIndices
- Returns:
- a
Set
object.
-
-