org.opennms.netmgt.eventd
Class Eventd

java.lang.Object
  extended by org.opennms.netmgt.daemon.AbstractServiceDaemon
      extended by org.opennms.netmgt.eventd.Eventd
All Implemented Interfaces:
org.opennms.core.fiber.Fiber, org.opennms.core.fiber.PausableFiber, SpringServiceDaemon, EventHandler, org.opennms.netmgt.model.ServiceDaemon, org.springframework.beans.factory.InitializingBean

public final class Eventd
extends AbstractServiceDaemon
implements EventHandler

Eventd listens for events from the discovery, capsd, trapd processes and sends events to the Master Station when queried for.

Eventd receives events sent in as XML, looks up the event.conf and adds information to these events and stores them to the db. It also reconverts them back to XML to be sent to other processes like 'actiond'

Process like trapd, capsd etc. that are local to the distributed poller send events to the eventd. Events can also be sent via TCP or UDP to eventd.

Eventd listens for incoming events, loads info from the 'event.conf', adds events to the database and sends the events added to the database to subscribed listeners. It also maintains a servicename to serviceid mapping from the services table so as to prevent a database lookup for each incoming event

The number of threads that processes events is configurable via the eventd configuration xml

Author:
Sowmya Nataraj , OpenNMS.org

Field Summary
static String LOG4J_CATEGORY
          The log4j category used to log debug messsages and statements.
 
Fields inherited from interface org.opennms.core.fiber.PausableFiber
PAUSE_PENDING, PAUSED, RESUME_PENDING
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
Eventd()
          Constuctor creates the localhost address(to be used eventually when eventd originates events during correlation) and the broadcast queue
 
Method Summary
static void addServiceMapping(String svcname, int serviceid)
          Add the svcname/svcid mapping to the servicetable map
 org.opennms.netmgt.dao.EventDao getEventDao()
           
 EventIpcManager getEventIpcManager()
           
static Eventd getInstance()
           
 String getLocalHostAddress()
          Used to retrieve the local host address.
static int getServiceID(String svcname)
          Return the service id for the name passed
protected  void onInit()
           
protected  void onStart()
           
protected  void onStop()
           
 boolean processEvent(org.opennms.netmgt.xml.event.Event event)
           
 void receiptSent(org.opennms.netmgt.xml.event.EventReceipt event)
           
 void setConfigManager(EventdConfigManager configManager)
           
 void setDataSource(DataSource dataSource)
           
 void setEventDao(org.opennms.netmgt.dao.EventDao dao)
           
 void setEventIpcManager(EventIpcManager manager)
           
 
Methods inherited from class org.opennms.netmgt.daemon.AbstractServiceDaemon
afterPropertiesSet, getName, getStatus, getStatusText, init, isPaused, isRunning, isStarting, isStartPending, log, onPause, onResume, pause, resume, setStatus, start, status, stop, waitForStatus, waitForStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CATEGORY

public static final String LOG4J_CATEGORY
The log4j category used to log debug messsages and statements.

See Also:
Constant Field Values
Constructor Detail

Eventd

public Eventd()
Constuctor creates the localhost address(to be used eventually when eventd originates events during correlation) and the broadcast queue

Method Detail

onStop

protected void onStop()
Overrides:
onStop in class AbstractServiceDaemon

onInit

protected void onInit()
Specified by:
onInit in class AbstractServiceDaemon

onStart

protected void onStart()
Overrides:
onStart in class AbstractServiceDaemon

getLocalHostAddress

public String getLocalHostAddress()
Used to retrieve the local host address. The address of the machine on which Eventd is running.

Returns:
The local machines hostname.

getServiceID

public static int getServiceID(String svcname)
Return the service id for the name passed

Parameters:
svcname - the service name whose service id is required
Returns:
the service id for the name passed, -1 if not found

addServiceMapping

public static void addServiceMapping(String svcname,
                                     int serviceid)
Add the svcname/svcid mapping to the servicetable map


getInstance

public static Eventd getInstance()

processEvent

public boolean processEvent(org.opennms.netmgt.xml.event.Event event)
Specified by:
processEvent in interface EventHandler

receiptSent

public void receiptSent(org.opennms.netmgt.xml.event.EventReceipt event)
Specified by:
receiptSent in interface EventHandler

setDataSource

public void setDataSource(DataSource dataSource)

setConfigManager

public void setConfigManager(EventdConfigManager configManager)

getEventIpcManager

public EventIpcManager getEventIpcManager()

setEventIpcManager

public void setEventIpcManager(EventIpcManager manager)

setEventDao

public void setEventDao(org.opennms.netmgt.dao.EventDao dao)

getEventDao

public org.opennms.netmgt.dao.EventDao getEventDao()


Copyright ? 2007. All Rights Reserved.