Search in sources :

Example 1 with ClusterStartResult

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

the class ClusterStartHandler method accept.

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

Aggregations

Stack (com.sequenceiq.cloudbreak.domain.Stack)1 ClusterStartRequest (com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartRequest)1 ClusterStartResult (com.sequenceiq.cloudbreak.reactor.api.event.cluster.ClusterStartResult)1