/** {@inheritDoc} */ @Override public void updateResolvedOutageWithEventId(int outageId, int regainedEventId) { LOG.info("updating resolved outage {} with event id {}", outageId, regainedEventId); final OnmsEvent event = m_eventDao.get(regainedEventId); final OnmsOutage outage = m_outageDao.get(outageId); if (outage == null) { LOG.warn("Failed to update outage {} with event id {}. The outage no longer exists.", outageId, regainedEventId); return; } // Update the outage outage.setServiceRegainedEvent(event); m_outageDao.saveOrUpdate(outage); }
/** {@inheritDoc} */ @Override public void updateOpenOutageWithEventId(int outageId, int lostEventId) { LOG.info("updating open outage {} with event id {}", outageId, lostEventId); final OnmsEvent event = m_eventDao.get(lostEventId); final OnmsOutage outage = m_outageDao.get(outageId); if (outage == null) { LOG.warn("Failed to update outage {} with event id {}. The outage no longer exists.", outageId, lostEventId); return; } // Update the outage outage.setServiceLostEvent(event); m_outageDao.saveOrUpdate(outage); }
/** {@inheritDoc} */ @Override public Integer resolveOutagePendingRegainEventId(int nodeId, String ipAddr, String svcName, Date regainedTime) { LOG.info("resolving outage for {}:{}:{} @ {}", nodeId, ipAddr, svcName, regainedTime); final OnmsMonitoredService service = m_monitoredServiceDao.get(nodeId, InetAddressUtils.addr(ipAddr), svcName); if (service == null) { LOG.warn("Failed to resolve the pending outage for {}:{}:{} @ {}. The service could not be found.", nodeId, ipAddr, svcName, regainedTime); return null; } final OnmsOutage outage = m_outageDao.currentOutageForService(service); if (outage == null) { return null; } // Update the outage outage.setIfRegainedService(new Timestamp(regainedTime.getTime())); m_outageDao.saveOrUpdate(outage); return outage.getId(); }
/** {@inheritDoc} */ @Override public Integer openOutagePendingLostEventId(int nodeId, String ipAddr, String svcName, Date lostTime) { LOG.info("opening outage for {}:{}:{} @ {}", nodeId, ipAddr, svcName, lostTime); final OnmsMonitoredService service = m_monitoredServiceDao.get(nodeId, InetAddressUtils.addr(ipAddr), svcName); final OnmsOutage outage = new OnmsOutage(lostTime, service); m_outageDao.saveOrUpdate(outage); return outage.getId(); }