com.jpragma.snmp
Class SnmpClient
java.lang.Object
com.jpragma.snmp.SnmpClient
public class SnmpClient
- extends java.lang.Object
Retrieves information from agent using SNMPv1 protocol as defined in RFC 1157.
- Author:
- Isaac Levin
Constructor Summary |
SnmpClient()
Default constructor. |
SnmpClient(java.lang.String agentAddress,
int agentPort,
int timeout,
java.lang.String readCommunity,
java.lang.String writeCommunity)
|
SnmpClient(java.lang.String agentAddress,
int agentPort,
java.lang.String readCommunity,
java.lang.String writeCommunity)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SnmpClient
public SnmpClient()
- Default constructor. Client will send all requests to localhost:161,
default timeout is 10 seconds
SnmpClient
public SnmpClient(java.lang.String agentAddress,
int agentPort,
int timeout,
java.lang.String readCommunity,
java.lang.String writeCommunity)
SnmpClient
public SnmpClient(java.lang.String agentAddress,
int agentPort,
java.lang.String readCommunity,
java.lang.String writeCommunity)
getAgentAddress
public java.lang.String getAgentAddress()
setAgentAddress
public void setAgentAddress(java.lang.String agentAddress)
getAgentPort
public int getAgentPort()
setAgentPort
public void setAgentPort(int agentPort)
getTimeout
public int getTimeout()
setTimeout
public void setTimeout(int timeout)
getReadOnlyCommunity
public java.lang.String getReadOnlyCommunity()
setReadOnlyCommunity
public void setReadOnlyCommunity(java.lang.String readOnlyCommunity)
getReadWriteCommunity
public java.lang.String getReadWriteCommunity()
setReadWriteCommunity
public void setReadWriteCommunity(java.lang.String readWriteCommunity)
snmpget
public Message snmpget(java.lang.String oid)
throws java.net.SocketTimeoutException
- Throws:
java.net.SocketTimeoutException
snmpgetnext
public Message snmpgetnext(java.lang.String oid)
throws java.net.SocketTimeoutException
- Throws:
java.net.SocketTimeoutException
snmpset
public Message snmpset(java.lang.String oid,
AsnObject value)
throws java.net.SocketTimeoutException
- Throws:
java.net.SocketTimeoutException