@Autowired
private RetryingStackUpdater stackUpdater;
@Override
public void accept(Event<UpdateAmbariHostsFailure> event) {
UpdateAmbariHostsFailure data = event.getData();
Cluster cluster = clusterRepository.findById(data.getClusterId());
MDCBuilder.buildMdcContext(cluster);
LOGGER.info("Accepted {} event.", ReactorConfig.UPDATE_AMBARI_HOSTS_FAILED_EVENT);
cluster.setStatus(Status.AVAILABLE);
cluster.setStatusReason(data.getDetailedMessage());
clusterRepository.save(cluster);
Stack stack = stackRepository.findStackForCluster(cluster.getId());
stackUpdater.updateStackStatus(stack.getId(), Status.AVAILABLE);
websocketService.sendToTopicUser(cluster.getOwner(), WebsocketEndPoint.CLUSTER, new StatusMessage(data.getClusterId(), cluster.getName(),
"UPDATE_FAILED"));
}