use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class TicketNotificationStrategyTest method testCreateTicket.
public void testCreateTicket() {
// Setup the event anticipator
EventBuilder newSuspectBuilder = new EventBuilder(EventConstants.TROUBLETICKET_CREATE_UEI, m_ticketNotificationStrategy.getName());
newSuspectBuilder.setParam(EventConstants.PARM_ALARM_ID, "1");
newSuspectBuilder.setParam(EventConstants.PARM_ALARM_UEI, EventConstants.NODE_DOWN_EVENT_UEI);
newSuspectBuilder.setParam(EventConstants.PARM_USER, "admin");
m_eventIpcManager.getEventAnticipator().anticipateEvent(newSuspectBuilder.getEvent());
m_ticketNotificationStrategy.setAlarmState(new TicketNotificationStrategy.AlarmState(1));
m_ticketNotificationStrategy.setAlarmType(AlarmType.PROBLEM);
List<Argument> arguments = buildArguments("1", EventConstants.NODE_DOWN_EVENT_UEI);
assertEquals(0, m_ticketNotificationStrategy.send(arguments));
assertTrue("Expected events not forthcoming", m_eventIpcManager.getEventAnticipator().waitForAnticipated(0).isEmpty());
assertEquals("Received unexpected events", 0, m_eventIpcManager.getEventAnticipator().getUnanticipatedEvents().size());
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class ReverseDnsProvisioningAdapter method buildEvent.
private EventBuilder buildEvent(String uei, int nodeId) {
EventBuilder builder = new EventBuilder(uei, "Provisioner", new Date());
builder.setNodeid(nodeId);
return builder;
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class NodeDiscovery method sendCompletedEvent.
protected void sendCompletedEvent(int nodeid) {
EventBuilder builder = new EventBuilder("uei.opennms.org/internal/linkd/nodeLinkDiscoveryCompleted", "EnhancedLinkd");
builder.setNodeid(getNodeId());
builder.setInterface(getPrimaryIpAddress());
builder.addParam("runnable", getName());
m_linkd.getEventForwarder().sendNow(builder.getEvent());
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class NodeDiscovery method sendStartEvent.
protected void sendStartEvent(int nodeid) {
EventBuilder builder = new EventBuilder("uei.opennms.org/internal/linkd/nodeLinkDiscoveryStarted", "EnhancedLinkd");
builder.setNodeid(getNodeId());
builder.setInterface(getPrimaryIpAddress());
builder.addParam("runnable", getName());
m_linkd.getEventForwarder().sendNow(builder.getEvent());
}
use of org.opennms.netmgt.model.events.EventBuilder in project opennms by OpenNMS.
the class NodeDiscovery method sendSuspendedEvent.
protected void sendSuspendedEvent(int nodeid) {
EventBuilder builder = new EventBuilder("uei.opennms.org/internal/linkd/nodeLinkDiscoverySuspended", "EnhancedLinkd");
builder.setNodeid(getNodeId());
builder.setInterface(getPrimaryIpAddress());
builder.addParam("runnable", getName());
m_linkd.getEventForwarder().sendNow(builder.getEvent());
}
Aggregations