org.opennms.netmgt.eventd.processor
Class EventExpander

java.lang.Object
  extended by org.opennms.netmgt.eventd.processor.EventExpander
All Implemented Interfaces:
EventProcessor, org.springframework.beans.factory.InitializingBean

public final class EventExpander
extends Object
implements EventProcessor, org.springframework.beans.factory.InitializingBean

This class is responsible for looking up the matching evenconf entry for an event and loading info from the eventconf match to the event. This class is also responsible for the event parm expansion

Notes on event parm expansion:

The list of elements that can have a %element% or %parms[*]% in their value are : descr, logmsg, operinstr, autoaction, operaction(/menu), tticket

The list of elements that can occur as a %element% are : uei, source, nodeid, time, host, interface, snmphost, service, snmp, id, idtext, version, specific, generic, community, severity, operinstr, mouseovertext, parm[values-all], parm[names-all], parm[all], parm[ ], parm[##], parm[# ]


  Expansions are made so that
  - %element% is replaced by the value of the element
    -i.e a 'xxx %uei%'  would expand to 'xxx <eventuei>'
  - %parm[values-all]% is replaced by a space-separated list of all parm values
    -i.e a 'xxx %parm[values-all]%'  would expand to 'xxx parmVal1 parmVal2 ..'
  - %parm[names-all]% is replaced by a space-separated list of all parm names
    -i.e a 'xxx %parm[names-all]%'  would expand to 'xxx parmName1 parmName2 ..'
  - %parm[all]% is replaced by a space-separated list of all parmName="parmValue"
     -i.e a 'xxx %parm[all]%'  would expand to 'xxx parmName1="parmVal1" parmName2="parmVal2" ..'
  - %parm[<name>]% is replaced by the value of the parameter named 'name', if present
  - %parm[#<num>]% is replaced by the value of the parameter number 'num', if present
  - %parm[##]% is replaced by the number of parameters

 

Version:
$Id: $
Author:
Brian Weaver , Sowmya Nataraj , OpenNMS , Brian Weaver , Sowmya Nataraj , OpenNMS , Brian Weaver , Sowmya Nataraj , OpenNMS

Constructor Summary
EventExpander()
          The default trap UEI - if the trap lookup into the 'event.conf' fails, the trap event is loaded with information from this default UEI
 
Method Summary
 void afterPropertiesSet()
          afterPropertiesSet
 void expandEvent(Event e)
           This method is invoked to check and configure a received event.
 EventConfDao getEventConfDao()
          getEventConfDao
 void process(Header eventHeader, Event event)
          process
 void setEventConfDao(EventConfDao eventConfDao)
          setEventConfDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventExpander

public EventExpander()
The default trap UEI - if the trap lookup into the 'event.conf' fails, the trap event is loaded with information from this default UEI

Method Detail

afterPropertiesSet

public void afterPropertiesSet()

afterPropertiesSet

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

expandEvent

public void expandEvent(Event e)

This method is invoked to check and configure a received event. The event configuration manager is consulted to find the appropriate configuration that is used to expand the event. In addition, the security parameters from the configuration manager is consulted to ensure that secure files are cleared out if necessary.

Any secure fields that exists in the incomming event are cleared during expansion.

Parameters:
e - The event to expand if necesary.

process

public void process(Header eventHeader,
                    Event event)

process

Specified by:
process in interface EventProcessor
Parameters:
eventHeader - a Header object.
event - a Event object.

getEventConfDao

public EventConfDao getEventConfDao()

getEventConfDao

Returns:
a EventConfDao object.

setEventConfDao

public void setEventConfDao(EventConfDao eventConfDao)

setEventConfDao

Parameters:
eventConfDao - a EventConfDao object.


Copyright © 2011. All Rights Reserved.