- 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 Summary
Constructors Constructor Description SnmpCommandMessageDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends Address>
voidprocessMessage(TransportMapping<? super A> sourceTransport, A incomingAddress, java.nio.ByteBuffer wholeMessage, TransportStateReference tmStateReference)
Process an incoming SNMP message.protected <A extends Address>
voidsendMessage(TransportMapping<? super A> transport, A destAddress, byte[] message, TransportStateReference tmStateReference, long timeoutMillis, int maxRetries)
Sends a message using theTransportMapping
that has been assigned for the supplied address type.-
Methods inherited from class org.snmp4j.MessageDispatcherImpl
addAuthenticationFailureListener, addCommandResponder, addCounterListener, addMessageProcessingModel, addTransportMapping, checkOutgoingMsg, configureAuthoritativeEngineID, createPduHandle, dispatchMessage, fireAuthenticationFailure, fireIncrementCounter, fireProcessPdu, getMessageProcessingModel, getNextRequestID, getTransport, getTransport, getTransportMappings, isCheckOutgoingMsg, processMessage, releaseStateReference, removeAuthenticationFailureListener, removeCommandResponder, removeCounterListener, removeMessageProcessingModel, removeTransportMapping, returnResponsePdu, sendPdu, sendPdu, sendPdu, setCheckOutgoingMsg
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.snmp4j.MessageDispatcher
stop
-
-
-
-
Method Detail
-
processMessage
public <A extends Address> void processMessage(TransportMapping<? super A> sourceTransport, A incomingAddress, java.nio.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 interfaceMessageDispatcher
- Specified by:
processMessage
in interfaceTransportListener
- Overrides:
processMessage
in classMessageDispatcherImpl
- Type Parameters:
A
- theAddress
type.- Parameters:
sourceTransport
- aTransportMapping
instance denoting the transport that received the message and that will be used to send any responses to this message. ThesourceTransport
has to support theincomingAddress
's implementation class.incomingAddress
- theAddress
from which the message has been received.wholeMessage
- anByteBuffer
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 java.io.IOException
Description copied from class:MessageDispatcherImpl
Sends a message using theTransportMapping
that has been assigned for the supplied address type.- Overrides:
sendMessage
in classMessageDispatcherImpl
- Type Parameters:
A
- anAddress
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. ThedestAddress
must be compatible with the suppliedtransport
.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:
java.io.IOException
- if an I/O error occurred while sending the message or if there is no transport mapping defined for the supplied address type.
-
-