Module org.snmp4j

Class SnmpCommand.SnmpCommandMessageDispatcher

java.lang.Object
org.snmp4j.MessageDispatcherImpl
org.snmp4j.tools.console.SnmpCommand.SnmpCommandMessageDispatcher
All Implemented Interfaces:
MessageDispatcher, TransportListener
Enclosing class:
SnmpCommand

public class SnmpCommand.SnmpCommandMessageDispatcher extends MessageDispatcherImpl
  • Constructor Details

    • SnmpCommandMessageDispatcher

      public SnmpCommandMessageDispatcher()
  • Method Details

    • processMessage

      public <A extends Address> void processMessage(TransportMapping<? super A> sourceTransport, A incomingAddress, ByteBuffer wholeMessage, TransportStateReference tmStateReference)
      Description copied from interface: MessageDispatcher
      Process an incoming SNMP message. The message is processed and dispatched according to the message's content, the message processing models, and the command responder available to the dispatcher.
      Specified by:
      processMessage in interface MessageDispatcher
      Specified by:
      processMessage in interface TransportListener
      Overrides:
      processMessage in class MessageDispatcherImpl
      Type Parameters:
      A - the Address type.
      Parameters:
      sourceTransport - a TransportMapping instance denoting the transport that received the message and that will be used to send any responses to this message. The sourceTransport has to support the incomingAddress's implementation class.
      incomingAddress - the Address from which the message has been received.
      wholeMessage - an ByteBuffer containing the received SNMP message.
      tmStateReference - the transport model state reference as defined by RFC 5590.
    • sendMessage

      protected <A extends Address> void sendMessage(TransportMapping<? super A> transport, A destAddress, byte[] message, TransportStateReference tmStateReference, long timeoutMillis, int maxRetries) throws IOException
      Description copied from class: MessageDispatcherImpl
      Sends a message using the TransportMapping that has been assigned for the supplied address type.
      Overrides:
      sendMessage in class MessageDispatcherImpl
      Type Parameters:
      A - an Address class that is the super class for the addresses supported by this transport mapping.
      Parameters:
      transport - the transport mapping to be used to send the message.
      destAddress - the transport address where to send the message. The destAddress must be compatible with the supplied transport.
      message - the SNMP message to send.
      tmStateReference - the transport state reference that holds transport state information for this message.
      timeoutMillis - maximum number of milli seconds the connection creation might take (if connection based).
      maxRetries - maximum retries during connection creation.
      Throws:
      IOException - if an I/O error occurred while sending the message or if there is no transport mapping defined for the supplied address type.