@Autowired
private AmbariClusterInstallerMailSenderService ambariClusterInstallerMailSenderService;
@Override
public void accept(Event<ClusterCreationSuccess> event) {
ClusterCreationSuccess clusterCreationSuccess = event.getData();
Long clusterId = clusterCreationSuccess.getClusterId();
Cluster cluster = clusterRepository.findById(clusterId);
MDCBuilder.buildMdcContext(cluster);
LOGGER.info("Accepted {} event.", ReactorConfig.CLUSTER_CREATE_SUCCESS_EVENT, clusterId);
cluster.setStatus(Status.AVAILABLE);
cluster.setStatusReason("");
cluster.setCreationFinished(clusterCreationSuccess.getCreationFinished());
clusterRepository.save(cluster);
Stack stack = stackRepository.findStackWithListsForCluster(clusterId);
Set<InstanceMetaData> instances = stack.getInstanceMetaData();
for (InstanceMetaData instanceMetaData : instances) {
instanceMetaData.setRemovable(false);