use of com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess in project cloudbreak by hortonworks.
the class FreeIpaUpscaleActions method updateMetadataAction.
@Bean(name = "UPSCALE_UPDATE_METADATA_STATE")
public Action<?, ?> updateMetadataAction() {
return new AbstractUpscaleAction<>(PostInstallFreeIpaSuccess.class) {
@Override
protected void doExecute(StackContext context, PostInstallFreeIpaSuccess payload, Map<Object, Object> variables) {
Stack stack = context.getStack();
stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Upscale update metadata");
if (!isRepair(variables)) {
int nodeCount = getInstanceCountByGroup(variables);
for (InstanceGroup instanceGroup : stack.getInstanceGroups()) {
instanceGroup.setNodeCount(nodeCount);
instanceGroupService.save(instanceGroup);
}
}
sendEvent(context, UPSCALE_UPDATE_METADATA_FINISHED_EVENT.selector(), new StackEvent(stack.getId()));
}
};
}
use of com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess in project cloudbreak by hortonworks.
the class PostInstallFreeIpaHandler method accept.
@Override
public void accept(Event<PostInstallFreeIpaRequest> event) {
PostInstallFreeIpaRequest request = event.getData();
Selectable response;
try {
freeIpaPostInstallService.postInstallFreeIpa(request.getResourceId(), request.isFullPostInstall());
response = new PostInstallFreeIpaSuccess(request.getResourceId());
} catch (Exception e) {
LOGGER.error("Post install tasks have failed", e);
response = new PostInstallFreeIpaFailed(request.getResourceId(), e);
}
eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Aggregations