use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationResult in project cloudbreak by hortonworks.
the class ClusterTerminationHandler method accept.
@Override
public void accept(Event<ClusterTerminationRequest> event) {
ClusterTerminationRequest request = event.getData();
ClusterTerminationResult result;
try {
Boolean allowed = clusterTerminationService.deleteClusterComponents(request.getClusterId());
result = new ClusterTerminationResult(request, allowed);
} catch (RuntimeException e) {
LOGGER.error("Failed to delete cluster containers", e);
result = new ClusterTerminationResult(e.getMessage(), e, request);
}
eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Aggregations