OpenNMS API 1.2.3

org.opennms.netmgt.eventd
Class Eventd

java.lang.Object
  extended byorg.opennms.netmgt.eventd.Eventd
All Implemented Interfaces:
EventHandler, Fiber, PausableFiber

public final class Eventd
extends java.lang.Object
implements PausableFiber, 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 java.lang.String LOG4J_CATEGORY
          The log4j category used to log debug messsages and statements.
private  java.lang.String m_address
           Contains dotted-decimal representation of the IP address where Eventd is running.
private static java.util.Map m_serviceTableMap
          The service table map
private static Eventd m_singleton
          Singleton instance of this class
private  int m_status
          The current status of this fiber
private  EventReceiver m_tcpReceiver
          The handler for events coming in through TCP
private  EventReceiver m_udpReceiver
          The handler for events coming in through UDP
 
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(java.lang.String svcname, int serviceid)
          Add the svcname/svcid mapping to the servicetable map
static Eventd getInstance()
           
 java.lang.String getLocalHostAddress()
          Used to retrieve the local host address.
 java.lang.String getName()
          Returns a name/id for this process
static int getServiceID(java.lang.String svcname)
          Return the service id for the name passed
 int getStatus()
          Returns the current status
 void init()
           
 void pause()
          Pauses all the threads
 boolean processEvent(Event event)
           
 void receiptSent(EventReceipt event)
           
 void resume()
          Resumes all the threads
 void start()
          Read the eventd configuration xml, create and start all the subthreads
 void stop()
          Stops all the eventd threads
 
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 java.lang.String LOG4J_CATEGORY
The log4j category used to log debug messsages and statements.

See Also:
Constant Field Values

m_singleton

private static final Eventd m_singleton
Singleton instance of this class


m_serviceTableMap

private static java.util.Map m_serviceTableMap
The service table map


m_tcpReceiver

private EventReceiver m_tcpReceiver
The handler for events coming in through TCP


m_udpReceiver

private EventReceiver m_udpReceiver
The handler for events coming in through UDP


m_address

private java.lang.String m_address

Contains dotted-decimal representation of the IP address where Eventd is running. Used when eventd sends events out


m_status

private int m_status
The current status of this fiber

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

stop

public void stop()
Stops all the eventd threads

Specified by:
stop in interface Fiber

getName

public java.lang.String getName()
Returns a name/id for this process

Specified by:
getName in interface Fiber
Returns:
The name of the Fiber.

getStatus

public int getStatus()
Returns the current status

Specified by:
getStatus in interface Fiber
Returns:
The current status of the Fiber.

init

public void init()

start

public void start()
Read the eventd configuration xml, create and start all the subthreads

Specified by:
start in interface Fiber

pause

public void pause()
Pauses all the threads

Specified by:
pause in interface PausableFiber

resume

public void resume()
Resumes all the threads

Specified by:
resume in interface PausableFiber

getLocalHostAddress

public java.lang.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(java.lang.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(java.lang.String svcname,
                                     int serviceid)
Add the svcname/svcid mapping to the servicetable map


getInstance

public static Eventd getInstance()

processEvent

public boolean processEvent(Event event)
Specified by:
processEvent in interface EventHandler

receiptSent

public void receiptSent(EventReceipt event)
Specified by:
receiptSent in interface EventHandler

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.