use of com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext in project cloudbreak by hortonworks.
the class ClusterTerminationActions method terminatingCluster.
@Bean(name = "CLUSTER_TERMINATING_STATE")
public Action<?, ?> terminatingCluster() {
return new AbstractClusterAction<StackEvent>(StackEvent.class) {
@Override
protected void doExecute(ClusterViewContext context, StackEvent payload, Map<Object, Object> variables) {
clusterTerminationFlowService.terminateCluster(context);
sendEvent(context);
}
@Override
protected void initPayloadConverterMap(List<PayloadConverter<StackEvent>> payloadConverters) {
payloadConverters.add(new DisableKerberosResultToStackEventConverter());
}
@Override
protected Selectable createRequest(ClusterViewContext context) {
return new ClusterTerminationRequest(context.getStackId(), context.getClusterView() != null ? context.getClusterView().getId() : null);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext in project cloudbreak by hortonworks.
the class EphemeralClusterActions method updateNameserverAction.
@Bean(name = "EPHEMERAL_CLUSTER_UPDATE_STATE")
public Action<?, ?> updateNameserverAction() {
return new AbstractClusterAction<EphemeralClusterUpdateTriggerEvent>(EphemeralClusterUpdateTriggerEvent.class) {
@Override
protected void doExecute(ClusterViewContext context, EphemeralClusterUpdateTriggerEvent payload, Map<Object, Object> variables) {
ephemeralClusterService.updateClusterStarted(context.getStackId());
Selectable request = new EphemeralClusterUpdateRequest(context.getStackId());
sendEvent(context.getFlowId(), request.selector(), request);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext 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);
}
};
}
Aggregations