Search in sources :

Example 1 with ClusterTerminationResult

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));
}
Also used : ClusterTerminationResult(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationResult) ClusterTerminationRequest(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationRequest)

Aggregations

ClusterTerminationRequest (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationRequest)1 ClusterTerminationResult (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationResult)1