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
-
Snmp()
- Creation of client, default size of cache of 5.
-
Snmp(short)
- Creation of client
-
dumpMib()
-
Dump out MIB for debugging
-
get(String, String, int)
- SNMP Get Operation.
-
getNext(String, String, int, StringBuffer)
- SNMP GetNext Operation.
-
getNext(String, String, StringBuffer)
- SNMP GetNext Operation.
-
main(String[])
- Test Harness
-
readFile(String)
- Read the SNMP objects from this file into memory.
-
readMibFile(String)
- Read the SNMP objects from this file into memory.
-
setCommunityName(String)
- Set the community name that is going to be used.
-
setTimeOut(int)
- Set timeout for SNMP response to seconds.
-
setValue(String, String, int, String)
- Performs the SNMP Set operation.
-
walk(String, String, Vector)
- Performs a multiple SNMP GetNext starting at variable
in the MIB hierachy to the SNMP agent at address.
Snmp
public Snmp(short cacheSize)
- Creation of client
- Parameters:
- eter - cacheSize - sets the size of the cache of
connections to multiple machines.
Snmp
public Snmp()
- Creation of client, default size of cache of 5.
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.
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.
setCommunityName
public void setCommunityName(String name)
- Set the community name that is going to be used.
setTimeOut
public void setTimeOut(int seconds)
- Set timeout for SNMP response to seconds.
dumpMib
public void dumpMib()
- Dump out MIB for debugging
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.
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.
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
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.
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.
main
public static void main(String args[])
- Test Harness
All Packages Class Hierarchy This Package Previous Next Index