Add support for prioritizing the event definitions

Description

With the introduction of https://opennms.atlassian.net/browse/HZN-1418#icft=HZN-1418, it is now possible for event configurations to be added dynamically by extensions via the OSGi registry.

As currently defined, the definitions coming from the OSGi registry take precedence over those specified in $OPENNMS_HOME.

It should be possible to sort all of the event definitions, regardless of their source based on some notion of priority.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

David Smith December 19, 2018 at 3:15 PM

For testing purposes, I created a project with two features with overlapping event definitions.
It can be found here: https://github.com/smith-opennms/opennms-dev/tree/master/test-features

Once building locally, you can add the artifact repo and install the test features:
feature:repo-add mvn:org.opennms.integration.test/feature/1.0.0-SNAPSHOT/xml
feature:install opennms-event-config-test1
feature:install opennms-event-config-test2

David Smith December 18, 2018 at 9:14 PM

Jesse White October 18, 2018 at 1:51 PM

One way to achieve this would be to add a "priority" attribute to the "event" definitions that defaults to some value if not set - say 100.

After being loaded, events would be sorted by priority in descending fashion (higher priorities come first). If events have the same priority, then they continue to be processed in the same order in which they were defined.

Fixed

Details

Assignee

Reporter

Labels

Sprint

Fix versions

Priority

PagerDuty

Created October 18, 2018 at 1:48 PM
Updated June 3, 2019 at 7:23 AM
Resolved December 21, 2018 at 1:00 AM