Search in sources :

Example 1 with WaitForAmbariServerFailed

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

the class WaitingAmbariServerHandler method accept.

@Override
public void accept(Event<WaitForAmbariServerRequest> event) {
    Long stackId = event.getData().getStackId();
    Selectable response;
    try {
        Stack stack = stackService.getById(stackId);
        ambariClusterConnector.waitForServer(stack);
        response = new WaitForAmbariServerSuccess(stackId);
    } catch (Exception e) {
        response = new WaitForAmbariServerFailed(stackId, e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : WaitForAmbariServerSuccess(com.sequenceiq.cloudbreak.reactor.api.event.cluster.WaitForAmbariServerSuccess) WaitForAmbariServerFailed(com.sequenceiq.cloudbreak.reactor.api.event.cluster.WaitForAmbariServerFailed) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) Stack(com.sequenceiq.cloudbreak.domain.Stack)

Aggregations

Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)1 Stack (com.sequenceiq.cloudbreak.domain.Stack)1 WaitForAmbariServerFailed (com.sequenceiq.cloudbreak.reactor.api.event.cluster.WaitForAmbariServerFailed)1 WaitForAmbariServerSuccess (com.sequenceiq.cloudbreak.reactor.api.event.cluster.WaitForAmbariServerSuccess)1