public class Snmp4JStrategy extends Object implements SnmpStrategy
Modifier and Type | Class and Description |
---|---|
static class |
Snmp4JStrategy.RegistrationInfo |
Constructor and Description |
---|
Snmp4JStrategy() |
Modifier and Type | Method and Description |
---|---|
protected SnmpAgentConfig |
buildAgentConfig(String address,
int port,
int timeout,
int retries,
int securityLevel,
String securityName,
String authPassPhrase,
String authProtocol,
String privPassPhrase,
String privProtocol,
org.snmp4j.PDU pdu) |
protected SnmpAgentConfig |
buildAgentConfig(String address,
int port,
int timeout,
int retries,
String community,
org.snmp4j.PDU pdu) |
protected SnmpAgentConfig |
buildAgentConfig(String address,
int port,
int securityLevel,
String securityName,
String authPassPhrase,
String authProtocol,
String privPassPhrase,
String privProtocol,
org.snmp4j.PDU pdu) |
protected SnmpAgentConfig |
buildAgentConfig(String address,
int port,
String community,
org.snmp4j.PDU pdu) |
protected static org.snmp4j.PDU |
buildPdu(Snmp4JAgentConfig agentConfig,
int pduType,
SnmpObjId[] oids,
SnmpValue[] values) |
void |
clearUsers() |
static org.snmp4j.smi.OctetString |
createLocalEngineId() |
static org.snmp4j.smi.OctetString |
createPersistentInstanceId() |
SnmpWalker |
createWalker(SnmpAgentConfig snmpAgentConfig,
String name,
CollectionTracker tracker)
SNMP4J createWalker implementation.
|
SnmpValue |
get(SnmpAgentConfig agentConfig,
SnmpObjId oid)
SNMP4J get helper that takes a single SnmpObjId
and calls get with an array.lenght =1 and returns
the first element of the returned array of SnmpValue.
|
SnmpValue[] |
get(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
SnmpGet implementation.
|
CompletableFuture<SnmpValue[]> |
getAsync(SnmpAgentConfig agentConfig,
SnmpObjId[] oids) |
SnmpValue[] |
getBulk(SnmpAgentConfig agentConfig,
SnmpObjId[] oid)
Not yet implemented.
|
byte[] |
getLocalEngineID() |
SnmpValue |
getNext(SnmpAgentConfig agentConfig,
SnmpObjId oid)
SNMP4J getNext implementation
|
SnmpValue[] |
getNext(SnmpAgentConfig agentConfig,
SnmpObjId[] oids)
SNMP GetNext implementation.
|
SnmpV1TrapBuilder |
getV1TrapBuilder() |
SnmpV2TrapBuilder |
getV2InformBuilder() |
SnmpTrapBuilder |
getV2TrapBuilder() |
SnmpV3TrapBuilder |
getV3InformBuilder() |
SnmpV3TrapBuilder |
getV3TrapBuilder() |
SnmpValueFactory |
getValueFactory() |
static void |
reapSession(org.snmp4j.Snmp session) |
void |
registerForTraps(TrapNotificationListener listener,
InetAddress address,
int snmpTrapPort) |
void |
registerForTraps(TrapNotificationListener listener,
InetAddress address,
int snmpTrapPort,
List<SnmpV3User> snmpUsers) |
void |
registerForTraps(TrapNotificationListener listener,
int snmpTrapPort) |
protected SnmpValue[] |
send(Snmp4JAgentConfig agentConfig,
org.snmp4j.PDU pdu,
boolean expectResponse)
Sends and SNMP4J request PDU.
|
void |
sendTest(String agentAddress,
int port,
String community,
org.snmp4j.PDU pdu) |
SnmpValue[] |
set(SnmpAgentConfig agentConfig,
SnmpObjId[] oids,
SnmpValue[] values) |
SnmpValue |
set(SnmpAgentConfig agentConfig,
SnmpObjId oid,
SnmpValue value) |
static void |
trackSession(org.snmp4j.Snmp session) |
void |
unregisterForTraps(TrapNotificationListener listener,
InetAddress address,
int snmpTrapPort) |
void |
unregisterForTraps(TrapNotificationListener listener,
int snmpTrapPort) |
public void clearUsers()
public SnmpWalker createWalker(SnmpAgentConfig snmpAgentConfig, String name, CollectionTracker tracker)
createWalker
in interface SnmpStrategy
snmpAgentConfig
- name
- tracker
- public SnmpValue[] getBulk(SnmpAgentConfig agentConfig, SnmpObjId[] oid)
getBulk
in interface SnmpStrategy
public SnmpValue set(SnmpAgentConfig agentConfig, SnmpObjId oid, SnmpValue value)
set
in interface SnmpStrategy
public SnmpValue[] set(SnmpAgentConfig agentConfig, SnmpObjId[] oids, SnmpValue[] values)
set
in interface SnmpStrategy
public SnmpValue get(SnmpAgentConfig agentConfig, SnmpObjId oid)
get
in interface SnmpStrategy
agentConfig
- oid
- public SnmpValue[] get(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
get
in interface SnmpStrategy
agentConfig
- oids
- public CompletableFuture<SnmpValue[]> getAsync(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
getAsync
in interface SnmpStrategy
public SnmpValue getNext(SnmpAgentConfig agentConfig, SnmpObjId oid)
getNext
in interface SnmpStrategy
agentConfig
- oid
- public SnmpValue[] getNext(SnmpAgentConfig agentConfig, SnmpObjId[] oids)
getNext
in interface SnmpStrategy
agentConfig
- oids
- protected SnmpValue[] send(Snmp4JAgentConfig agentConfig, org.snmp4j.PDU pdu, boolean expectResponse)
protected static org.snmp4j.PDU buildPdu(Snmp4JAgentConfig agentConfig, int pduType, SnmpObjId[] oids, SnmpValue[] values)
public SnmpValueFactory getValueFactory()
getValueFactory
in interface SnmpStrategy
public void registerForTraps(TrapNotificationListener listener, InetAddress address, int snmpTrapPort, List<SnmpV3User> snmpUsers) throws IOException
registerForTraps
in interface SnmpStrategy
IOException
public void registerForTraps(TrapNotificationListener listener, InetAddress address, int snmpTrapPort) throws IOException
registerForTraps
in interface SnmpStrategy
IOException
public void registerForTraps(TrapNotificationListener listener, int snmpTrapPort) throws IOException
registerForTraps
in interface SnmpStrategy
IOException
public void unregisterForTraps(TrapNotificationListener listener, InetAddress address, int snmpTrapPort) throws IOException
unregisterForTraps
in interface SnmpStrategy
IOException
public void unregisterForTraps(TrapNotificationListener listener, int snmpTrapPort) throws IOException
unregisterForTraps
in interface SnmpStrategy
IOException
public SnmpV1TrapBuilder getV1TrapBuilder()
getV1TrapBuilder
in interface SnmpStrategy
public SnmpTrapBuilder getV2TrapBuilder()
getV2TrapBuilder
in interface SnmpStrategy
public SnmpV3TrapBuilder getV3TrapBuilder()
getV3TrapBuilder
in interface SnmpStrategy
public SnmpV2TrapBuilder getV2InformBuilder()
getV2InformBuilder
in interface SnmpStrategy
public SnmpV3TrapBuilder getV3InformBuilder()
getV3InformBuilder
in interface SnmpStrategy
protected SnmpAgentConfig buildAgentConfig(String address, int port, String community, org.snmp4j.PDU pdu) throws UnknownHostException
UnknownHostException
protected SnmpAgentConfig buildAgentConfig(String address, int port, int timeout, int retries, String community, org.snmp4j.PDU pdu) throws UnknownHostException
UnknownHostException
protected SnmpAgentConfig buildAgentConfig(String address, int port, int securityLevel, String securityName, String authPassPhrase, String authProtocol, String privPassPhrase, String privProtocol, org.snmp4j.PDU pdu) throws UnknownHostException, Exception
UnknownHostException
Exception
protected SnmpAgentConfig buildAgentConfig(String address, int port, int timeout, int retries, int securityLevel, String securityName, String authPassPhrase, String authProtocol, String privPassPhrase, String privProtocol, org.snmp4j.PDU pdu) throws UnknownHostException, Exception
UnknownHostException
Exception
public static org.snmp4j.smi.OctetString createPersistentInstanceId()
public static org.snmp4j.smi.OctetString createLocalEngineId()
public byte[] getLocalEngineID()
getLocalEngineID
in interface SnmpStrategy
public static void trackSession(org.snmp4j.Snmp session)
public static void reapSession(org.snmp4j.Snmp session)
Copyright © 2021. All rights reserved.