public class EventConfData extends Object
The information read from the eventconf.xml is stored here. It maintains a map, keyed with 'EventKey's. It also has an UEI to 'EventKey'list map - this mapping fastens the lookup for OpenNMS internal events when different masks are configured for the same UEI. When a lookup is to be done for an 'Event', - its 'key' is used to get a lookup, - if no match is found for the key, UEI is used to lookup the keys that got added for that UEI and the first best fit in the event map for any of the UEI keys are used - if there is still no match at this point, all keys in the eventconf are iterated through to find a match
Constructor and Description |
---|
EventConfData()
Default constructor - allocate the maps
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear out the data
|
static boolean |
eventValuePassesMaskValue(String eventvalue,
List<String> maskValues)
Check whether the eventvalue passes any of the mask values Mask values
ending with a '%' only need to be a substring of the eventvalue for the
eventvalue to pass the mask
Enhanced 2005/08/31 to allow regular expression in eventconf.
|
Event |
getEvent(Event event)
Get the right configuration for the event - the eventkey is used first.
|
Event |
getEventByUEI(String uei)
Get the event with the specified uei
|
void |
put(Event event)
Add an event - add to the 'EventKey' map using the event mask by default.
|
void |
put(EventKey key,
Event event)
Add an event with the specified key
|
public static boolean eventValuePassesMaskValue(String eventvalue, List<String> maskValues)
public void put(Event event)
event
- the org.opennms.netmgt.xml.eventconf.Eventpublic void put(EventKey key, Event event)
key
- the EventKey for this eventevent
- the org.opennms.netmgt.xml.eventconf.Eventpublic Event getEvent(Event event)
Get the right configuration for the event - the eventkey is used first. If no match is found, the event's uei to keylist is iterated through, and these keys used to lookup the event map. if still no match is found, all eventconf keys are iterated through to find a match. The first successful match is returned. NOTE: The first right config event that the event matches is returned. The ordering of the configurations is the responsibility of the user
event
- the event which is to be looked upEvent
object.public Event getEventByUEI(String uei)
uei
- the ueiEvent
object.public void clear()
Copyright © 2021. All rights reserved.