Module org.snmp4j

Class SnmpConfigurator


  • public class SnmpConfigurator
    extends java.lang.Object
    The SnmpConfigurator class configures a Snmp instance with settings taken from a Map conforming to the format returned by ArgumentParser.parse(String[] args). In addition, a PDUFactory and Target can be created using settings from a Map too.
    Since:
    1.10
    Version:
    3.0
    Author:
    Frank Fock
    • Constructor Detail

      • SnmpConfigurator

        public SnmpConfigurator()
      • SnmpConfigurator

        public SnmpConfigurator​(java.util.Properties props)
      • SnmpConfigurator

        public SnmpConfigurator​(boolean commandResponder)
      • SnmpConfigurator

        public SnmpConfigurator​(java.util.Properties props,
                                boolean commandResponder)
    • Method Detail

      • isCommandResponder

        public boolean isCommandResponder()
      • setCommandResponder

        public void setCommandResponder​(boolean commandResponder)
      • configure

        public void configure​(Snmp snmp,
                              java.util.Map<java.lang.String,java.util.List<java.lang.Object>> settings)
      • configure

        public void configure​(Session snmp,
                              USM usm,
                              MessageDispatcher messageDispatcher,
                              java.util.Map<java.lang.String,java.util.List<java.lang.Object>> settings)
      • getPrivProtocolOid

        public static OID getPrivProtocolOid​(java.lang.String privP)
      • getAuthProtocolOid

        public static OID getAuthProtocolOid​(java.lang.String authP)
      • getPDUFactory

        public PDUFactory getPDUFactory​(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> settings)
      • getTarget

        public Target<? super Address> getTarget​(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> settings)
      • getBindAddress

        public Address getBindAddress​(java.util.Map<java.lang.String,java.util.List<java.lang.Object>> settings)
      • createOctetString

        public static OctetString createOctetString​(java.lang.String s,
                                                    java.lang.String defaultString)
        Create an OctetString from a String value.
        Parameters:
        s - the string value to convert. If it starts with 0x its trailing value will be interpreted as a hex string with colon (:) separator.
        defaultString - an optional default if s is null.
        Returns:
        an OctetString or null if s is null.
        Since:
        1.10.2