@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateStackResult == false) return false; CreateStackResult other = (CreateStackResult) obj; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; return true; }
/** * <p> * Unique identifier of the stack. * </p> * * @param stackId * Unique identifier of the stack. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackResult withStackId(String stackId) { setStackId(stackId); return this; }
public CreateStackResult unmarshall(StaxUnmarshallerContext context) throws Exception { CreateStackResult createStackResult = new CreateStackResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return createStackResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("StackId", targetDepth)) { createStackResult.setStackId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return createStackResult; } } } }
return OutputUtilities.getSuccessResultsMap(result.toString()); } catch (Exception e) { return OutputUtilities.getFailureResultsMap(e);
public CreateStackResult unmarshall(StaxUnmarshallerContext context) throws Exception { CreateStackResult createStackResult = new CreateStackResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return createStackResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("StackId", targetDepth)) { createStackResult.setStackId(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return createStackResult; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); return hashCode; }
/** * <p> * Unique identifier of the stack. * </p> * * @param stackId * Unique identifier of the stack. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateStackResult withStackId(String stackId) { setStackId(stackId); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackId() != null) sb.append("StackId: ").append(getStackId()); sb.append("}"); return sb.toString(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackId() == null) ? 0 : getStackId().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateStackResult == false) return false; CreateStackResult other = (CreateStackResult) obj; if (other.getStackId() == null ^ this.getStackId() == null) return false; if (other.getStackId() != null && other.getStackId().equals(this.getStackId()) == false) return false; return true; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getStackId() != null) sb.append("StackId: ").append(getStackId()); sb.append("}"); return sb.toString(); }
private Properties getCloudformationOutputs(AmazonCloudFormation cloudFormation, CreateStackResult stack) { DescribeStacksRequest describeStacksRequest = new DescribeStacksRequest(); describeStacksRequest.setStackName(stack.getStackId()); final DescribeStacksResult describeStacksResult = cloudFormation .describeStacks(describeStacksRequest); Properties outputProps = new Properties(); for (Stack st : describeStacksResult.getStacks()) { StringBuilder outputsStr = new StringBuilder("Infrastructure/Deployment outputs {\n"); for (Output output : st.getOutputs()) { outputProps.setProperty(output.getOutputKey(), output.getOutputValue()); outputsStr.append(output.getOutputKey()).append("=").append(output.getOutputValue()).append("\n"); } //Log cfn outputs logger.info(outputsStr.toString() + "\n}"); } return outputProps; }
result = createStackResult = createStack(); ctx = new WaitForStackCommand.WaitForStackContext(createStackResult.getStackId(), getService(), this::info, 30, asList(StackStatus.CREATE_COMPLETE)); } else { getLog().info("Must Update Stack");
logger.info(StringUtil.concatStrings("Stack : ", stackName, ", with ID : ", stack.getStackId(), " creation completed in ", duration, ".")); logEC2SshAccessDetails(stack.getStackId(), inputs);
getLogger().info("create requested: {}", createStackResult.getStackId());