Search in sources :

Example 6 with AbstractClusterAction

use of com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction in project cloudbreak by hortonworks.

the class ClusterDownscaleActions method decommissionAction.

@Bean(name = "DECOMMISSION_STATE")
public Action<?, ?> decommissionAction() {
    return new AbstractClusterAction<CollectDownscaleCandidatesResult>(CollectDownscaleCandidatesResult.class) {

        @Override
        protected void doExecute(ClusterViewContext context, CollectDownscaleCandidatesResult payload, Map<Object, Object> variables) {
            Selectable request = new DecommissionRequest(context.getStackId(), payload.getHostGroupName(), payload.getHostNames());
            sendEvent(context.getFlowId(), request.selector(), request);
        }
    };
}
Also used : Selectable(com.sequenceiq.cloudbreak.cloud.event.Selectable) DecommissionRequest(com.sequenceiq.cloudbreak.reactor.api.event.resource.DecommissionRequest) CollectDownscaleCandidatesResult(com.sequenceiq.cloudbreak.reactor.api.event.resource.CollectDownscaleCandidatesResult) AbstractClusterAction(com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction) Map(java.util.Map) ClusterViewContext(com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext) Bean(org.springframework.context.annotation.Bean)

Aggregations

AbstractClusterAction (com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction)6 ClusterViewContext (com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext)6 Map (java.util.Map)6 Bean (org.springframework.context.annotation.Bean)6 Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)4 ClusterCredentialChangeTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.ClusterCredentialChangeTriggerEvent)1 ClusterDownscaleTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.ClusterDownscaleTriggerEvent)1 DisableKerberosResultToStackEventConverter (com.sequenceiq.cloudbreak.core.flow2.stack.provision.DisableKerberosResultToStackEventConverter)1 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)1 PrepareClusterTerminationRequest (com.sequenceiq.cloudbreak.reactor.api.event.cluster.PrepareClusterTerminationRequest)1 ChangePrimaryGatewayRequest (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewayRequest)1 ChangePrimaryGatewayTriggerEvent (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ChangePrimaryGatewayTriggerEvent)1 ClusterTerminationRequest (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.ClusterTerminationRequest)1 EphemeralClusterUpdateRequest (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.EphemeralClusterUpdateRequest)1 EphemeralClusterUpdateTriggerEvent (com.sequenceiq.cloudbreak.reactor.api.event.orchestration.EphemeralClusterUpdateTriggerEvent)1 ClusterCredentialChangeRequest (com.sequenceiq.cloudbreak.reactor.api.event.resource.ClusterCredentialChangeRequest)1 CollectDownscaleCandidatesRequest (com.sequenceiq.cloudbreak.reactor.api.event.resource.CollectDownscaleCandidatesRequest)1 CollectDownscaleCandidatesResult (com.sequenceiq.cloudbreak.reactor.api.event.resource.CollectDownscaleCandidatesResult)1 DecommissionRequest (com.sequenceiq.cloudbreak.reactor.api.event.resource.DecommissionRequest)1 List (java.util.List)1