/** * Return the value of an event parameter of null if it does not exist. * * @param e * the Event to get the parameter for * @param parmName * the name of the parameter to retrieve * @return the value of the parameter, or null of the parameter is not set */ public static String getParm(Event e, String parmName) { return EventUtils.getParm(e, parmName, null); }
/** * <p>toString</p> * * @return a {@link java.lang.String} object. */ @Override public String toString() { return EventUtils.toString(m_event); } }
/** {@inheritDoc} */ @Override public boolean equals(final Object o) { if (o == null) return false; if (!(o instanceof EventWrapper)) return false; final EventWrapper w = (EventWrapper) o; return EventUtils.eventsMatch(m_event, w.m_event); }
/** * Makes call to API to close a trouble ticket associated with an OnmsAlarm. * @param e An OpenNMS event. * @throws InsufficientInformationException */ private void handleCloseTicket(Event e) throws InsufficientInformationException { EventUtils.requireParm(e, EventConstants.PARM_ALARM_ID); EventUtils.requireParm(e, EventConstants.PARM_ALARM_UEI); EventUtils.requireParm(e, EventConstants.PARM_USER); EventUtils.requireParm(e, EventConstants.PARM_TROUBLE_TICKET); int alarmId = EventUtils.getIntParm(e, EventConstants.PARM_ALARM_ID, 0); String ticketId = EventUtils.getParm(e, EventConstants.PARM_TROUBLE_TICKET); m_ticketerServiceLayer.closeTicketForAlarm(alarmId, ticketId); }
/** * Process the event, construct a new CollectableService object * representing the node/interface combination, and schedule the interface * for collection. If any errors occur scheduling the interface no error * is returned. * * @param event * The event to process. * @throws InsufficientInformationException */ private void handleNodeGainedService(Event event) throws InsufficientInformationException { EventUtils.checkNodeId(event); EventUtils.checkInterface(event); EventUtils.checkService(event); // Schedule the interface // scheduleForCollection(event); }
/** * Handle a Node Gained Service Event if service is SNMP * * @param event */ @EventHandler(uei=EventConstants.NODE_GAINED_SERVICE_EVENT_UEI) public void handleNodeGainedService(Event event) throws InsufficientInformationException { EventUtils.checkNodeId(event); EventUtils.checkService(event); if (event.getService().equals("SNMP")) m_linkd.scheduleNodeCollection(event.getNodeid().intValue()); }
private Event createNodeCategoryMembershipChangedEvent(final OnmsNode node, String[] categoriesAdded, String[] categoriesDeleted) { return EventUtils.createNodeCategoryMembershipChangedEvent(m_eventSource, node.getId(), node.getLabel(), categoriesAdded, categoriesDeleted); }
EventUtils.checkNodeId(event); EventUtils.checkInterface(event);
EventUtils.checkNodeId(event); if(EventUtils.isNonIpInterface(ipAddr) ) { LOG.debug("handleInterfaceDeleted: the deleted interface was a non-ip interface. Nothing to do here."); return;
/** * This method is responsible for handling nodeDeleted events. * * @param event * The event to process. * @throws InsufficientInformationException */ private void handleNodeDeleted(Event event) throws InsufficientInformationException { EventUtils.checkNodeId(event); Long nodeId = event.getNodeid(); unscheduleNodeAndMarkForDeletion(nodeId); LOG.debug("nodeDeletedHandler: processing of nodeDeleted event for nodeid {} completed.", nodeId); }
/** * Makes call to API to Cancel a Trouble Ticket associated with an OnmsAlarm. * @param e * @throws InsufficientInformationException */ private void handleCancelTicket(Event e) throws InsufficientInformationException { EventUtils.requireParm(e, EventConstants.PARM_ALARM_ID); EventUtils.requireParm(e, EventConstants.PARM_ALARM_UEI); EventUtils.requireParm(e, EventConstants.PARM_USER); EventUtils.requireParm(e, EventConstants.PARM_TROUBLE_TICKET); int alarmId = EventUtils.getIntParm(e, EventConstants.PARM_ALARM_ID, 0); String ticketId = EventUtils.getParm(e, EventConstants.PARM_TROUBLE_TICKET); m_ticketerServiceLayer.cancelTicketForAlarm(alarmId, ticketId); }
EventUtils.checkNodeId(event); EventUtils.checkInterface(event); EventUtils.checkService(event);
/** * Handle a Node Lost Service Event when service lost is SNMP * * @param event */ @EventHandler(uei=EventConstants.NODE_LOST_SERVICE_EVENT_UEI) public void handleNodeLostService(Event event) throws InsufficientInformationException { EventUtils.checkNodeId(event); EventUtils.checkService(event); if (event.getService().equals("SNMP")) m_linkd.suspendNodeCollection(event.getNodeid().intValue()); }
private void notifyCategoryChange(final OnmsNode node, final String[] categoriesAdded, final String[] categoriesDeleted) { send(EventUtils.createNodeCategoryMembershipChangedEvent("CategoryUI", node.getId(), node.getLabel(), categoriesAdded, categoriesDeleted)); }
EventUtils.checkNodeId(event); EventUtils.checkInterface(event);
/** * Handle a Node Deleted Event * * @param event */ @EventHandler(uei=EventConstants.NODE_DELETED_EVENT_UEI) public void handleNodeDeleted(Event event) throws InsufficientInformationException { EventUtils.checkNodeId(event); m_linkd.deleteNode(event.getNodeid().intValue()); }
/** * <p>getEventForeignSource</p> * * @param event a {@link org.opennms.netmgt.xml.event.Event} object. * @return a {@link java.lang.String} object. */ protected String getEventForeignSource(final Event event) { return EventUtils.getParm(event, EventConstants.PARM_FOREIGN_SOURCE); }
/** * Makes call to API to close a trouble ticket associated with an OnmsAlarm. * @param e An OpenNMS event. * @throws InsufficientInformationException */ private void handleCloseTicket(Event e) throws InsufficientInformationException { EventUtils.requireParm(e, EventConstants.PARM_ALARM_ID); EventUtils.requireParm(e, EventConstants.PARM_ALARM_UEI); EventUtils.requireParm(e, EventConstants.PARM_USER); EventUtils.requireParm(e, EventConstants.PARM_TROUBLE_TICKET); int alarmId = EventUtils.getIntParm(e, EventConstants.PARM_ALARM_ID, 0); String ticketId = EventUtils.getParm(e, EventConstants.PARM_TROUBLE_TICKET); m_ticketerServiceLayer.closeTicketForAlarm(alarmId, ticketId); }
/** * <p>toString</p> * * @return a {@link java.lang.String} object. */ @Override public String toString() { return EventUtils.toString(m_event); } }
/** * Handle a Node Regained Service Event where service is SNMP * * @param event */ @EventHandler(uei=EventConstants.NODE_REGAINED_SERVICE_EVENT_UEI) public void handleRegainedService(Event event) throws InsufficientInformationException { EventUtils.checkNodeId(event); EventUtils.checkService(event); if (event.getService().equals("SNMP")) m_linkd.wakeUpNodeCollection(event.getNodeid().intValue()); }