java.lang.Runnable
, java.util.EventListener
, CommandResponder
, TransportListener
public class SnmpCommand extends java.lang.Object implements java.lang.Runnable, CommandResponder, TransportListener
Modifier and Type | Class | Description |
---|---|---|
class |
SnmpCommand.SnmpCommandMessageDispatcher |
Modifier and Type | Field | Description |
---|---|---|
protected int |
operation |
Constructor | Description |
---|---|
SnmpCommand(java.lang.String command,
java.util.Map<java.lang.String,java.util.List<?>> args) |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
example(java.lang.String prefix,
java.lang.String command) |
|
java.lang.String |
help(java.lang.String prefix,
java.lang.String command,
boolean listOptionsDetails,
boolean withDescription) |
|
int |
listen() |
|
static void |
main(java.lang.String[] args) |
|
protected static void |
printReport(PDU response) |
|
static void |
printUsage() |
|
protected static void |
printVariableBindings(PDU response) |
|
protected static void |
printVersion() |
|
void |
processMessage(TransportMapping sourceTransport,
Address destAddress,
byte[] message) |
|
void |
processMessage(TransportMapping sourceTransport,
Address incomingAddress,
java.nio.ByteBuffer wholeMessage,
TransportStateReference tmStateReference) |
Processes an incoming message.
|
void |
processPdu(CommandResponderEvent e) |
Process an incoming request, report or notification PDU.
|
void |
run() |
|
PDU |
send() |
|
static java.lang.String |
spaces(int n) |
|
int |
table() |
public SnmpCommand(java.lang.String command, java.util.Map<java.lang.String,java.util.List<?>> args) throws java.io.IOException
java.io.IOException
public java.lang.String help(java.lang.String prefix, java.lang.String command, boolean listOptionsDetails, boolean withDescription)
public java.lang.String example(java.lang.String prefix, java.lang.String command)
public static java.lang.String spaces(int n)
public PDU send() throws java.io.IOException
java.io.IOException
protected static void printReport(PDU response)
public void processPdu(CommandResponderEvent e)
CommandResponder
processPdu
in interface CommandResponder
e
- a CommandResponderEvent
instance containing the PDU to
process and some additional information returned by the message
processing model that decoded the SNMP message.protected static void printVariableBindings(PDU response)
public int table() throws java.io.IOException
java.io.IOException
public int listen() throws java.io.IOException
java.io.IOException
public static void main(java.lang.String[] args)
public void run()
run
in interface java.lang.Runnable
protected static void printVersion()
public static void printUsage() throws java.io.IOException
java.io.IOException
public void processMessage(TransportMapping sourceTransport, Address incomingAddress, java.nio.ByteBuffer wholeMessage, TransportStateReference tmStateReference)
TransportListener
processMessage
in interface TransportListener
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 message.tmStateReference
- the transport model state reference as defined by RFC 5590.public void processMessage(TransportMapping sourceTransport, Address destAddress, byte[] message)
Copyright © 2018 SNMP4J.org. All rights reserved.