org.opennms.bb.dp.eventd
Class EventsReader

java.lang.Object
  |
  +--org.opennms.bb.dp.eventd.EventsReader
All Implemented Interfaces:
Runnable

public class EventsReader
extends Object
implements Runnable

EventsReader holds the input stream of events - this stream is then parsed to get the events store that is a list of 'EventBlock's - the EventListener sub-components(TCPHandler, UDPHandler and JSDTHandler) create the EventsReader objects and add them to the listener queue from where the EventListener 'RunnableConsumerThread's thread pool, pick them up and parse the input stream in the object. The parsed objects are then queued to the event expand manager

Version:
$Revision: 1.1 $
Author:
Sowmya Kumaraswamy, Brian Weaver, OpenNMS.org

Field Summary
private static String DEFAULT_EVENT_UEI
          The default event UEI - if the event lookup into the 'event.conf' fails, the event is loaded with information from this default UEI
private static String DEFAULT_TRAP_UEI
          The default trap UEI - if the trap lookup into the 'event.conf' fails, the trap event is loaded with information from this default UEI
private static String ENTERPRISE_PRE
          The enterprise ID prefix - incoming events and the events in event.conf can have EIDs that have the partial EIDs as in '18.1.1.6' instead of '.1.3.6.1.4.1.18.1.1.6'.
private  List m_events
          the events in the input stream
private  EventHeader m_header
          The event stream header
private  InputStream m_input
          The input stream that has the events
 
Constructor Summary
EventsReader(InputStream inpStream)
          Constructs the EventsReader object
 
Method Summary
private static void expand(Event e)
          This method is call to check the event againt the configuration information and make any necessary modifications to the event.
 List getEvents()
          Returns the list of 'EventBlock's in the input stream
 EventHeader getHeader()
           
 void run()
          The EventListener holds a hadhtable of 'EventsParser' objects for each thread in its 'RunnableConsumerThread' thread pool - the 'EventsReader' queries the EventListener for the parser for this thread and uses that to parse the input stream Once the parse is complete, the input stream is closed
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_input

private InputStream m_input
The input stream that has the events

m_header

private EventHeader m_header
The event stream header

m_events

private List m_events
the events in the input stream

ENTERPRISE_PRE

private static final String ENTERPRISE_PRE
The enterprise ID prefix - incoming events and the events in event.conf can have EIDs that have the partial EIDs as in '18.1.1.6' instead of '.1.3.6.1.4.1.18.1.1.6'. When a event lookup is done based on the EID, a lookup with both the partial and the full EID is done

DEFAULT_EVENT_UEI

private static final String DEFAULT_EVENT_UEI
The default event UEI - if the event lookup into the 'event.conf' fails, the event is loaded with information from this default UEI

DEFAULT_TRAP_UEI

private static final String DEFAULT_TRAP_UEI
The default trap UEI - if the trap lookup into the 'event.conf' fails, the trap event is loaded with information from this default UEI
Constructor Detail

EventsReader

public EventsReader(InputStream inpStream)
Constructs the EventsReader object
Parameters:
inpStream - the input stream to be parsed
Method Detail

expand

private static void expand(Event e)

This method is call to check the event againt the configuration information and make any necessary modifications to the event. If the event does not have any particular field that is part of a matching configuration event, then the configuration information is copied to the new event.

Parameters:
e - The event to check/modify

run

public void run()
The EventListener holds a hadhtable of 'EventsParser' objects for
 each thread in its 'RunnableConsumerThread' thread pool - the
 'EventsReader' queries the EventListener for the parser for this
 thread and uses that to parse the input stream

 Once the parse is complete, the input stream is closed
Specified by:
run in interface Runnable

getEvents

public List getEvents()
Returns the list of 'EventBlock's in the input stream
Returns:
the list of 'EventBlock's in the input stream

getHeader

public EventHeader getHeader()