Search in sources :

Example 1 with OrchestratorConfigRequest

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigRequest in project cloudbreak by hortonworks.

the class OrchestratorConfigHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<OrchestratorConfigRequest> event) {
    OrchestratorConfigRequest request = event.getData();
    Selectable response;
    try {
        freeIpaOrchestrationConfigService.configureOrchestrator(request.getResourceId());
        response = new OrchestratorConfigSuccess(request.getResourceId());
    } catch (Exception e) {
        LOGGER.error("FreeIPA orchestration configuration failed", e);
        response = new OrchestratorConfigFailed(request.getResourceId(), e);
    }
    return response;
}
Also used : Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) OrchestratorConfigSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigSuccess) OrchestratorConfigRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigRequest) OrchestratorConfigFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigFailed)

Example 2 with OrchestratorConfigRequest

use of com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigRequest in project cloudbreak by hortonworks.

the class FreeIpaUpscaleActions method orchestratorConfig.

@Bean(name = "UPSCALE_ORCHESTRATOR_CONFIG_STATE")
public Action<?, ?> orchestratorConfig() {
    return new AbstractUpscaleAction<>(StackEvent.class) {

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

Aggregations

OrchestratorConfigRequest (com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigRequest)2 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)1 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)1 Stack (com.sequenceiq.freeipa.entity.Stack)1 OrchestratorConfigFailed (com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigFailed)1 OrchestratorConfigSuccess (com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigSuccess)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