Example usage for com.amazonaws.services.cloudformation.model StackSetOperationStatus fromValue

List of usage examples for com.amazonaws.services.cloudformation.model StackSetOperationStatus fromValue

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudformation.model StackSetOperationStatus fromValue.

Prototype

public static StackSetOperationStatus fromValue(String value) 

Source Link

Document

Use this in place of valueOf.

Usage

From source file:de.taimos.pipeline.aws.cloudformation.stacksets.CloudFormationStackSet.java

License:Apache License

DescribeStackSetOperationResult waitForOperationToComplete(String operationId, long pollInterval)
        throws InterruptedException {
    this.listener.getLogger().println("Waiting on operationId=" + operationId);
    DescribeStackSetOperationResult result = describeStackOperation(operationId);
    this.listener.getLogger()
            .println("operationId=" + operationId + " status=" + result.getStackSetOperation().getStatus());
    switch (StackSetOperationStatus.fromValue(result.getStackSetOperation().getStatus())) {
    case RUNNING:
        Thread.sleep(pollInterval);
        return waitForOperationToComplete(operationId, pollInterval);
    case SUCCEEDED:
        this.listener.getLogger().println("Stack set operation completed successfully");
        return result;
    case FAILED:/* www. jav a  2  s .  c  o  m*/
        this.listener.getLogger().println("Stack set operation completed failed");
        throw new StackSetOperationFailedException(operationId);
    default:
        throw new IllegalStateException("Invalid stack set state=" + result.getStackSetOperation().getStatus());
    }
}