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