/** * setMonitoredService * * @param monitoredService a {@link org.opennms.netmgt.model.OnmsMonitoredService} object. * @return a {@link org.opennms.netmgt.model.events.EventBuilder} object. */ public EventBuilder setMonitoredService(final OnmsMonitoredService monitoredService) { if (monitoredService != null) { m_event.setNodeid(monitoredService.getNodeId().longValue()); m_event.setInterfaceAddress(monitoredService.getIpAddress()); m_event.setService(monitoredService.getServiceName()); } return this; }
/** * setIpInterface * * @param iface a {@link org.opennms.netmgt.model.OnmsIpInterface} object. * @return a {@link org.opennms.netmgt.model.events.EventBuilder} object. */ public EventBuilder setIpInterface(final OnmsIpInterface iface) { if (iface != null) { if (iface.getNode() != null) { m_event.setNodeid(iface.getNode().getId().longValue()); } m_event.setInterfaceAddress(iface.getIpAddress()); } return this; }
private void completeEventListAndAddToEvents( Events events, List<Event> eventList, LatencyInterface latIface) throws ThresholdingException { for (Event event : eventList) { event.setNodeid((long) latIface.getNodeId()); event.setInterfaceAddress(latIface.getInetAddress()); event.setService(latIface.getServiceName()); events.addEvent(event); } }
/** * setNode * * @param node a {@link org.opennms.netmgt.model.OnmsNode} object. * @return a {@link org.opennms.netmgt.model.events.EventBuilder} object. */ public EventBuilder setNode(final OnmsNode node) { if (node != null) { m_event.setNodeid(node.getId().longValue()); } return this; }
/** * setNodeid * * @param nodeid a long. * @return a {@link org.opennms.netmgt.model.events.EventBuilder} object. */ public EventBuilder setNodeid(long nodeid) { m_event.setNodeid(nodeid); return this; }