Search in sources :

Example 1 with PostInstallFreeIpaRequest

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest 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));
}
Also used : Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) PostInstallFreeIpaFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed) PostInstallFreeIpaSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess) PostInstallFreeIpaRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest)

Example 2 with PostInstallFreeIpaRequest

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest in project cloudbreak by hortonworks.

the class FreeIpaUpscaleActions method freeIpaPostInstallAction.

@Bean(name = "UPSCALE_FREEIPA_POST_INSTALL_STATE")
public Action<?, ?> freeIpaPostInstallAction() {
    return new AbstractUpscaleAction<>(ClusterProxyUpdateRegistrationSuccess.class) {

        @Override
        protected void doExecute(StackContext context, ClusterProxyUpdateRegistrationSuccess payload, Map<Object, Object> variables) {
            Stack stack = context.getStack();
            stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "FreeIPA Post Installation");
            PostInstallFreeIpaRequest request = new PostInstallFreeIpaRequest(stack.getId(), false);
            sendEvent(context, request.selector(), request);
        }
    };
}
Also used : StackContext(com.sequenceiq.freeipa.flow.stack.StackContext) Map(java.util.Map) ClusterProxyUpdateRegistrationSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.clusterproxy.ClusterProxyUpdateRegistrationSuccess) Stack(com.sequenceiq.freeipa.entity.Stack) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) PostInstallFreeIpaRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest) Bean(org.springframework.context.annotation.Bean)

Aggregations

PostInstallFreeIpaRequest (com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest)2 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)1 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 Stack (com.sequenceiq.freeipa.entity.Stack)1 ClusterProxyUpdateRegistrationSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.clusterproxy.ClusterProxyUpdateRegistrationSuccess)1 PostInstallFreeIpaFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaFailed)1 PostInstallFreeIpaSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess)1 StackContext (com.sequenceiq.freeipa.flow.stack.StackContext)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1