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.
GEN_ERR, NO_ERR, NO_SUCH_NAME_ERR, TOO_BIG_ERR
Constructor and Description |
---|
IfTable(InetAddress address)
Constructs an IfTable object that is used to collect the interface
elements from the remote agent.
|
Modifier and Type | Method and Description |
---|---|
protected IfTableEntry |
createTableEntry(SnmpObjId base,
SnmpInstId inst,
Object val)
createTableEntry
|
int |
getAdminStatus(int ifIndex)
getAdminStatus
|
IfTableEntry |
getEntry(int ifIndex)
getEntry
|
String |
getIfDescr(int ifIndex)
getIfDescr
|
Long |
getIfSpeed(int ifIndex)
getIfSpeed
|
int |
getIfType(int ifIndex)
getIfType
|
int |
getOperStatus(int ifIndex)
getOperStatus
|
String |
getPhysAddr(int ifIndex)
getPhysAddr
|
protected ThreadCategory |
log()
log
|
add, addAll, clear, contains, containsAll, getEntries, isEmpty, iterator, remove, removeAll, reportGenErr, reportNoSuchNameErr, retainAll, size, storeResult, toArray, toArray
buildNextPdu, isFinished, setFailed, setMaxRepetitions, setTimedOut
failed, getCollectionTracker, getParent, reportTooBigErr, setFinished, setParent, timedOut
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals, hashCode
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.
address
- TODOIfTableEntry
protected IfTableEntry createTableEntry(SnmpObjId base, SnmpInstId inst, Object val)
createTableEntry
createTableEntry
in class SnmpTable<IfTableEntry>
base
- a SnmpObjId
object.inst
- a SnmpInstId
object.val
- a Object
object.protected final ThreadCategory log()
log
ThreadCategory
object.public IfTableEntry getEntry(int ifIndex)
getEntry
ifIndex
- a int.IfTableEntry
object.public int getOperStatus(int ifIndex)
getOperStatus
ifIndex
- a int.public int getAdminStatus(int ifIndex)
getAdminStatus
ifIndex
- a int.public int getIfType(int ifIndex)
getIfType
ifIndex
- a int.public String getIfDescr(int ifIndex)
getIfDescr
ifIndex
- a int.String
object.public Long getIfSpeed(int ifIndex)
getIfSpeed
ifIndex
- a int.Long
object.Copyright © 2015. All Rights Reserved.