Search in sources :

Example 1 with BootstrapMachinesFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesFailed in project cloudbreak by hortonworks.

the class BootstrapMachineHandler method accept.

@Override
public void accept(Event<BootstrapMachinesRequest> event) {
    BootstrapMachinesRequest request = event.getData();
    Selectable response;
    try {
        bootstrapService.bootstrap(request.getResourceId());
        response = new BootstrapMachinesSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("Bootstrap failed", e);
        response = new BootstrapMachinesFailed(request.getResourceId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : BootstrapMachinesFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesFailed) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) BootstrapMachinesSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesSuccess) BootstrapMachinesRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesRequest)

Example 2 with BootstrapMachinesFailed

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesFailed in project cloudbreak by hortonworks.

the class BootstrapMachinesFailedToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    BootstrapMachinesFailed result = (BootstrapMachinesFailed) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Bootstrapping machines", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : BootstrapMachinesFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesFailed) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)

Aggregations

BootstrapMachinesFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesFailed)2 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 BootstrapMachinesRequest (com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesRequest)1 BootstrapMachinesSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesSuccess)1 UpscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)1