Module org.snmp4j

Class DummyTransport.DummyTransportResponder

    • Constructor Detail

      • DummyTransportResponder

        public DummyTransportResponder()
    • Method Detail

      • getListenAddress

        public A getListenAddress()
        Description copied from interface: TransportMapping
        Returns the address that represents the actual incoming address this transport mapping uses to listen for incoming packets.
        Returns:
        the address for incoming packets or null this transport mapping is not configured to listen for incoming packets.
      • sendMessage

        public void sendMessage​(A address,
                                byte[] message,
                                TransportStateReference tmStateReference,
                                long timeoutMillis,
                                int retries)
                         throws java.io.IOException
        Description copied from interface: TransportMapping
        Sends a message to the supplied address using this transport.
        Specified by:
        sendMessage in interface TransportMapping<A extends IpAddress>
        Specified by:
        sendMessage in class AbstractTransportMapping<A extends IpAddress>
        Parameters:
        address - an Address instance denoting the target address.
        message - the whole message as an array of bytes.
        tmStateReference - the (optional) transport model state reference as defined by RFC 5590 section 6.1.
        timeoutMillis - maximum number of milli seconds the connection creation might take (if connection based).
        retries - maximum retries during connection creation.
        Throws:
        java.io.IOException - if any underlying IO operation fails.
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: TransportMapping
        Closes the transport an releases all bound resources synchronously.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface TransportMapping<A extends IpAddress>
        Specified by:
        close in class AbstractTransportMapping<A extends IpAddress>
        Throws:
        java.io.IOException - if any IO operation for the close fails.
      • isListening

        public boolean isListening()
        Description copied from interface: TransportMapping
        Returns true if the transport mapping is listening for incoming messages. For connection oriented transport mappings this is a prerequisite to be able to send SNMP messages. For connectionless transport mappings it is a prerequisite to be able to receive responses.
        Returns:
        true if this transport mapping is listening for messages.