public synchronized void onAlarmCreatedOrUpdatedWithReducedEvent(OnmsAlarm alarm) { if (m_hasActiveAlarmNbis) { final NorthboundAlarm a = new NorthboundAlarm(alarm); for (Northbounder nbi : m_northboundInterfaces) { nbi.onAlarm(a); } } }
@Override public void postHandleAlarmSnapshot() { stateTracker.resetStateAndStopTrackingAlarms(); }
@Override public void preHandleAlarmSnapshot() { stateTracker.startTrackingAlarms(); }
@Override public boolean accepts(NorthboundAlarm alarm) { if (m_config.getAcceptableUeis() == null || m_config.getAcceptableUeis().contains(alarm.getUei())) { return true; } return false; }
@Override public void handleDeletedAlarm(int alarmId, String reductionKey) { if (!forwardAlarms) { // Ignore return; } handleDeletedAlarm(reductionKey); stateTracker.trackDeletedAlarm(alarmId, reductionKey); }
@Override public void handleNewOrUpdatedAlarm(OnmsAlarm alarm) { if (!forwardAlarms) { // Ignore return; } updateAlarm(alarm.getReductionKey(), alarm); stateTracker.trackNewOrUpdatedAlarm(alarm.getId(), alarm.getReductionKey()); }
public void onNewOrUpdatedAlarm(OnmsAlarm alarm) { forEachListener(l -> l.handleNewOrUpdatedAlarm(alarm)); }
/** * Preserve. * * @param a the alarm */ public void preserve(T a) { a.setPreserved(true); boolean result = m_queue.offer(a); LOG.debug("Alarm {} preserved, offered to blocking-queue. Actually queued? {}", a, result); }
@Override public void process(final Exchange exchange) throws Exception { final NorthboundAlarm alarm = exchange.getIn().getBody(NorthboundAlarm.class); exchange.getIn().setBody(alarm.toString(), String.class); } }
public synchronized void onAlarmCreatedOrUpdatedWithReducedEvent(OnmsAlarm alarm) { if (m_hasActiveAlarmNbis) { final NorthboundAlarm a = new NorthboundAlarm(alarm); for (Northbounder nbi : m_northboundInterfaces) { nbi.onAlarm(a); } } }
@Override public void preHandleAlarmSnapshot() { stateTracker.startTrackingAlarms(); }
@Override public void postHandleAlarmSnapshot() { stateTracker.resetStateAndStopTrackingAlarms(); }
@Override public void handleDeletedAlarm(int alarmId, String reductionKey) { if (!forwardAlarms) { // Ignore return; } handleDeletedAlarm(reductionKey); stateTracker.trackDeletedAlarm(alarmId, reductionKey); }
public void onNewOrUpdatedAlarm(OnmsAlarm alarm) { forEachListener(l -> l.handleNewOrUpdatedAlarm(alarm)); }
/** * Preserve. * * @param a the alarm */ public void preserve(T a) { a.setPreserved(true); boolean result = m_queue.offer(a); LOG.debug("Alarm {} preserved, offered to blocking-queue. Actually queued? {}", a, result); }
/** * Forwards the alarms to the current set of NBIs. * * This method is synchronized since the event handler is multi-threaded * and the NBIs are not necessarily thread safe. * * @param alarm the alarm to forward */ private synchronized void forwardAlarmToNbis(OnmsAlarm alarm) { NorthboundAlarm a = new NorthboundAlarm(alarm); for (Northbounder nbi : m_northboundInterfaces) { nbi.onAlarm(a); } }
@Override public void preHandleAlarmSnapshot() { getLock().lock(); try { // Start tracking alarm callbacks via the state tracker // Do this while holding on a lock to make sure that we don't miss a callback that's in flight stateTracker.startTrackingAlarms(); } finally { getLock().unlock(); } }
/** * Forwards the alarms to the current set of NBIs. * * This method is synchronized since the event handler is multi-threaded * and the NBIs are not necessarily thread safe. * * @param alarm the alarm to forward */ private synchronized void forwardAlarmToNbis(OnmsAlarm alarm) { NorthboundAlarm a = new NorthboundAlarm(alarm); for (Northbounder nbi : m_northboundInterfaces) { nbi.onAlarm(a); } }
@Override public void preHandleAlarmSnapshot() { getLock().lock(); try { // Start tracking alarm callbacks via the state tracker // Do this while holding on a lock to make sure that we don't miss a callback that's in flight stateTracker.startTrackingAlarms(); } finally { getLock().unlock(); } }