Search in sources :

Example 1 with START_DATE

use of com.sequenceiq.cloudbreak.core.flow2.stack.provision.StackProvisionConstants.START_DATE in project cloudbreak by hortonworks.

the class StackCreationActions method createCredentialAction.

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

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

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

Aggregations

CreateCredentialRequest (com.sequenceiq.cloudbreak.cloud.event.resource.CreateCredentialRequest)1 StackCreationContext (com.sequenceiq.cloudbreak.core.flow2.stack.start.StackCreationContext)1 StackEvent (com.sequenceiq.cloudbreak.reactor.api.event.StackEvent)1 Date (java.util.Date)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1