java.lang.Object
org.snmp4j.tools.console.SnmpCommand
- All Implemented Interfaces:
Runnable
,EventListener
,CommandResponder
,TransportListener
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
listen()
static void
protected static void
printReport(PDU response)
static void
protected static void
printVariableBindings(PDU response)
protected static void
void
processMessage(TransportMapping<?> sourceTransport, Address destAddress, byte[] message)
<A extends Address>
voidprocessMessage(TransportMapping<? super A> sourceTransport, A incomingAddress, ByteBuffer wholeMessage, TransportStateReference tmStateReference)
Processes an incoming message.<A extends Address>
voidprocessPdu(CommandResponderEvent<A> e)
Process an incoming request, report or notification PDU.void
run()
send()
static String
spaces(int n)
int
table()
-
Field Details
-
operation
protected int operation
-
-
Constructor Details
-
SnmpCommand
- Throws:
IOException
-
-
Method Details
-
help
-
example
-
spaces
-
send
- Throws:
IOException
-
printReport
-
processPdu
Description copied from interface:CommandResponder
Process an incoming request, report or notification PDU.- Specified by:
processPdu
in interfaceCommandResponder
- Type Parameters:
A
- type of the peerAddress
.- Parameters:
e
- aCommandResponderEvent
instance containing the PDU to process and some additional information returned by the message processing model that decoded the SNMP message.
-
printVariableBindings
-
table
- Throws:
IOException
-
listen
- Throws:
IOException
-
main
-
run
public void run() -
printVersion
protected static void printVersion() -
printUsage
- Throws:
IOException
-
processMessage
public <A extends Address> void processMessage(TransportMapping<? super A> sourceTransport, A incomingAddress, ByteBuffer wholeMessage, TransportStateReference tmStateReference)Description copied from interface:TransportListener
Processes an incoming message.- Specified by:
processMessage
in interfaceTransportListener
- 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 message.tmStateReference
- the transport model state reference as defined by RFC 5590.
-
processMessage
public void processMessage(TransportMapping<?> sourceTransport, Address destAddress, byte[] message)
-