Package uk.co.westhawk.snmp.event
Class RawPduReceivedSupport
java.lang.Object
uk.co.westhawk.snmp.event.RawPduReceivedSupport
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRawPduListener
(RawPduListener listener) Adds the specified pdu listener to receive pdus.void
empty()
Removes all the listeners.boolean
fireRawPduReceived
(int version, String hostAddress, int hostPort, byte[] message) Fires an undecoded pdu event.int
Returns the number of listeners.void
removeRawPduListener
(RawPduListener listener) Removes the specified pdu listener.
-
Field Details
-
version_id
- See Also:
-
-
Constructor Details
-
RawPduReceivedSupport
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
Adds the specified pdu listener to receive pdus. -
removeRawPduListener
Removes the specified pdu listener. -
fireRawPduReceived
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 pduhostAddress
- The IP address of the host where the pdu came fromhostPort
- The remote port number of the host where the pdu came frommessage
- The pdu in bytes- Returns:
- Whether or not the event has been consumed.
-