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

Variable Index

 o context
The SNMP context used to access the node which owns this instance
 o dc
The parent DataCollector
 o elementCount
The number of elements in this object
 o endOfTable
Flag used to indicate when we hit the end of the requested OID prefix
 o initialOid
The original OID requested
 o lastOid
The last OID we requested in the SNMP GETNEXT packet
 o pdu
The SNMP GETNEXT PDU used to iterate over the OID table
 o values
The list of values for this SNMP GETNEXT object
 o waiting
Flag used to indicate that we are waiting the the GETNEXT reply

Constructor Index

 o SnmpGetTable(SnmpContext, String, String, DataCollector)
Constructor.

Method Index

 o elementAt(int)
Returns the Nth element in the SNMP table.
 o size()
Return the size of the SNMP table.
 o update(Observable, Object)
This method is called via notify() by the underlying SNMP code when a response is received.

Variables

 o values
 private Vector values
The list of values for this SNMP GETNEXT object

 o elementCount
 private int elementCount
The number of elements in this object

 o initialOid
 private String initialOid
The original OID requested

 o lastOid
 private String lastOid
The last OID we requested in the SNMP GETNEXT packet

 o context
 private SnmpContext context
The SNMP context used to access the node which owns this instance

 o endOfTable
 private boolean endOfTable
Flag used to indicate when we hit the end of the requested OID prefix

 o waiting
 private boolean waiting
Flag used to indicate that we are waiting the the GETNEXT reply

 o pdu
 private OneGetNextPdu pdu
The SNMP GETNEXT PDU used to iterate over the OID table

 o dc
 private DataCollector dc
The parent DataCollector

Constructors

 o 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

Methods

 o size
 public int size()
Return the size of the SNMP table.

 o 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
 o 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'.