use of com.sequenceiq.cloudbreak.core.flow2.stack.StackContext 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);
}
};
}
use of com.sequenceiq.cloudbreak.core.flow2.stack.StackContext in project cloudbreak by hortonworks.
the class StackCreationActions method provisioningFinishedAction.
@Bean(name = "PROVISIONING_FINISHED_STATE")
public Action<?, ?> provisioningFinishedAction() {
return new AbstractStackCreationAction<LaunchStackResult>(LaunchStackResult.class) {
@Override
protected void doExecute(StackContext context, LaunchStackResult payload, Map<Object, Object> variables) {
Stack stack = stackCreationService.provisioningFinished(context, payload, variables);
StackContext newContext = new StackContext(context.getFlowId(), stack, context.getCloudContext(), context.getCloudCredential(), context.getCloudStack());
sendEvent(newContext);
}
@Override
protected Selectable createRequest(StackContext context) {
List<CloudInstance> cloudInstances = cloudStackConverter.buildInstances(context.getStack());
List<CloudResource> cloudResources = cloudResourceConverter.convert(context.getStack().getResources());
return new CollectMetadataRequest(context.getCloudContext(), context.getCloudCredential(), cloudResources, cloudInstances);
}
};
}
Aggregations