Search in sources :

Example 1 with BootstrapMachinesRequest

use of com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesRequest in project cloudbreak by hortonworks.

the class BootstrapMachineHandler method accept.

@Override
public void accept(Event<BootstrapMachinesRequest> event) {
    BootstrapMachinesRequest request = event.getData();
    Selectable response;
    try {
        clusterBootstrapper.bootstrapMachines(request.getStackId());
        response = new BootstrapMachinesSuccess(request.getStackId());
    } catch (Exception e) {
        response = new BootstrapMachinesFailed(request.getStackId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : BootstrapMachinesFailed(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesFailed) Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) BootstrapMachinesSuccess(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesSuccess) BootstrapMachinesRequest(com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesRequest)

Aggregations

Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)1 BootstrapMachinesFailed (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesFailed)1 BootstrapMachinesRequest (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesRequest)1 BootstrapMachinesSuccess (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.BootstrapMachinesSuccess)1