Search in sources :

Example 56 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class ComponentEventQueue method getEvent.

private Event getEvent(final String uei, final ComponentIdentifier id) {
    final EventBuilder builder = new EventBuilder(uei, "NCSComponentService");
    builder.addParam("componentId", id.getId());
    builder.addParam("componentType", id.getType());
    builder.addParam("componentName", id.getName());
    builder.addParam("componentForeignSource", id.getForeignSource());
    builder.addParam("componentForeignId", id.getForeignId());
    builder.addParam("dependencyRequirements", id.getDependencyRequirements().toString());
    final Event event = builder.getEvent();
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Example 57 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class ImpactProgagationRulesIT method createMplsLspPathDownEvent.

@SuppressWarnings("unused")
private Event createMplsLspPathDownEvent(int dbId, int nodeid, String ipaddr, String lspname) {
    Event event = new EventBuilder("uei.opennms.org/vendor/Juniper/traps/mplsLspPathDown", "Test").setNodeid(nodeid).setInterface(addr(ipaddr)).addParam("mplsLspName", lspname).getEvent();
    event.setDbid(dbId);
    return event;
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Event(org.opennms.netmgt.xml.event.Event)

Example 58 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class NCSRestServiceIT method anticipateEvent.

private void anticipateEvent(final String uei, final String[] componentInfo) {
    final EventBuilder builder = new EventBuilder(uei, "NCSComponentService");
    builder.addParam("componentType", componentInfo[0]);
    builder.addParam("componentName", componentInfo[1]);
    builder.addParam("componentForeignSource", componentInfo[2]);
    builder.addParam("componentForeignId", componentInfo[3]);
    m_eventAnticipator.anticipateEvent(builder.getEvent());
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder)

Example 59 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class NotificationManagerIT method doTestNodeInterfaceServiceWithRule.

private void doTestNodeInterfaceServiceWithRule(String description, int nodeId, String intf, String svc, String rule, boolean matches) {
    Notification notif = new Notification();
    notif.setName("a notification");
    notif.setRule(rule);
    EventBuilder builder = new EventBuilder("uei.opennms.org/doNotCareAboutTheUei", "Test.Event");
    builder.setNodeid(nodeId);
    builder.setInterface(addr(intf));
    builder.setService(svc);
    assertEquals(description, matches, m_notificationManager.nodeInterfaceServiceValid(notif, builder.getEvent()));
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder) Notification(org.opennms.netmgt.config.notifications.Notification)

Example 60 with EventBuilder

use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.

the class BusinessServiceManagerImpl method triggerDaemonReload.

@Override
public void triggerDaemonReload() {
    EventBuilder eventBuilder = new EventBuilder(EventConstants.RELOAD_DAEMON_CONFIG_UEI, "BSM Master Page");
    eventBuilder.addParam(EventConstants.PARM_DAEMON_NAME, "bsmd");
    eventForwarder.sendNow(eventBuilder.getEvent());
}
Also used : EventBuilder(org.opennms.netmgt.model.events.EventBuilder)

Aggregations

EventBuilder (org.opennms.netmgt.model.events.EventBuilder)305 Test (org.junit.Test)88 Event (org.opennms.netmgt.xml.event.Event)84 Date (java.util.Date)22 OnmsNode (org.opennms.netmgt.model.OnmsNode)17 InetAddress (java.net.InetAddress)16 EventProxyException (org.opennms.netmgt.events.api.EventProxyException)15 AlarmData (org.opennms.netmgt.xml.event.AlarmData)14 EventAnticipator (org.opennms.netmgt.dao.mock.EventAnticipator)12 ServletException (javax.servlet.ServletException)9 EventHandler (org.opennms.netmgt.events.api.annotations.EventHandler)9 Parm (org.opennms.netmgt.xml.event.Parm)9 Event (org.opennms.netmgt.xml.eventconf.Event)9 File (java.io.File)8 ArrayList (java.util.ArrayList)8 JUnitTemporaryDatabase (org.opennms.core.test.db.annotations.JUnitTemporaryDatabase)7 OnmsAlarm (org.opennms.netmgt.model.OnmsAlarm)7 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)7 SyntaxToEvent (org.opennms.netmgt.model.events.snmp.SyntaxToEvent)7 Transactional (org.springframework.transaction.annotation.Transactional)6