Module org.snmp4j

Class SnmpBuilder


  • public class SnmpBuilder
    extends java.lang.Object
    Builds a Snmp instance through step-by-step configuration.
    Since:
    3.5.0
    Author:
    Frank Fock
    • Field Detail

      • snmp

        protected final Snmp snmp
      • multiThreadedDispatcherPool

        protected ThreadPool multiThreadedDispatcherPool
      • responderPoolName

        protected java.lang.String responderPoolName
    • Constructor Detail

      • SnmpBuilder

        public SnmpBuilder()
      • SnmpBuilder

        public SnmpBuilder​(Snmp snmp)
    • Method Detail

      • threads

        public SnmpBuilder threads​(int numThreads)
      • usm

        public SnmpBuilder usm​(OctetString localEngineID,
                               int engineBoots)
        Creates a USM for the specified engine ID and engine boots counter.
        Parameters:
        localEngineID - the local engine ID.
        engineBoots - the number of engine boots.
        Returns:
        this builder.
      • tsm

        public SnmpBuilder tsm​(OctetString localEngineID,
                               boolean usePrefix)
        Creates a Transport Security Model as defined by RFC 5591 and adds it to the built Snmp instance.
        Parameters:
        localEngineID - the engine ID of the SNMP entity using this transport security model. The local engine ID must be globally unique.
        usePrefix - the snmpTsmConfigurationUsePrefix flag as defined in RFC 5591.
        Returns:
        this builder.
      • udp

        public SnmpBuilder udp()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • udp

        public SnmpBuilder udp​(UdpAddress... listenAddresses)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • tcp

        public SnmpBuilder tcp()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • tcp

        public SnmpBuilder tcp​(TcpAddress... listenAddresses)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • dtls

        public SnmpBuilder dtls()
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • dtls

        public SnmpBuilder dtls​(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback,
                                java.lang.String[] dtlsProtocolVersions,
                                DtlsAddress... listenAddresses)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • tls

        public SnmpBuilder tls()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • tls

        public SnmpBuilder tls​(TlsTmSecurityCallback<java.security.cert.X509Certificate> securityCallback,
                               java.lang.String[] tlsProtocolVersions,
                               TlsAddress... listenAddresses)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • build

        public Snmp build()
                   throws java.io.IOException
        Throws:
        java.io.IOException