com.h3c.util.snmp

## Class SnmpReceiver

- java.lang.Object
- - com.h3c.util.snmp.SnmpReceiver

- All Implemented Interfaces:
    DatagramEngine.Listener

      public class SnmpReceiver
      extends Object
      implements DatagramEngine.Listener

  The SNMP trap receiver.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `SnmpReceiver.Listener` Provides an interface for the trap receiver.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SnmpReceiver(DatagramEngine datagramEngine, SnmpReceiver.Listener listener)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `onReceive(byte[] payload, InetSocketAddress remoteAddress)` Called back when a new datagram arrives.
    `void` | `stop()` Shutdown the client and underlying engine.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SnmpReceiver

          public SnmpReceiver(DatagramEngine datagramEngine,
                      SnmpReceiver.Listener listener)

      Constructor.
      Parameters:
        `datagramEngine` - datagram engine implementation
        `listener` - receiver listener

  - ### Method Detail

    - #### stop

          public void stop()

      Shutdown the client and underlying engine.

    - #### onReceive

          public void onReceive(byte[] payload,
                       InetSocketAddress remoteAddress)

      Description copied from interface: `DatagramEngine.Listener`
      Called back when a new datagram arrives.
      Specified by:
        `onReceive` in interface `DatagramEngine.Listener`
      Parameters:
        `payload` - received datagram payload
        `remoteAddress` - remote socket address for received payload

Copyright © 2014. All Rights Reserved.