All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class aka.snmp.Snmp

java.lang.Object
   |
   +----aka.snmp.Snmp

public class Snmp
extends Object
This class implements a SNMP client. The operations supported are SNMP Get, GetNext, and Set. Also a Walk operation is implemented


Constructor Index

 o Snmp()
Creation of client, default size of cache of 5.
 o Snmp(short)
Creation of client

Method Index

 o dumpMib()
Dump out MIB for debugging
 o get(String, String, int)
SNMP Get Operation.
 o getNext(String, String, int, StringBuffer)
SNMP GetNext Operation.
 o getNext(String, String, StringBuffer)
SNMP GetNext Operation.
 o main(String[])
Test Harness
 o readFile(String)
Read the SNMP objects from this file into memory.
 o readMibFile(String)
Read the SNMP objects from this file into memory.
 o setCommunityName(String)
Set the community name that is going to be used.
 o setTimeOut(int)
Set timeout for SNMP response to seconds.
 o setValue(String, String, int, String)
Performs the SNMP Set operation.
 o walk(String, String, Vector)
Performs a multiple SNMP GetNext starting at variable in the MIB hierachy to the SNMP agent at address.

Constructors

 o Snmp
 public Snmp(short cacheSize)
Creation of client

Parameters:
eter - cacheSize - sets the size of the cache of connections to multiple machines.
 o Snmp
 public Snmp()
Creation of client, default size of cache of 5.

Methods

 o readFile
 public void readFile(String file) throws IOException, SnmpMibException, FileNotFoundException
Read the SNMP objects from this file into memory. The file is a serializer version of the Managed Object Definitions.

 o readMibFile
 public void readMibFile(String file) throws SnmpMibException, FileNotFoundException
Read the SNMP objects from this file into memory. The file is a MIB file that contains all the managed objects.

 o setCommunityName
 public void setCommunityName(String name)
Set the community name that is going to be used.

 o setTimeOut
 public void setTimeOut(int seconds)
Set timeout for SNMP response to seconds.

 o dumpMib
 public void dumpMib()
Dump out MIB for debugging

 o get
 public Type get(String address,
                 String variable,
                 int instance) throws SnmpException, UnknownHostException, IOException, SocketException
SNMP Get Operation. Get the value of the variable and instance from the SNMP agent at address. It's value is returned as a Type. Exceptions are thrown if the operation is unsuccessful.

 o getNext
 public Type getNext(String address,
                     String variable,
                     int instance,
                     StringBuffer newVariable) throws SnmpException, UnknownHostException, IOException, SocketException
SNMP GetNext Operation. Get the value of the variable and instance from the SNMP agent at address. It's value is returned in result, the next variable in the agents MIB hierachy is returned in nextVariable. A exception is generated if the operation is unsuccessful.

 o getNext
 public Type getNext(String address,
                     String variable,
                     StringBuffer result) throws SnmpException, UnknownHostException, IOException, SocketException
SNMP GetNext Operation. Get the value of the variable from the SNMP agent at address. It's value is returned in result, the next variable in the agents MIB hierachy is returned in nextVariable. A exception is generated if a problem occurs. This same SNMP operation as the one above, but it differs that only an ID is given which could or could not have an instance attached to it

 o walk
 public void walk(String address,
                  String variable,
                  Vector result) throws SnmpException, UnknownHostException, IOException, SocketException
Performs a multiple SNMP GetNext starting at variable in the MIB hierachy to the SNMP agent at address. Results are returned in the Vector result, which has elements of arrays of two elements, the first element in the array is a String which has the object name, the second element is a Type object with the value of the variable.

 o setValue
 public boolean setValue(String address,
                         String variable,
                         int instance,
                         String value) throws SnmpException, UnknownHostException, IOException, SocketException
Performs the SNMP Set operation. Set the value of the variable of instance to value at SNMP agent at address A exception is generated when the operation was unsuccessful.

 o main
 public static void main(String args[])
Test Harness


All Packages  Class Hierarchy  This Package  Previous  Next  Index