org.opennms.netmgt.eventd.adaptors.udp
Class UdpEventReceiver

java.lang.Object
  extended by org.opennms.netmgt.eventd.adaptors.udp.UdpEventReceiver
All Implemented Interfaces:
Fiber, InitializableFiber, EventReceiver, UdpEventReceiverMBean

public final class UdpEventReceiver
extends Object
implements EventReceiver, UdpEventReceiverMBean

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.

Author:
Brian Weaver , Oculan Corporation

Field Summary
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
UdpEventReceiver()
           
UdpEventReceiver(int port, String ipAddress)
           
 
Method Summary
 void addEventHandler(EventHandler handler)
          Adds a new event handler to receiver.
 void addEventHandler(String name)
           
 void destroy()
           
 List<EventHandler> getEventHandlers()
           
 String getIpAddress()
           
 String getName()
           
 Integer getPort()
           
 int getStatus()
           
 void init()
           
 void removeEventHandler(EventHandler handler)
          Removes an event handler from the list of handler called when an event is received.
 void removeEventHandler(String name)
           
 void setEventHandlers(List<EventHandler> eventHandlers)
           
 void setIpAddress(String ipAddress)
           
 void setLogPrefix(String prefix)
           
 void setPort(Integer port)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UdpEventReceiver

public UdpEventReceiver()

UdpEventReceiver

public UdpEventReceiver(int port,
                        String ipAddress)
Method Detail

start

public void start()
Specified by:
start in interface Fiber
Specified by:
start in interface UdpEventReceiverMBean

stop

public void stop()
Specified by:
stop in interface Fiber
Specified by:
stop in interface UdpEventReceiverMBean

getName

public String getName()
Specified by:
getName in interface Fiber

getStatus

public int getStatus()
Specified by:
getStatus in interface Fiber
Specified by:
getStatus in interface UdpEventReceiverMBean

init

public void init()
Specified by:
init in interface InitializableFiber
Specified by:
init in interface UdpEventReceiverMBean

destroy

public void destroy()
Specified by:
destroy in interface InitializableFiber
Specified by:
destroy in interface UdpEventReceiverMBean

getIpAddress

public String getIpAddress()

setIpAddress

public void setIpAddress(String ipAddress)

setPort

public void setPort(Integer port)
Specified by:
setPort in interface UdpEventReceiverMBean

getPort

public Integer getPort()
Specified by:
getPort in interface UdpEventReceiverMBean

addEventHandler

public void addEventHandler(EventHandler handler)
Adds a new event handler to receiver. When new events are received the decoded event is passed to the handler.

Specified by:
addEventHandler in interface EventReceiver
Parameters:
handler - A reference to an event handler

removeEventHandler

public void removeEventHandler(EventHandler handler)
Removes an event handler from the list of handler called when an event is received. The handler is removed based upon the method equals() inherieted from the Object class.

Specified by:
removeEventHandler in interface EventReceiver
Parameters:
handler - A reference to the event handler.

getEventHandlers

public List<EventHandler> getEventHandlers()

setEventHandlers

public void setEventHandlers(List<EventHandler> eventHandlers)

addEventHandler

public void addEventHandler(String name)
                     throws MalformedObjectNameException,
                            InstanceNotFoundException
Specified by:
addEventHandler in interface UdpEventReceiverMBean
Throws:
MalformedObjectNameException
InstanceNotFoundException

removeEventHandler

public void removeEventHandler(String name)
                        throws MalformedObjectNameException,
                               InstanceNotFoundException
Specified by:
removeEventHandler in interface UdpEventReceiverMBean
Throws:
MalformedObjectNameException
InstanceNotFoundException

setLogPrefix

public void setLogPrefix(String prefix)
Specified by:
setLogPrefix in interface UdpEventReceiverMBean


Copyright © 2009. All Rights Reserved.