public class SnmpDriver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SnmpDriver.Match |
Modifier and Type | Field and Description |
---|---|
SnmpRequestListener |
defaultListener
Default listener will save the response and status
|
protected SnmpRequest |
response |
protected boolean |
success |
Constructor and Description |
---|
SnmpDriver()
Default constructor
|
SnmpDriver(int waitTimeout)
Constructor to override default listener timeout.
|
Modifier and Type | Method and Description |
---|---|
SnmpRequest |
createGet(IpAddress ip,
SnmpRequestListener listener) |
SnmpRequest |
createRequest(IpAddress ip,
SnmpRequestListener listener) |
SnmpRequest |
createSet(IpAddress ip,
SnmpRequestListener listener) |
SnmpRequest |
createWalk(IpAddress ip,
SnmpRequestListener listener) |
SnmpRequest |
createWalkByVersion(IpAddress ip,
SnmpRequestListener listener) |
SnmpDriver.Match |
discoverCredentials(IpAddress ip,
KeyService cs,
String description)
Discover the key that best matches the device.
|
void |
execute(SnmpRequest request)
Execute the SNMP request.
|
boolean |
executeAndWait(SnmpRequest request,
SnmpRequestListener listener)
Execute the SNMP request and wait for the response.
|
SnmpResponse |
getResponse() |
SnmpWalkTable |
getWalkTable() |
SnmpKey |
key()
Get the credential UUID that was found to match the device.
|
void |
setKey(SnmpKey key)
Set the SNMP key information for future communication.
|
void |
stopClient()
SNMP client must be explicitly stopped to free resources.
|
boolean |
success() |
SnmpDriver.Match |
testKey(IpAddress ip)
Test the key for match.
|
protected void |
waitOnListener(SnmpRequestListener listener)
Wait for the listener to receive the response
|
protected SnmpRequest response
protected boolean success
public SnmpRequestListener defaultListener
public SnmpDriver(int waitTimeout)
waitTimeout
- timeout for default listenerpublic SnmpDriver()
public SnmpDriver.Match discoverCredentials(IpAddress ip, KeyService cs, String description)
ip
- address of the devicecs
- pointer to access the keysdescription
- optional key namepublic SnmpDriver.Match testKey(IpAddress ip)
ip
- device addresspublic void setKey(SnmpKey key)
key
- container of configuration and credentialspublic SnmpKey key()
public void execute(SnmpRequest request) throws SocketException
request
- contains target, operation type, and pdusSocketException
- error getting the socket to sendpublic boolean executeAndWait(SnmpRequest request, SnmpRequestListener listener)
request
- to sendlistener
- to handle responsepublic void stopClient()
public SnmpRequest createWalkByVersion(IpAddress ip, SnmpRequestListener listener)
public SnmpRequest createWalk(IpAddress ip, SnmpRequestListener listener)
public SnmpRequest createSet(IpAddress ip, SnmpRequestListener listener)
public SnmpRequest createGet(IpAddress ip, SnmpRequestListener listener)
public SnmpRequest createRequest(IpAddress ip, SnmpRequestListener listener)
protected void waitOnListener(SnmpRequestListener listener)
listener
- to waitpublic SnmpResponse getResponse()
public SnmpWalkTable getWalkTable()
public boolean success()
Copyright © 2015. All Rights Reserved.