use of com.thinkbiganalytics.alerts.spi.AlertManager in project kylo by Teradata.
the class AggregatingAlertProvider method findActionableAlert.
private SimpleEntry<Alert, AlertManager> findActionableAlert(ID id) {
SourceAlertID srcId = asSourceAlertId(id);
AlertManager mgr = this.managers.get(srcId.sourceId);
if (mgr != null) {
return getAlert(srcId.alertId, mgr, true).filter(alert -> alert.isActionable()).map(alert -> new SimpleEntry<>(unwrapAlert(alert), mgr)).orElse(null);
} else {
return null;
}
}
use of com.thinkbiganalytics.alerts.spi.AlertManager in project kylo by Teradata.
the class AggregatingAlertProvider method accept.
/* (non-Javadoc)
* @see reactor.fn.Consumer#accept(java.lang.Object)
*/
@Override
public void accept(Event<Alert> event) {
final Alert alert = unwrapAlert(event.getData());
final AlertManager mgr = (AlertManager) alert.getSource();
final List<AlertResponder> responders = snapshotResponderts();
responders.forEach(responder -> {
AlertResponse resp = mgr.getResponse(alert);
AlertResponseWrapper wrapper = new AlertResponseWrapper(resp);
responder.alertChange(alert, wrapper);
});
}
Aggregations