org.opennms.bb.eui.operator.utils
Class EventsParser

java.lang.Object
  |
  +--org.opennms.bb.common.utils.BBParser
        |
        +--org.opennms.bb.eui.operator.utils.EventsParser

public class EventsParser
extends BBParser

EventsParser extends the BBParser and parses an input stream 
 to read/interpret an event 

 It throws an IOException if the xml stream does not conform to the event DTD 
 

Author:
Sowmya, OpenNMS.org

Inner classes inherited from class org.opennms.bb.common.utils.BBParser
BBParser.BBErrorHandler
 
Field Summary
private  String ATTRIB_DELIM
          The attribute delimiter.
private  String AUTOACTION
           
private  String CREATED
           
private  String DAY
           
private  String DESCR
           
private  String DPNAME
           
private  String EID
           
private  String EIDTEXT
           
private  String EVENT
           
private  String EVENTS
           
private  String FORWARD
           
private  String FORWARDMECH
           
private  String FORWARDSTATE
           
private  String GENERIC
           
private  String HEADER
          Relevant XML TAGS
private  String HOST
           
private  String HOUR
           
private  String LOGGROUP
           
private  String LOGMSG
           
private  String LOGMSGDEST
           
private  EventHeader m_eventHeader
          Header (stored in each element..
private  Vector m_eventsStore
          The Vector of all events
private  String MIN
           
private  String MONTH
           
private  String MOUSEOVERTEXT
           
private  String MSTATION
           
private  String NOTIFICATION
           
private  String OPERACTION
           
private  String OPERACTIONMENU
           
private  String OPERINSTR
           
private  String PARM
           
private  String PARM_NAME
           
private  String PARM_VALUE
           
private  String PARMS
           
private  String SEC
           
private  String SEVERITY
           
private  String SNMP
           
private  String SNMPHOST
           
private  String SOURCE
           
private  String SPECIFIC
           
private  String TIME
           
private  String TTICKET
           
private  String TTICKETSTATE
           
private  String TYPE
           
private  String UEI
           
private  String VER
           
private  String YEAR
           
 
Fields inherited from class org.opennms.bb.common.utils.BBParser
ATTRIB_VALUE_PAIR_ERR, ATTRIB_VALUE_PAIR_ERR_STR, EXCEPTION, m_curElement, m_errNum, m_exceptionMsg, m_inpSource, m_parser, NULL_VALUE_ERR, NULL_VALUE_ERR_STR
 
Constructor Summary
EventsParser()
          Constructs the DOMParser
 
Method Summary
 Vector getEvents()
          Returns a vector of events in the incoming event stram
protected  boolean processElement(org.w3c.dom.Element el, boolean isRoot)
          Overrides the method in the parent class to handle this XML
protected  boolean processEventNode(org.w3c.dom.Node eventNode)
          Handles the 'event' element - all the relevant information for each event is read, and an 'EventBlock' created - this is then added to the event store
protected  boolean processEventsElement(org.w3c.dom.Node eventsNode)
          Handles the 'events' element
protected  boolean processHeaderNode(org.w3c.dom.Node headerNode)
          Handles the 'header' element - this is added to each event
protected  String processHost(org.w3c.dom.Node hostNode)
          Returns the hostname from the node, the IP Address in the dotted decimal format
protected  Vector processParm(org.w3c.dom.Node parmsNode)
          Handles the 'parm' element in the list of parms
protected  String processParmName(org.w3c.dom.Node parmNameNode)
          Handles the 'parmName' element
protected  Vector processParms(org.w3c.dom.Node parmsNode)
          Handles the 'parms' element for each event
protected  EventSnmpInfo processSnmp(org.w3c.dom.Node snmpNode)
          Handles the 'snmp' element and returns the eid/eidText/specific/generic for this element
protected  boolean processValue(org.w3c.dom.Node parmValNode, Vector parm)
          process the '' element of a 'parm' and returns both the parm value and its type
 
Methods inherited from class org.opennms.bb.common.utils.BBParser
getErrorMessage, getErrorNumber, parse, parse, parse, parse, processDocument, processNode, processParmValue
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_eventsStore

private Vector m_eventsStore
The Vector of all events

m_eventHeader

private EventHeader m_eventHeader
Header (stored in each element.. )

ATTRIB_DELIM

private final String ATTRIB_DELIM
The attribute delimiter. Elements like the 'operatoraction' that has an attribute 'menutext' are stored in a single string in the format

HEADER

private final String HEADER
Relevant XML TAGS

VER

private final String VER

DPNAME

private final String DPNAME

CREATED

private final String CREATED

MSTATION

private final String MSTATION

EVENTS

private final String EVENTS

EVENT

private final String EVENT

UEI

private final String UEI

SOURCE

private final String SOURCE

TIME

private final String TIME

YEAR

private final String YEAR

MONTH

private final String MONTH

DAY

private final String DAY

HOUR

private final String HOUR

MIN

private final String MIN

SEC

private final String SEC

TYPE

private final String TYPE

HOST

private final String HOST

SNMPHOST

private final String SNMPHOST

SNMP

private final String SNMP

EID

private final String EID

EIDTEXT

private final String EIDTEXT

SPECIFIC

private final String SPECIFIC

GENERIC

private final String GENERIC

PARMS

private final String PARMS

PARM

private final String PARM

PARM_NAME

private final String PARM_NAME

PARM_VALUE

private final String PARM_VALUE

DESCR

private final String DESCR

LOGMSG

private final String LOGMSG

LOGMSGDEST

private final String LOGMSGDEST

SEVERITY

private final String SEVERITY

OPERINSTR

private final String OPERINSTR

AUTOACTION

private final String AUTOACTION

OPERACTION

private final String OPERACTION

OPERACTIONMENU

private final String OPERACTIONMENU

LOGGROUP

private final String LOGGROUP

NOTIFICATION

private final String NOTIFICATION

TTICKET

private final String TTICKET

TTICKETSTATE

private final String TTICKETSTATE

FORWARD

private final String FORWARD

FORWARDSTATE

private final String FORWARDSTATE

FORWARDMECH

private final String FORWARDMECH

MOUSEOVERTEXT

private final String MOUSEOVERTEXT
Constructor Detail

EventsParser

public EventsParser()
Constructs the DOMParser
Method Detail

processElement

protected boolean processElement(org.w3c.dom.Element el,
                                 boolean isRoot)
Overrides the method in the parent class to handle this XML
Overrides:
processElement in class BBParser
Following copied from class: org.opennms.bb.common.utils.BBParser
Returns:
true if processed sucessfully, false otherwise

processHeaderNode

protected boolean processHeaderNode(org.w3c.dom.Node headerNode)
Handles the 'header' element - this is added to each event
Returns:
true if parse is successful, false otherwise

processEventsElement

protected boolean processEventsElement(org.w3c.dom.Node eventsNode)
Handles the 'events' element
Returns:
true if parse is successful, false otherwise

processEventNode

protected boolean processEventNode(org.w3c.dom.Node eventNode)
Handles the 'event' element - all the relevant information for each event is read, and an 'EventBlock' created - this is then added to the event store
Returns:
true if parse is successful, false otherwise

processHost

protected String processHost(org.w3c.dom.Node hostNode)
Returns the hostname from the node, the IP Address in the dotted decimal format
Returns:
the hostname as a dotted decimal

processSnmp

protected EventSnmpInfo processSnmp(org.w3c.dom.Node snmpNode)
Handles the 'snmp' element and returns the eid/eidText/specific/generic for this element
Returns:
the SNMP info of the event

processParms

protected Vector processParms(org.w3c.dom.Node parmsNode)
Handles the 'parms' element for each event
Returns:
true if parse is successful, false otherwise

processParm

protected Vector processParm(org.w3c.dom.Node parmsNode)
Handles the 'parm' element in the list of parms
Returns:
a vector containing the parm name and value

processParmName

protected String processParmName(org.w3c.dom.Node parmNameNode)
Handles the 'parmName' element
Returns:
the value for the parmName

processValue

protected boolean processValue(org.w3c.dom.Node parmValNode,
                               Vector parm)
process the '' element of a 'parm' and returns both the parm value and its type

getEvents

public Vector getEvents()
Returns a vector of events in the incoming event stram
Returns:
a vector of events in the incoming event stram