Class SnmpGetTable
java.lang.Object
|
+----SnmpGetTable
- public class SnmpGetTable
- extends Object
- implements Observer
This class repeatedly performs a SNMP GETNEXT operation
to populate a SNMP table.
This class uses the Westhawk 3.x SNMP package to implement a simple
SNMP GETNEXT operation. The Westhawk SNMP package is available at:
www.westhawk.co.uk
- Version:
- $Revision: 1.13 $, $Date: 2000/10/31 20:32:03 $
- Author:
- Joseph Thomas
-
context
- The SNMP context used to access the node which owns this instance
-
dc
- The parent DataCollector
-
elementCount
- The number of elements in this object
-
endOfTable
- Flag used to indicate when we hit the end of the requested OID prefix
-
initialOid
- The original OID requested
-
lastOid
- The last OID we requested in the SNMP GETNEXT packet
-
pdu
- The SNMP GETNEXT PDU used to iterate over the OID table
-
values
- The list of values for this SNMP GETNEXT object
-
waiting
- Flag used to indicate that we are waiting the the GETNEXT reply
-
SnmpGetTable(SnmpContext, String, String, DataCollector)
- Constructor.
-
elementAt(int)
- Returns the Nth element in the SNMP table.
-
size()
- Return the size of the SNMP table.
-
update(Observable, Object)
- This method is called via notify() by the underlying SNMP code
when a response is received.
values
private Vector values
- The list of values for this SNMP GETNEXT object
elementCount
private int elementCount
- The number of elements in this object
initialOid
private String initialOid
- The original OID requested
lastOid
private String lastOid
- The last OID we requested in the SNMP GETNEXT packet
context
private SnmpContext context
- The SNMP context used to access the node which owns this instance
endOfTable
private boolean endOfTable
- Flag used to indicate when we hit the end of the requested OID prefix
waiting
private boolean waiting
- Flag used to indicate that we are waiting the the GETNEXT reply
pdu
private OneGetNextPdu pdu
- The SNMP GETNEXT PDU used to iterate over the OID table
dc
private DataCollector dc
- The parent DataCollector
SnmpGetTable
public SnmpGetTable(SnmpContext context,
String comm,
String var,
DataCollector dc)
- Constructor.
- Parameters:
- context - The SNMP context for this request
- comm - The SNMP community name to use when sending this GETNEXT
- var - The SNMP ObjectID to GETNEXT
- dc - pointer to parent DataCollector
size
public int size()
- Return the size of the SNMP table.
elementAt
public Object elementAt(int idx)
- Returns the Nth element in the SNMP table.
- Parameters:
- idx - The index of the desired table element.
- Returns:
- the object which represents the value at the idx'th entry
update
public void update(Observable ovs,
Object obj)
- This method is called via notify() by the underlying SNMP code
when a response is received.
Store the answer in the form of a Varbind entry in a local Vector
table 'values'.