|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.netsnmp.NetSNMPSyncSession
A helper object that implements a synchronous session. This allows users to dispatch and receive pdus on the same thread. NOTE: not recommended for heavy duty work due to the natural asynchronicity of SNMP and network operations in general. This is meant as a convenience object and as a way for entry level personnel to get their 'feet wet'.
NetSNMPSyncSession sess = new NetSNMPSyncSession(host, community) ; ASNValue response = sess.get(new DefaultOID("SNMPv2-MIB::sysDescr.0")) ; System.out.println(response);
Constructor Summary | |
NetSNMPSyncSession()
Construct an unopened session |
|
NetSNMPSyncSession(NetSNMPSession sess)
|
|
NetSNMPSyncSession(String host,
String community)
Construct a new session to the given host and commnunity |
Methods inherited from class java.lang.Object |
clone, equals, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NetSNMPSyncSession()
public NetSNMPSyncSession(String host, String community)
org.netsnmp.NetSNMPSession(String,String)
public NetSNMPSyncSession(NetSNMPSession sess)
Method Detail |
public PDU send(PDU pdu) throws IOException, NetSNMPSendError, InterruptedException
pdu
- Pdu to send to remote agent
IOException
- if an IO error occurs on the connection
NetSNMPSendError
- if an snmp error occurs (such as the pdu being too large)
Interupted
- exception if the thread is interupted while waiting for the result
InterruptedException
public ASNValue set(OID oid, ASNValue v) throws IOException, NetSNMPSendError, InterruptedException
oid
- Object Identifier for the target objectv
- Value to set the target object
IOException
NetSNMPSendError
InterruptedException
public ASNValue get(OID oid) throws IOException, NetSNMPSendError, InterruptedException
oid
- Object Identifier of the desired value
IOException
- if an IO error occurs on the connection
NetSNMPSendError
- if an snmp error occurs (such as the pdu being too large)
Interupted
- exception if the thread is interupted while waiting for the result
InterruptedException
public ASNValue get(String descr) throws MIBItemNotFound, IOException, NetSNMPSendError, InterruptedException
MIBItemNotFound
- if the specified descriptor is not in the currently loaded mibs
IOException
- if an IO error occurs on the connection
NetSNMPSendError
- if an snmp error occurs (such as the pdu being too large)
Interupted
- exception if the thread is interupted while waiting for the result
InterruptedException
protected void finalize() throws Throwable
finalize
in class Object
Throwable
public String getAuthPassword()
public String getCommunity()
public byte[] getContextEngineID()
public String getContextName()
public String getPeerName()
public String getPrivPassword()
public long getRcvMsgMaxSize()
public int getRetries()
public byte[] getSecurityAuthKey()
public OID getSecurityAuthOID()
public byte[] getSecurityEngineID()
public SecurityLevel getSecurityLevel()
public int getSecurityModel()
public String getSecurityName()
public byte[] getSecurityPrivKey()
public OID getSecurityPrivOID()
public long getSndMsgMaxSize()
public SNMPVersion getSnmpVersion()
public long getTimeout()
public SNMPVersion getVersion()
public boolean isOpen()
public void open() throws IllegalStateException
IllegalStateException
public void setAuthenticationProtocol(OID oid)
oid
- public void setAuthPassword(String string)
string
- public void setCommunity(String string)
string
- public void setContextEngineID(byte[] bs)
bs
- public void setContextName(String string)
string
- public void setPeerName(String string)
string
- public void setPrivacyProtocol(OID oid)
oid
- public void setPrivPassword(String string)
string
- public void setRcvMsgMaxSize(long l)
l
- public void setRetries(int i)
i
- public void setSecurityAuthKey(byte[] bs)
bs
- public void setSecurityAuthOID(OID oid)
oid
- public void setSecurityEngineID(byte[] bs)
bs
- public void setSecurityLevel(SecurityLevel level)
level
- public void setSecurityModel(int i)
i
- public void setSecurityName(String string)
string
- public void setSecurityPrivKey(byte[] bs)
bs
- public void setSecurityPrivOID(OID oid)
oid
- public void setSndMsgMaxSize(long l)
l
- public void setSNMPVersion(SNMPVersion version)
version
- public void setTimeout(long l)
l
- public void setSerialEncryptor(NetSNMPSession.serialEncryption encryption)
encryption
- public int hashCode()
hashCode
in class Object
Object.hashCode()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |