Search in sources :

Example 16 with EnvironmentStatus

use of com.sequenceiq.environment.environment.EnvironmentStatus in project cloudbreak by hortonworks.

the class EnvClustersDeleteActions method datalakeClustersDeleteAction.

@Bean(name = "DATALAKE_CLUSTERS_DELETE_STARTED_STATE")
public Action<?, ?> datalakeClustersDeleteAction() {
    return new AbstractEnvClustersDeleteAction<>(EnvDeleteEvent.class) {

        @Override
        protected void doExecute(CommonContext context, EnvDeleteEvent payload, Map<Object, Object> variables) {
            EnvironmentStatus environmentStatus = EnvironmentStatus.DATALAKE_CLUSTERS_DELETE_IN_PROGRESS;
            ResourceEvent resourceEvent = ResourceEvent.ENVIRONMENT_DATALAKE_CLUSTERS_DELETION_STARTED;
            EnvClustersDeleteState envClustersDeleteState = EnvClustersDeleteState.DATALAKE_CLUSTERS_DELETE_STARTED_STATE;
            String logDeleteState = "Data Lake clusters";
            EnvironmentDeletionDto envDto = commonUpdateEnvironmentAndNotify(context, payload, environmentStatus, resourceEvent, envClustersDeleteState, logDeleteState);
            sendEvent(context, DELETE_DATALAKE_CLUSTERS_EVENT.selector(), envDto);
        }
    };
}
Also used : EnvironmentStatus(com.sequenceiq.environment.environment.EnvironmentStatus) EnvDeleteEvent(com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteEvent) CommonContext(com.sequenceiq.flow.core.CommonContext) ResourceEvent(com.sequenceiq.cloudbreak.event.ResourceEvent) Map(java.util.Map) EnvironmentDeletionDto(com.sequenceiq.environment.environment.dto.EnvironmentDeletionDto) Bean(org.springframework.context.annotation.Bean)

Aggregations

EnvironmentStatus (com.sequenceiq.environment.environment.EnvironmentStatus)16 CommonContext (com.sequenceiq.flow.core.CommonContext)12 Map (java.util.Map)12 Bean (org.springframework.context.annotation.Bean)12 ResourceEvent (com.sequenceiq.cloudbreak.event.ResourceEvent)11 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)10 EnvironmentStartDto (com.sequenceiq.environment.environment.dto.EnvironmentStartDto)4 EnvStartEvent (com.sequenceiq.environment.environment.flow.start.event.EnvStartEvent)4 Environment (com.sequenceiq.environment.environment.domain.Environment)3 EnvStopEvent (com.sequenceiq.environment.environment.flow.stop.event.EnvStopEvent)3 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)3 EnvironmentDeletionDto (com.sequenceiq.environment.environment.dto.EnvironmentDeletionDto)2 EnvironmentLoadBalancerDto (com.sequenceiq.environment.environment.dto.EnvironmentLoadBalancerDto)2 EnvDeleteEvent (com.sequenceiq.environment.environment.flow.deletion.event.EnvDeleteEvent)2 LoadBalancerUpdateEvent (com.sequenceiq.environment.environment.flow.loadbalancer.event.LoadBalancerUpdateEvent)2 Test (org.junit.jupiter.api.Test)2 UpgradeCcmFailedEvent (com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmFailedEvent)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1