use of com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesRequest in project cloudbreak by hortonworks.
the class FreeIpaUpscaleActions method bootstrappingMachinesAction.
@Bean(name = "UPSCALE_BOOTSTRAPPING_MACHINES_STATE")
public Action<?, ?> bootstrappingMachinesAction() {
return new AbstractUpscaleAction<>(ClusterProxyRegistrationSuccess.class) {
@Override
protected void doExecute(StackContext context, ClusterProxyRegistrationSuccess payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Bootstrapping machines");
BootstrapMachinesRequest request = new BootstrapMachinesRequest(stack.getId());
sendEvent(context, request.selector(), request);
}
};
}
use of com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.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 {
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));
}
Aggregations