Search in sources :

Example 1 with ClusterStopRequest

use of com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStopRequest in project cloudbreak by hortonworks.

the class ClusterStopHandler method accept.

@Override
public void accept(Event<ClusterStopRequest> event) {
    ClusterStopRequest request = event.getData();
    ClusterStopResult result;
    try {
        Stack stack = stackService.getByIdWithLists(request.getStackId());
        ambariClusterConnector.stopCluster(stack);
        result = new ClusterStopResult(request);
    } catch (Exception e) {
        result = new ClusterStopResult(e.getMessage(), e, request);
    }
    eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result));
}
Also used : ClusterStopRequest(com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStopRequest) ClusterStopResult(com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStopResult) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Aggregations

Stack (com.sequenceiq.cloudbreak.domain.Stack)1 ClusterStopRequest (com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStopRequest)1 ClusterStopResult (com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStopResult)1