|
OpenNMS API 1.1.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opennms.netmgt.eventd.adaptors.udp.UdpEventReceiver
This class implements the User Datagram Protocol (UDP) event receiver. When the an agent sends an event via UDP/IP the receiver will process the event and then add the UUIDs to the internal list. If the event is successfully processed then an event-receipt is returned to the caller.
| Field Summary | |
private int |
m_dgPort
The UDP socket port binding. |
private java.net.DatagramSocket |
m_dgSock
The UDP socket for receipt and transmission of packets from agents. |
private java.util.List |
m_eventsIn
The list of incomming events. |
private java.util.List |
m_eventUuidsOut
The list of outgoing event-receipts by UUID. |
private java.util.List |
m_handlers
The list of registered event handlers. |
private java.lang.String |
m_logPrefix
The log prefix |
private UdpUuidSender |
m_output
The event receipt generator and sender thread. |
private UdpProcessor |
m_processor
The user datagram packet processor |
private UdpReceiver |
m_receiver
The UDP receiver thread. |
private int |
m_status
The Fiber's status. |
private static int |
UDP_PORT
The default User Datagram Port for the receipt and transmission of events. |
| Fields inherited from interface org.opennms.core.fiber.Fiber |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
| Constructor Summary | |
UdpEventReceiver()
|
|
UdpEventReceiver(int port)
|
|
| Method Summary | |
void |
addEventHandler(EventHandler handler)
Adds a new event handler to receiver. |
void |
addEventHandler(java.lang.String name)
|
void |
destroy()
This method is used to stop a currently running Fiber. |
java.lang.String |
getName()
This method is used to return the name of the Fiber. |
java.lang.Integer |
getPort()
|
int |
getStatus()
This method is used to get the current status of the Fiber. |
void |
init()
This method is used to start the initilization process of the Fiber, which should eventually transition
to a RUNNING status. |
void |
removeEventHandler(EventHandler handler)
Removes an event handler from the list of handler called when an event is received. |
void |
removeEventHandler(java.lang.String name)
|
void |
setLogPrefix(java.lang.String prefix)
|
void |
setPort(java.lang.Integer port)
|
void |
start()
This method is used to start the initilization process of the Fiber, which should eventually transition
to a RUNNING status. |
void |
stop()
This method is used to stop a currently running Fiber. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final int UDP_PORT
private UdpReceiver m_receiver
private UdpProcessor m_processor
private UdpUuidSender m_output
private java.util.List m_eventsIn
private java.util.List m_eventUuidsOut
private java.util.List m_handlers
private volatile int m_status
private java.net.DatagramSocket m_dgSock
private int m_dgPort
private java.lang.String m_logPrefix
| Constructor Detail |
public UdpEventReceiver()
public UdpEventReceiver(int port)
| Method Detail |
public void start()
FiberFiber, which should eventually transition
to a RUNNING status.
start in interface Fiberpublic void stop()
FiberFiber.
Once invoked the Fiber should begin it's shutdown
process. Depending on the implementation, this method may block
until the Fiber terminates.
stop in interface Fiberpublic java.lang.String getName()
FiberFiber.
The name of the instance is defined by the implementor, but it
should be realitively unique when possible.
getName in interface FiberFiber.public int getStatus()
FiberFiber.
The status of the fiber should be one of the predefined constants
of the Fiber interface, or from one of the derived
interfaces.
getStatus in interface FiberFiber.public void init()
InitializableFiberFiber, which should eventually transition
to a RUNNING status.
init in interface InitializableFiberpublic void destroy()
InitializableFiberFiber.
Once invoked the Fiber should begin it's shutdown
process. Depending on the implementation, this method may block
until the Fiber terminates.
destroy in interface InitializableFiberpublic void setPort(java.lang.Integer port)
setPort in interface UdpEventReceiverMBeanpublic java.lang.Integer getPort()
getPort in interface UdpEventReceiverMBeanpublic void addEventHandler(EventHandler handler)
addEventHandler in interface EventReceiverhandler - A reference to an event handlerpublic void removeEventHandler(EventHandler handler)
equals()
inherieted from the Object class.
removeEventHandler in interface EventReceiverhandler - A reference to the event handler.
public void addEventHandler(java.lang.String name)
throws javax.management.MalformedObjectNameException,
javax.management.InstanceNotFoundException
addEventHandler in interface UdpEventReceiverMBeanjavax.management.MalformedObjectNameException
javax.management.InstanceNotFoundException
public void removeEventHandler(java.lang.String name)
throws javax.management.MalformedObjectNameException,
javax.management.InstanceNotFoundException
removeEventHandler in interface UdpEventReceiverMBeanjavax.management.MalformedObjectNameException
javax.management.InstanceNotFoundExceptionpublic void setLogPrefix(java.lang.String prefix)
setLogPrefix in interface UdpEventReceiverMBean
|
OpenNMS API 1.1.4 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||