Search in sources :

Example 11 with UpgradeCcmEvent

use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent in project cloudbreak by hortonworks.

the class UpgradeCcmActions method upgradeCcmValidationAction.

@Bean(name = "UPGRADE_CCM_VALIDATION_STATE")
public Action<?, ?> upgradeCcmValidationAction() {
    return new AbstractUpgradeCcmAction<>(UpgradeCcmEvent.class) {

        @Override
        protected void doExecute(CommonContext context, UpgradeCcmEvent payload, Map<Object, Object> variables) {
            EnvironmentDto envDto = environmentStatusUpdateService.updateEnvironmentStatusAndNotify(context, payload, EnvironmentStatus.UPGRADE_CCM_VALIDATION_IN_PROGRESS, ResourceEvent.ENVIRONMENT_UPGRADE_CCM_VALIDATION_STARTED, UpgradeCcmState.UPGRADE_CCM_VALIDATION_STATE);
            sendEvent(context, UPGRADE_CCM_VALIDATION_HANDLER.selector(), envDto);
        }
    };
}
Also used : UpgradeCcmEvent(com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) CommonContext(com.sequenceiq.flow.core.CommonContext) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Example 12 with UpgradeCcmEvent

use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent in project cloudbreak by hortonworks.

the class UpgradeCcmActions method upgradeCcmInDataHubAction.

@Bean(name = "UPGRADE_CCM_DATAHUB_STATE")
public Action<?, ?> upgradeCcmInDataHubAction() {
    return new AbstractUpgradeCcmAction<>(UpgradeCcmEvent.class) {

        @Override
        protected void doExecute(CommonContext context, UpgradeCcmEvent payload, Map<Object, Object> variables) {
            EnvironmentDto envDto = environmentStatusUpdateService.updateEnvironmentStatusAndNotify(context, payload, EnvironmentStatus.UPGRADE_CCM_ON_DATAHUB_IN_PROGRESS, ResourceEvent.ENVIRONMENT_UPGRADE_CCM_ON_DATAHUB_STARTED, UpgradeCcmState.UPGRADE_CCM_DATAHUB_STATE);
            sendEvent(context, UPGRADE_CCM_DATAHUB_HANDLER.selector(), envDto);
        }
    };
}
Also used : UpgradeCcmEvent(com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) CommonContext(com.sequenceiq.flow.core.CommonContext) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Example 13 with UpgradeCcmEvent

use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent in project cloudbreak by hortonworks.

the class UpgradeCcmActions method upgradeCcmUpdateTunnelAction.

@Bean(name = "UPGRADE_CCM_TUNNEL_UPDATE_STATE")
public Action<?, ?> upgradeCcmUpdateTunnelAction() {
    return new AbstractUpgradeCcmAction<>(UpgradeCcmEvent.class) {

        @Override
        protected void doExecute(CommonContext context, UpgradeCcmEvent payload, Map<Object, Object> variables) {
            EnvironmentDto envDto = environmentStatusUpdateService.updateEnvironmentStatusAndNotify(context, payload, EnvironmentStatus.UPGRADE_CCM_TUNNEL_UPDATE_IN_PROGRESS, ResourceEvent.ENVIRONMENT_UPGRADE_CCM_TUNNEL_UPDATE_STARTED, UpgradeCcmState.UPGRADE_CCM_TUNNEL_UPDATE_STATE);
            sendEvent(context, UPGRADE_CCM_TUNNEL_UPDATE_HANDLER.selector(), envDto);
        }
    };
}
Also used : UpgradeCcmEvent(com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) CommonContext(com.sequenceiq.flow.core.CommonContext) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Example 14 with UpgradeCcmEvent

use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent in project cloudbreak by hortonworks.

the class UpgradeCcmActions method upgradeCcmInDataLakeAction.

@Bean(name = "UPGRADE_CCM_DATALAKE_STATE")
public Action<?, ?> upgradeCcmInDataLakeAction() {
    return new AbstractUpgradeCcmAction<>(UpgradeCcmEvent.class) {

        @Override
        protected void doExecute(CommonContext context, UpgradeCcmEvent payload, Map<Object, Object> variables) {
            EnvironmentDto envDto = environmentStatusUpdateService.updateEnvironmentStatusAndNotify(context, payload, EnvironmentStatus.UPGRADE_CCM_ON_DATALAKE_IN_PROGRESS, ResourceEvent.ENVIRONMENT_UPGRADE_CCM_ON_DATALAKE_STARTED, UpgradeCcmState.UPGRADE_CCM_DATALAKE_STATE);
            sendEvent(context, UPGRADE_CCM_DATALAKE_HANDLER.selector(), envDto);
        }
    };
}
Also used : UpgradeCcmEvent(com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) CommonContext(com.sequenceiq.flow.core.CommonContext) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Example 15 with UpgradeCcmEvent

use of com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent in project cloudbreak by hortonworks.

the class UpgradeCcmActions method finishedAction.

@Bean(name = "UPGRADE_CCM_FINISHED_STATE")
public Action<?, ?> finishedAction() {
    return new AbstractUpgradeCcmAction<>(UpgradeCcmEvent.class) {

        @Override
        protected void doExecute(CommonContext context, UpgradeCcmEvent payload, Map<Object, Object> variables) {
            EnvironmentDto environmentDto = environmentStatusUpdateService.updateEnvironmentStatusAndNotify(context, payload, EnvironmentStatus.AVAILABLE, ResourceEvent.ENVIRONMENT_UPGRADE_CCM_FINISHED, UpgradeCcmState.UPGRADE_CCM_FINISHED_STATE);
            metricService.incrementMetricCounter(MetricType.ENV_UPGRADE_CCM_FINISHED, environmentDto);
            sendEvent(context, FINALIZE_UPGRADE_CCM_EVENT.event(), payload);
        }
    };
}
Also used : UpgradeCcmEvent(com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) CommonContext(com.sequenceiq.flow.core.CommonContext) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Aggregations

UpgradeCcmEvent (com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent)17 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)11 CommonContext (com.sequenceiq.flow.core.CommonContext)6 Map (java.util.Map)6 Bean (org.springframework.context.annotation.Bean)6 UpgradeCcmFailedEvent (com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmFailedEvent)4 FlowIdentifier (com.sequenceiq.flow.api.model.FlowIdentifier)3 SdxCcmUpgradeResponse (com.sequenceiq.sdx.api.model.SdxCcmUpgradeResponse)3 Test (org.junit.jupiter.api.Test)3 OperationException (com.sequenceiq.cloudbreak.service.OperationException)1 EnvStackConfigUpdatesEvent (com.sequenceiq.environment.environment.flow.config.update.event.EnvStackConfigUpdatesEvent)1 EnvCreationEvent (com.sequenceiq.environment.environment.flow.creation.event.EnvCreationEvent)1 EnvDeleteEvent (com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteEvent)1 LoadBalancerUpdateEvent (com.sequenceiq.environment.environment.flow.loadbalancer.event.LoadBalancerUpdateEvent)1 EnvStartEvent (com.sequenceiq.environment.environment.flow.start.event.EnvStartEvent)1 EnvStopEvent (com.sequenceiq.environment.environment.flow.stop.event.EnvStopEvent)1 FreeIpaOperationFailedException (com.sequenceiq.environment.exception.FreeIpaOperationFailedException)1 FlowParameters (com.sequenceiq.flow.core.FlowParameters)1 DescribeFreeIpaResponse (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.describe.DescribeFreeIpaResponse)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1