Module org.snmp4j

Class AbstractTransportMapping<A extends Address>

    • Field Detail

      • maxInboundMessageSize

        protected int maxInboundMessageSize
      • asyncMsgProcessingSupported

        protected boolean asyncMsgProcessingSupported
    • Constructor Detail

      • AbstractTransportMapping

        public AbstractTransportMapping()
    • Method Detail

      • sendMessage

        public abstract void sendMessage​(A address,
                                         byte[] message,
                                         TransportStateReference tmStateReference,
                                         long timeoutMillis,
                                         int maxRetries)
                                  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 Address>
        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).
        maxRetries - maximum retries during connection creation.
        Throws:
        java.io.IOException - if any underlying IO operation fails.
      • addTransportListener

        public void addTransportListener​(TransportListener l)
        Description copied from interface: TransportMapping
        Adds a transport listener to the transport. Normally, at least one transport listener needs to be added to process incoming messages.
        Specified by:
        addTransportListener in interface TransportMapping<A extends Address>
        Parameters:
        l - a TransportListener instance.
      • fireProcessMessage

        protected void fireProcessMessage​(A address,
                                          java.nio.ByteBuffer buf,
                                          TransportStateReference tmStateReference)
      • close

        public abstract 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 Address>
        Throws:
        java.io.IOException - if any IO operation for the close fails.
      • getMaxInboundMessageSize

        public int getMaxInboundMessageSize()
        Description copied from interface: TransportMapping
        Gets the maximum length of an incoming message that can be successfully processed by this transport mapping implementation.
        Specified by:
        getMaxInboundMessageSize in interface TransportMapping<A extends Address>
        Returns:
        an integer > 484.