Search in sources :

Example 11 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class StackCreationActions method createCredentialAction.

@Bean(name = "CREATE_CREDENTIAL_STATE")
public Action<?, ?> createCredentialAction() {
    return new AbstractStackCreationAction<StackEvent>(StackEvent.class) {

        @Override
        protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) {
            variables.put(START_DATE, new Date());
            stackCreationService.startProvisioning(context);
            sendEvent(context);
        }

        @Override
        protected Selectable createRequest(StackContext context) {
            return new CreateCredentialRequest(context.getCloudContext(), context.getCloudCredential(), context.getCloudStack());
        }
    };
}
Also used : CreateCredentialRequest(com.sequenceiq.cloudbreak.cloud.event.resource.CreateCredentialRequest) StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) StackContext(com.sequenceiq.cloudbreak.core.flow2.stack.StackContext) Map(java.util.Map) Date(java.util.Date) Bean(org.springframework.context.annotation.Bean)

Example 12 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerClusterStop.

public void triggerClusterStop(Long stackId) {
    String selector = FlowChainTriggers.FULL_STOP_TRIGGER_EVENT;
    notify(selector, new StackEvent(selector, stackId));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)

Example 13 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerClusterTermination.

public void triggerClusterTermination(Long stackId, Boolean withStackDelete, Boolean deleteDependencies) {
    Boolean secure = stackService.get(stackId).getCluster().isSecure();
    if (withStackDelete) {
        String selector = secure ? FlowChainTriggers.PROPER_TERMINATION_TRIGGER_EVENT : FlowChainTriggers.TERMINATION_TRIGGER_EVENT;
        notify(selector, new TerminationEvent(selector, stackId, false, deleteDependencies));
        cancelRunningFlows(stackId);
    } else {
        String selector = (secure ? ClusterTerminationEvent.PROPER_TERMINATION_EVENT : ClusterTerminationEvent.TERMINATION_EVENT).event();
        notify(selector, new StackEvent(selector, stackId));
    }
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent) StackTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent) ClusterTerminationEvent(com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent) TerminationEvent(com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)

Example 14 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerClusterStart.

public void triggerClusterStart(Long stackId) {
    String selector = CLUSTER_START_EVENT.event();
    notify(selector, new StackEvent(selector, stackId));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)

Example 15 with StackEvent

use of com.sequenceiq.cloudbreak.reactor.api.event.StackEvent in project cloudbreak by hortonworks.

the class ReactorFlowManager method triggerClusterSync.

public void triggerClusterSync(Long stackId) {
    String selector = CLUSTER_SYNC_EVENT.event();
    notify(selector, new StackEvent(selector, stackId));
}
Also used : StackEvent(com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)

Aggregations

StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)25 Selectable (com.sequenceiq.cloudbreak.cloud.event.Selectable)10 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)8 ClusterTerminationEvent (com.sequenceiq.cloudbreak.core.flow2.cluster.termination.ClusterTerminationEvent)3 StackTerminationEvent (com.sequenceiq.cloudbreak.core.flow2.stack.termination.StackTerminationEvent)3 TerminationEvent (com.sequenceiq.cloudbreak.reactor.api.event.stack.TerminationEvent)3 Map (java.util.Map)3 Bean (org.springframework.context.annotation.Bean)3 Acceptable (com.sequenceiq.cloudbreak.cloud.Acceptable)1 CreateCredentialRequest (com.sequenceiq.cloudbreak.cloud.event.resource.CreateCredentialRequest)1 Flow (com.sequenceiq.cloudbreak.core.flow2.Flow)1 AbstractClusterAction (com.sequenceiq.cloudbreak.core.flow2.cluster.AbstractClusterAction)1 ClusterViewContext (com.sequenceiq.cloudbreak.core.flow2.cluster.ClusterViewContext)1 StackAndClusterUpscaleTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackAndClusterUpscaleTriggerEvent)1 StackSyncTriggerEvent (com.sequenceiq.cloudbreak.core.flow2.event.StackSyncTriggerEvent)1 AbstractStackFailureAction (com.sequenceiq.cloudbreak.core.flow2.stack.AbstractStackFailureAction)1 StackContext (com.sequenceiq.cloudbreak.core.flow2.stack.StackContext)1 StackFailureContext (com.sequenceiq.cloudbreak.core.flow2.stack.StackFailureContext)1 DisableKerberosResultToStackEventConverter (com.sequenceiq.cloudbreak.core.flow2.stack.provision.DisableKerberosResultToStackEventConverter)1 StackView (com.sequenceiq.cloudbreak.domain.view.StackView)1