Module org.snmp4j

Class SnmpCommand

    • Field Detail

      • operation

        protected int operation
    • Constructor Detail

      • SnmpCommand

        public SnmpCommand​(java.lang.String command,
                           java.util.Map<java.lang.String,java.util.List<java.lang.Object>> args)
                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • help

        public java.lang.String help​(java.lang.String prefix,
                                     java.lang.String command,
                                     boolean listOptionsDetails,
                                     boolean withDescription)
      • example

        public java.lang.String example​(java.lang.String prefix,
                                        java.lang.String command)
      • spaces

        public static java.lang.String spaces​(int n)
      • send

        public PDU send()
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • printReport

        protected static void printReport​(PDU response)
      • processPdu

        public <A extends Address> void processPdu​(CommandResponderEvent<A> e)
        Description copied from interface: CommandResponder
        Process an incoming request, report or notification PDU.
        Specified by:
        processPdu in interface CommandResponder
        Type Parameters:
        A - type of the peer Address.
        Parameters:
        e - a CommandResponderEvent instance containing the PDU to process and some additional information returned by the message processing model that decoded the SNMP message.
      • printVariableBindings

        protected static void printVariableBindings​(PDU response)
      • table

        public int table()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • listen

        public int listen()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • printVersion

        protected static void printVersion()
      • printUsage

        public static void printUsage()
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • processMessage

        public <A extends Address> void processMessage​(TransportMapping<? super A> sourceTransport,
                                                       A incomingAddress,
                                                       java.nio.ByteBuffer wholeMessage,
                                                       TransportStateReference tmStateReference)
        Description copied from interface: TransportListener
        Processes an incoming message.
        Specified by:
        processMessage in interface TransportListener
        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 message.
        tmStateReference - the transport model state reference as defined by RFC 5590.
      • processMessage

        public void processMessage​(TransportMapping<?> sourceTransport,
                                   Address destAddress,
                                   byte[] message)