protected void publishExecuteCheck(ExecuteCheck check, WorkerKey routingKey, long ttl) { this.executeCheckProducer.publish(routingKey, check, ttl); }
protected void shutdownQueues() { this.schedulerActionConsumer.close(); this.schedulerQueue.close(); this.executeCheckProducer.close(); this.workerQueue.close(); }
protected void publishNotification(Check<?, ?> check, Notification notification) { if (logger.isTraceEnabled()) logger.trace("Sending notification:\r\n" + notification); this.notificationsProducer.publish(new NotificationKey(check.getSiteId()), notification); }
protected void publishCheckUpdate(Check<?, ?> check, CheckUpdate update) { if (logger.isTraceEnabled()) logger.trace("Sending check update:\r\n" + update); this.updateProducer.publish(new UpdateKey(UpdateType.CHECK, check.getSiteId(), check.getId()), update); }
protected void publishAlertUpdate(Alert alert, AlertUpdate update) { if (logger.isTraceEnabled()) logger.trace("Sending alert update:\r\n" + update); this.updateProducer.publish(new UpdateKey(UpdateType.ALERT, alert.getSiteId(), alert.getId()), update); }
protected void publishLocationUpdate(Location location, LocationUpdate update) { if (logger.isTraceEnabled()) logger.trace("Sending location update:\r\n" + update); this.updateProducer.publish(new UpdateKey(UpdateType.LOCATION, location.getSiteId(), location.getId()), update); } }
protected void publishGroupUpdate(Group group, GroupUpdate update) { if (logger.isTraceEnabled()) logger.trace("Sending group update:\r\n" + update); this.updateProducer.publish(new UpdateKey(UpdateType.GROUP, group.getSiteId(), group.getId()), update); }
protected void rescheduleCheck(ActiveCheck<?, ?> check, long interval) { if (logger.isTraceEnabled()) logger.trace("Rescheduling " + check.getType() + "::" + check.getId() + " [" + check.getName() + "]" + " with new interval " + interval + " due to state change"); this.schedulerActionProducer.publish(new SchedulerKey(check.getSiteId(), check.getPool()), new RescheduleCheck(check.getId(), interval)); }
private void registerCheck(RegisterCheck check) { for (Executor<?> executor : this.getExecutors()) { if (executor.accept(check)) { executor.register(check, (result) -> { if (logger.isTraceEnabled()) { logger.trace("Publishing result: " + result.getId() + " " + result.isOk() + " " + result.getStatus() + " " + result.getOutput()); } // Note: using an ActiveResultKey here as we know the pool id this.resultProducer.publish(new ActiveResultKey(check.getSiteId(), check.getProcessingPool()), result); }); return; } } logger.warn("Failed to register check, no executor found for: " + check); }