Search in sources :

Example 1 with GetTlsInfoRequest

use of com.sequenceiq.cloudbreak.cloud.event.instance.GetTlsInfoRequest in project cloudbreak by hortonworks.

the class StackCreationActions method collectMetadataAction.

@Bean(name = "COLLECTMETADATA_STATE")
public Action<?, ?> collectMetadataAction() {
    return new AbstractStackCreationAction<CollectMetadataResult>(CollectMetadataResult.class) {

        @Override
        protected void doExecute(StackContext context, CollectMetadataResult payload, Map<Object, Object> variables) {
            Stack stack = stackCreationService.setupMetadata(context, payload);
            StackContext newContext = new StackContext(context.getFlowId(), stack, context.getCloudContext(), context.getCloudCredential(), context.getCloudStack());
            sendEvent(newContext);
        }

        @Override
        protected Selectable createRequest(StackContext context) {
            CloudStack cloudStack = cloudStackConverter.convert(context.getStack());
            return new GetTlsInfoRequest<GetTlsInfoResult>(context.getCloudContext(), context.getCloudCredential(), cloudStack);
        }
    };
}
Also used : StackContext(com.sequenceiq.cloudbreak.core.flow2.stack.StackContext) CollectMetadataResult(com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataResult) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) Map(java.util.Map) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) Stack(com.sequenceiq.cloudbreak.domain.Stack) GetTlsInfoRequest(com.sequenceiq.cloudbreak.cloud.event.instance.GetTlsInfoRequest) Bean(org.springframework.context.annotation.Bean)

Aggregations

CollectMetadataResult (com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataResult)1 GetTlsInfoRequest (com.sequenceiq.cloudbreak.cloud.event.instance.GetTlsInfoRequest)1 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)1 StackContext (com.sequenceiq.cloudbreak.core.flow2.stack.StackContext)1 Stack (com.sequenceiq.cloudbreak.domain.Stack)1 Map (java.util.Map)1 Bean (org.springframework.context.annotation.Bean)1