org.opennms.netmgt.provision.service.snmp
Class IfTable

java.lang.Object
  extended by org.opennms.netmgt.snmp.CollectionTracker
      extended by org.opennms.netmgt.snmp.AggregateTracker
          extended by org.opennms.netmgt.provision.service.snmp.SnmpTable<IfTableEntry>
              extended by org.opennms.netmgt.provision.service.snmp.IfTable
All Implemented Interfaces:
Collectable

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.

Author:
Sowmya , Weave
See Also:
RFC1213

Field Summary
 
Fields inherited from class org.opennms.netmgt.snmp.CollectionTracker
GEN_ERR, NO_ERR, NO_SUCH_NAME_ERR, TOO_BIG_ERR
 
Constructor Summary
IfTable(InetAddress address)
           Constructs an IfTable object that is used to collect the interface elements from the remote agent.
IfTable(InetAddress address, Set<SnmpInstId> ifIndices)
          Constructor for IfTable.
 
Method Summary
protected  IfTableEntry createTableEntry(SnmpObjId base, SnmpInstId inst, Object val)
          createTableEntry
 Integer getAdminStatus(int ifIndex)
          getAdminStatus
 String getIfDescr(int ifIndex)
          getIfDescr
 Set<Integer> getIfIndices()
          getIfIndices
 Long getIfSpeed(int ifIndex)
          getIfSpeed
 Integer getIfType(int ifIndex)
          getIfType
 Integer getOperStatus(int ifIndex)
          getOperStatus
 String getPhysAddr(int ifIndex)
          getPhysAddr
protected  ThreadCategory log()
          log
 void updateSnmpInterfaceData(OnmsNode node)
          updateSnmpInterfaceData
 void updateSnmpInterfaceData(OnmsNode node, Integer ifIndex)
          updateSnmpInterfaceData
 
Methods inherited from class org.opennms.netmgt.provision.service.snmp.SnmpTable
getEntries, getEntry, getEntry, getInstances, reportGenErr, reportNoSuchNameErr, storeResult
 
Methods inherited from class org.opennms.netmgt.snmp.AggregateTracker
buildNextPdu, isFinished, setFailed, setMaxRepetitions, setTimedOut
 
Methods inherited from class org.opennms.netmgt.snmp.CollectionTracker
failed, getCollectionTracker, getParent, reportTooBigErr, setFinished, setParent, timedOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IfTable

public IfTable(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(InetAddress address,
               Set<SnmpInstId> ifIndices)

Constructor for IfTable.

Parameters:
address - a InetAddress object.
ifIndices - a Set object.
Method Detail

createTableEntry

protected IfTableEntry createTableEntry(SnmpObjId base,
                                        SnmpInstId inst,
                                        Object val)

createTableEntry

Specified by:
createTableEntry in class SnmpTable<IfTableEntry>
Parameters:
base - a SnmpObjId object.
inst - a SnmpInstId object.
val - a Object object.
Returns:
a T object.

log

protected final ThreadCategory log()

log

Returns:
a ThreadCategory object.

getOperStatus

public Integer getOperStatus(int ifIndex)

getOperStatus

Parameters:
ifIndex - a int.
Returns:
a Integer object.

getAdminStatus

public Integer getAdminStatus(int ifIndex)

getAdminStatus

Parameters:
ifIndex - a int.
Returns:
a Integer object.

getIfType

public Integer getIfType(int ifIndex)

getIfType

Parameters:
ifIndex - a int.
Returns:
a Integer object.

getIfDescr

public String getIfDescr(int ifIndex)

getIfDescr

Parameters:
ifIndex - a int.
Returns:
a String object.

getIfSpeed

public Long getIfSpeed(int ifIndex)

getIfSpeed

Parameters:
ifIndex - a int.
Returns:
a Long object.

getPhysAddr

public String getPhysAddr(int ifIndex)

getPhysAddr

Parameters:
ifIndex - a int.
Returns:
a String object.

updateSnmpInterfaceData

public void updateSnmpInterfaceData(OnmsNode node)

updateSnmpInterfaceData

Parameters:
node - a OnmsNode object.

updateSnmpInterfaceData

public void updateSnmpInterfaceData(OnmsNode node,
                                    Integer ifIndex)

updateSnmpInterfaceData

Parameters:
node - a OnmsNode object.
ifIndex - a Integer object.

getIfIndices

public Set<Integer> getIfIndices()

getIfIndices

Returns:
a Set object.


Copyright © 2011. All Rights Reserved.