- java.lang.Object
-
- org.snmp4j.util.SnmpConfigurator
-
public class SnmpConfigurator extends Object
TheSnmpConfigurator
class configures aSnmp
instance with settings taken from aMap
conforming to the format returned byArgumentParser.parse(String[] args)
. In addition, aPDUFactory
andTarget
can be created using settings from aMap
too.- Since:
- 1.10
- Version:
- 3.0
- Author:
- Frank Fock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SnmpConfigurator.InnerPDUFactory
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SnmpConfigurator()
SnmpConfigurator(boolean commandResponder)
SnmpConfigurator(Properties props)
SnmpConfigurator(Properties props, boolean commandResponder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Session snmp, USM usm, MessageDispatcher messageDispatcher, Map<String,List<Object>> settings)
void
configure(Snmp snmp, Map<String,List<Object>> settings)
static OctetString
createOctetString(String s, String defaultString)
Create an OctetString from a String value.static OID
getAuthProtocolOid(String authP)
Address
getBindAddress(Map<String,List<Object>> settings)
PDUFactory
getPDUFactory(Map<String,List<Object>> settings)
static OID
getPrivProtocolOid(String privP)
Target<? super Address>
getTarget(Map<String,List<Object>> settings)
boolean
isCommandResponder()
void
setCommandResponder(boolean commandResponder)
-
-
-
Field Detail
-
O_VERSION
public static final String O_VERSION
- See Also:
- Constant Field Values
-
P_VERSION
public static final String P_VERSION
- See Also:
- Constant Field Values
-
F_VERSION
public static final String F_VERSION
- See Also:
- Constant Field Values
-
O_LOCAL_ENGINE_ID
public static final String O_LOCAL_ENGINE_ID
- See Also:
- Constant Field Values
-
P_LOCAL_ENGINE_ID
public static final String P_LOCAL_ENGINE_ID
- See Also:
- Constant Field Values
-
F_LOCAL_ENGINE_ID
public static final String F_LOCAL_ENGINE_ID
- See Also:
- Constant Field Values
-
O_AUTHORITATIVE_ENGINE_ID
public static final String O_AUTHORITATIVE_ENGINE_ID
- See Also:
- Constant Field Values
-
P_AUTHORITATIVE_ENGINE_ID
public static final String P_AUTHORITATIVE_ENGINE_ID
- See Also:
- Constant Field Values
-
F_AUTHORITATIVE_ENGINE_ID
public static final String F_AUTHORITATIVE_ENGINE_ID
- See Also:
- Constant Field Values
-
O_COMMUNITY
public static final String O_COMMUNITY
- See Also:
- Constant Field Values
-
P_COMMUNITY
public static final String P_COMMUNITY
- See Also:
- Constant Field Values
-
F_COMMUNITY
public static final String F_COMMUNITY
- See Also:
- Constant Field Values
-
O_CONTEXT_NAME
public static final String O_CONTEXT_NAME
- See Also:
- Constant Field Values
-
P_CONTEXT_NAME
public static final String P_CONTEXT_NAME
- See Also:
- Constant Field Values
-
F_CONTEXT_NAME
public static final String F_CONTEXT_NAME
- See Also:
- Constant Field Values
-
O_CONTEXT_ENGINE_ID
public static final String O_CONTEXT_ENGINE_ID
- See Also:
- Constant Field Values
-
P_CONTEXT_ENGINE_ID
public static final String P_CONTEXT_ENGINE_ID
- See Also:
- Constant Field Values
-
F_CONTEXT_ENGINE_ID
public static final String F_CONTEXT_ENGINE_ID
- See Also:
- Constant Field Values
-
O_SECURITY_NAME
public static final String O_SECURITY_NAME
- See Also:
- Constant Field Values
-
P_SECURITY_NAME
public static final String P_SECURITY_NAME
- See Also:
- Constant Field Values
-
F_SECURITY_NAME
public static final String F_SECURITY_NAME
- See Also:
- Constant Field Values
-
O_RETRIES
public static final String O_RETRIES
- See Also:
- Constant Field Values
-
P_RETRIES
public static final String P_RETRIES
- See Also:
- Constant Field Values
-
F_RETRIES
public static final String F_RETRIES
- See Also:
- Constant Field Values
-
O_TIMEOUT
public static final String O_TIMEOUT
- See Also:
- Constant Field Values
-
P_TIMEOUT
public static final String P_TIMEOUT
- See Also:
- Constant Field Values
-
F_TIMEOUT
public static final String F_TIMEOUT
- See Also:
- Constant Field Values
-
O_ADDRESS
public static final String O_ADDRESS
- See Also:
- Constant Field Values
-
P_ADDRESS
public static final String P_ADDRESS
- See Also:
- Constant Field Values
-
F_ADDRESS
public static final String F_ADDRESS
- See Also:
- Constant Field Values
-
O_BIND_ADDRESS
public static final String O_BIND_ADDRESS
- See Also:
- Constant Field Values
-
P_BIND_ADDRESS
public static final String P_BIND_ADDRESS
- See Also:
- Constant Field Values
-
F_BIND_ADDRESS
public static final String F_BIND_ADDRESS
- See Also:
- Constant Field Values
-
O_AUTH_PASSPHRASE
public static final String O_AUTH_PASSPHRASE
- See Also:
- Constant Field Values
-
P_AUTH_PASSPHRASE
public static final String P_AUTH_PASSPHRASE
- See Also:
- Constant Field Values
-
F_AUTH_PASSPHRASE
public static final String F_AUTH_PASSPHRASE
- See Also:
- Constant Field Values
-
O_PRIV_PASSPHRASE
public static final String O_PRIV_PASSPHRASE
- See Also:
- Constant Field Values
-
P_PRIV_PASSPHRASE
public static final String P_PRIV_PASSPHRASE
- See Also:
- Constant Field Values
-
F_PRIV_PASSPHRASE
public static final String F_PRIV_PASSPHRASE
- See Also:
- Constant Field Values
-
O_AUTH_PROTOCOL
public static final String O_AUTH_PROTOCOL
- See Also:
- Constant Field Values
-
P_AUTH_PROTOCOL
public static final String P_AUTH_PROTOCOL
- See Also:
- Constant Field Values
-
F_AUTH_PROTOCOL
public static final String F_AUTH_PROTOCOL
- See Also:
- Constant Field Values
-
O_PRIV_PROTOCOL
public static final String O_PRIV_PROTOCOL
- See Also:
- Constant Field Values
-
P_PRIV_PROTOCOL
public static final String P_PRIV_PROTOCOL
- See Also:
- Constant Field Values
-
F_PRIV_PROTOCOL
public static final String F_PRIV_PROTOCOL
- See Also:
- Constant Field Values
-
O_OPERATION
public static final String O_OPERATION
- See Also:
- Constant Field Values
-
P_OPERATION
public static final String P_OPERATION
- See Also:
- Constant Field Values
-
F_OPERATION
public static final String F_OPERATION
- See Also:
- Constant Field Values
-
O_MAX_REPETITIONS
public static final String O_MAX_REPETITIONS
- See Also:
- Constant Field Values
-
P_MAX_REPETITIONS
public static final String P_MAX_REPETITIONS
- See Also:
- Constant Field Values
-
F_MAX_REPETITIONS
public static final String F_MAX_REPETITIONS
- See Also:
- Constant Field Values
-
O_NON_REPEATERS
public static final String O_NON_REPEATERS
- See Also:
- Constant Field Values
-
P_NON_REPEATERS
public static final String P_NON_REPEATERS
- See Also:
- Constant Field Values
-
F_NON_REPEATERS
public static final String F_NON_REPEATERS
- See Also:
- Constant Field Values
-
O_TRAPV1_AGENT_ADDR
public static final String O_TRAPV1_AGENT_ADDR
- See Also:
- Constant Field Values
-
P_TRAPV1_AGENT_ADDR
public static final String P_TRAPV1_AGENT_ADDR
- See Also:
- Constant Field Values
-
F_TRAPV1_AGENT_ADDR
public static final String F_TRAPV1_AGENT_ADDR
- See Also:
- Constant Field Values
-
O_TRAP_OID
public static final String O_TRAP_OID
- See Also:
- Constant Field Values
-
P_TRAP_OID
public static final String P_TRAP_OID
- See Also:
- Constant Field Values
-
F_TRAP_OID
public static final String F_TRAP_OID
- See Also:
- Constant Field Values
-
O_TRAP_UPTIME
public static final String O_TRAP_UPTIME
- See Also:
- Constant Field Values
-
P_TRAP_UPTIME
public static final String P_TRAP_UPTIME
- See Also:
- Constant Field Values
-
F_TRAP_UPTIME
public static final String F_TRAP_UPTIME
- See Also:
- Constant Field Values
-
O_TRAPV1_ENTERPRISE
public static final String O_TRAPV1_ENTERPRISE
- See Also:
- Constant Field Values
-
P_TRAPV1_ENTERPRISE
public static final String P_TRAPV1_ENTERPRISE
- See Also:
- Constant Field Values
-
F_TRAPV1_ENTERPRISE
public static final String F_TRAPV1_ENTERPRISE
- See Also:
- Constant Field Values
-
O_TRAPV1_SPECIFIC_ID
public static final String O_TRAPV1_SPECIFIC_ID
- See Also:
- Constant Field Values
-
P_TRAPV1_SPECIFIC_ID
public static final String P_TRAPV1_SPECIFIC_ID
- See Also:
- Constant Field Values
-
F_TRAPV1_SPECIFIC_ID
public static final String F_TRAPV1_SPECIFIC_ID
- See Also:
- Constant Field Values
-
O_TRAPV1_GENERIC_ID
public static final String O_TRAPV1_GENERIC_ID
- See Also:
- Constant Field Values
-
P_TRAPV1_GENERIC_ID
public static final String P_TRAPV1_GENERIC_ID
- See Also:
- Constant Field Values
-
F_TRAPV1_GENERIC_ID
public static final String F_TRAPV1_GENERIC_ID
- See Also:
- Constant Field Values
-
O_BOOT_COUNTER
public static final String O_BOOT_COUNTER
- See Also:
- Constant Field Values
-
P_BOOT_COUNTER
public static final String P_BOOT_COUNTER
- See Also:
- Constant Field Values
-
F_BOOT_COUNTER
public static final String F_BOOT_COUNTER
- See Also:
- Constant Field Values
-
O_SEC_LEVEL
public static final String O_SEC_LEVEL
- See Also:
- Constant Field Values
-
P_SEC_LEVEL
public static final String P_SEC_LEVEL
- See Also:
- Constant Field Values
-
F_SEC_LEVEL
public static final String F_SEC_LEVEL
- See Also:
- Constant Field Values
-
O_SEC_MODEL
public static final String O_SEC_MODEL
- See Also:
- Constant Field Values
-
P_SEC_MODEL
public static final String P_SEC_MODEL
- See Also:
- Constant Field Values
-
F_SEC_MODEL
public static final String F_SEC_MODEL
- See Also:
- Constant Field Values
-
O_TLS_LOCAL_ID
public static final String O_TLS_LOCAL_ID
- See Also:
- Constant Field Values
-
P_TLS_LOCAL_ID
public static final String P_TLS_LOCAL_ID
- See Also:
- Constant Field Values
-
F_TLS_LOCAL_ID
public static final String F_TLS_LOCAL_ID
- See Also:
- Constant Field Values
-
O_TLS_PEER_ID
public static final String O_TLS_PEER_ID
- See Also:
- Constant Field Values
-
P_TLS_PEER_ID
public static final String P_TLS_PEER_ID
- See Also:
- Constant Field Values
-
F_TLS_PEER_ID
public static final String F_TLS_PEER_ID
- See Also:
- Constant Field Values
-
O_TLS_CERT_FINGERPRINT
public static final String O_TLS_CERT_FINGERPRINT
- See Also:
- Constant Field Values
-
P_TLS_CERT_FINGERPRINT
public static final String P_TLS_CERT_FINGERPRINT
- See Also:
- Constant Field Values
-
F_TLS_CERT_FINGERPRINT
public static final String F_TLS_CERT_FINGERPRINT
- See Also:
- Constant Field Values
-
O_TLS_TRUST_CA
public static final String O_TLS_TRUST_CA
- See Also:
- Constant Field Values
-
P_TLS_TRUST_CA
public static final String P_TLS_TRUST_CA
- See Also:
- Constant Field Values
-
F_TLS_TRUST_CA
public static final String F_TLS_TRUST_CA
- See Also:
- Constant Field Values
-
O_TLS_VERSION
public static final String O_TLS_VERSION
- See Also:
- Constant Field Values
-
P_TLS_VERSION
public static final String P_TLS_VERSION
- See Also:
- Constant Field Values
-
F_TLS_VERSION
public static final String F_TLS_VERSION
- See Also:
- Constant Field Values
-
O_DTLS_VERSION
public static final String O_DTLS_VERSION
- See Also:
- Constant Field Values
-
P_DTLS_VERSION
public static final String P_DTLS_VERSION
- See Also:
- Constant Field Values
-
F_DTLS_VERSION
public static final String F_DTLS_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SnmpConfigurator
public SnmpConfigurator()
-
SnmpConfigurator
public SnmpConfigurator(Properties props)
-
SnmpConfigurator
public SnmpConfigurator(boolean commandResponder)
-
SnmpConfigurator
public SnmpConfigurator(Properties props, boolean commandResponder)
-
-
Method Detail
-
isCommandResponder
public boolean isCommandResponder()
-
setCommandResponder
public void setCommandResponder(boolean commandResponder)
-
configure
public void configure(Session snmp, USM usm, MessageDispatcher messageDispatcher, Map<String,List<Object>> settings)
-
getPDUFactory
public PDUFactory getPDUFactory(Map<String,List<Object>> settings)
-
createOctetString
public static OctetString createOctetString(String s, String defaultString)
Create an OctetString from a String value.- Parameters:
s
- the string value to convert. If it starts with0x
its trailing value will be interpreted as a hex string with colon (:) separator.defaultString
- an optional default ifs
isnull
.- Returns:
- an OctetString or
null
ifs
isnull
. - Since:
- 1.10.2
-
-