Search in sources :

Example 1 with InstallFreeIpaServicesSuccess

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess in project cloudbreak by hortonworks.

the class InstallFreeIpaServicesHandler method accept.

@Override
public void accept(Event<InstallFreeIpaServicesRequest> event) {
    StackEvent request = event.getData();
    Selectable response;
    try {
        freeIpaInstallService.installFreeIpa(request.getResourceId());
        response = new InstallFreeIpaServicesSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("FreeIPA service install failed", e);
        response = new InstallFreeIpaServicesFailed(request.getResourceId(), e);
    }
    eventBus.notify(response.selector(), new Event<>(event.getHeaders(), response));
}
Also used : StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) InstallFreeIpaServicesSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess) InstallFreeIpaServicesFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed)

Example 2 with InstallFreeIpaServicesSuccess

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess in project cloudbreak by hortonworks.

the class FreeIpaUpscaleActions method updateClusterProxyRegistrationAction.

@Bean(name = "UPSCALE_UPDATE_CLUSTERPROXY_REGISTRATION_STATE")
public Action<?, ?> updateClusterProxyRegistrationAction() {
    return new AbstractUpscaleAction<>(InstallFreeIpaServicesSuccess.class) {

        @Override
        protected void doExecute(StackContext context, InstallFreeIpaServicesSuccess payload, Map<Object, Object> variables) {
            Stack stack = context.getStack();
            stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Update cluster proxy registration after bootstrap");
            ClusterProxyUpdateRegistrationRequest request = new ClusterProxyUpdateRegistrationRequest(stack.getId());
            sendEvent(context, request.selector(), request);
        }
    };
}
Also used : InstallFreeIpaServicesSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess) ClusterProxyUpdateRegistrationRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.clusterproxy.ClusterProxyUpdateRegistrationRequest) StackContext(com.sequenceiq.freeipa.flow.stack.StackContext) Map(java.util.Map) Stack(com.sequenceiq.freeipa.entity.Stack) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) Bean(org.springframework.context.annotation.Bean)

Aggregations

InstallFreeIpaServicesSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess)2 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)1 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 Stack (com.sequenceiq.freeipa.entity.Stack)1 ClusterProxyUpdateRegistrationRequest (com.sequenceiq.freeipa.flow.freeipa.provision.event.clusterproxy.ClusterProxyUpdateRegistrationRequest)1 InstallFreeIpaServicesFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed)1 StackContext (com.sequenceiq.freeipa.flow.stack.StackContext)1 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1