Class RawPduReceivedSupport

java.lang.Object
uk.co.westhawk.snmp.event.RawPduReceivedSupport

public class RawPduReceivedSupport extends Object
This is a utility class that can be used by classes that support raw pdu listener functionality. You can use an instance of this class as a member field of your class and delegate various work to it.
Since:
4_14
Version:
$Revision: 1.5 $ $Date: 2006/02/09 14:30:18 $
Author:
Birgit Arkesteijn
  • Field Details

  • Constructor Details

    • RawPduReceivedSupport

      public RawPduReceivedSupport(Object src)
      The constructor.
      Parameters:
      src - The source (ListeningContext) of the pdu events when they are fired.
  • Method Details

    • empty

      public void empty()
      Removes all the listeners.
    • getListenerCount

      public int getListenerCount()
      Returns the number of listeners.
      Returns:
      The number of listeners.
    • addRawPduListener

      public void addRawPduListener(RawPduListener listener)
      Adds the specified pdu listener to receive pdus.
    • removeRawPduListener

      public void removeRawPduListener(RawPduListener listener)
      Removes the specified pdu listener.
    • fireRawPduReceived

      public boolean fireRawPduReceived(int version, String hostAddress, int hostPort, byte[] message)
      Fires an undecoded pdu event. The event is fired to all listeners, unless one of them consumes it. The idea is that for undecoded pdus it is very unlikely that more than one party (usually SnmpContext objects) is interested.
      Parameters:
      version - The SNMP version of the pdu
      hostAddress - The IP address of the host where the pdu came from
      hostPort - The remote port number of the host where the pdu came from
      message - The pdu in bytes
      Returns:
      Whether or not the event has been consumed.