@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackSummaries() == null) ? 0 : getStackSummaries().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page * exists, this value is null. * </p> * * @param nextToken * If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional * page exists, this value is null. * @return Returns a reference to this object so that method calls can be chained together. */ public ListStacksResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
/** * <p> * A list of <code>StackSummary</code> structures containing information about the specified stacks. * </p> * * @param stackSummaries * A list of <code>StackSummary</code> structures containing information about the specified stacks. * @return Returns a reference to this object so that method calls can be chained together. */ public ListStacksResult withStackSummaries(java.util.Collection<StackSummary> stackSummaries) { setStackSummaries(stackSummaries); return this; }
@TaskAction public void listStacks(){ client.listStacks() .getStackSummaries() .stream() .filter(summary -> summary.getDeletionTime() == null) .forEach(stackSummary -> System.out.println(stackSummary.getStackName())); } }
public ListStacksResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListStacksResult listStacksResult = new ListStacksResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return listStacksResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("StackSummaries", targetDepth)) { listStacksResult.withStackSummaries(new ArrayList<StackSummary>()); continue; } if (context.testExpression("StackSummaries/member", targetDepth)) { listStacksResult.withStackSummaries(StackSummaryStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listStacksResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return listStacksResult; } } } }
private List<StackSummary> getAllRunningStacks() { client = new AmazonCloudFormationClient(new AWSCredentials() { public String getAWSAccessKeyId() { return awsAccessKey; } public String getAWSSecretKey() { return awsSecretKey; } }); List<String> stackStatusFilters = new ArrayList<String>(); stackStatusFilters.add("UPDATE_COMPLETE"); stackStatusFilters.add("CREATE_COMPLETE"); stackStatusFilters.add("ROLLBACK_COMPLETE"); ListStacksRequest listStacksRequest = new ListStacksRequest(); listStacksRequest.setStackStatusFilters(stackStatusFilters); ListStacksResult result = client.listStacks(listStacksRequest); List<StackSummary> stackSummaries = result.getStackSummaries(); return stackSummaries; }
public ListStacksResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListStacksResult listStacksResult = new ListStacksResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return listStacksResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("StackSummaries", targetDepth)) { listStacksResult.withStackSummaries(new ArrayList<StackSummary>()); continue; } if (context.testExpression("StackSummaries/member", targetDepth)) { listStacksResult.withStackSummaries(StackSummaryStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("NextToken", targetDepth)) { listStacksResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return listStacksResult; } } } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListStacksResult == false) return false; ListStacksResult other = (ListStacksResult) obj; if (other.getStackSummaries() == null ^ this.getStackSummaries() == null) return false; if (other.getStackSummaries() != null && other.getStackSummaries().equals(this.getStackSummaries()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false) return false; return true; }
/** * <p> * A list of <code>StackSummary</code> structures containing information about the specified stacks. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setStackSummaries(java.util.Collection)} or {@link #withStackSummaries(java.util.Collection)} if you want * to override the existing values. * </p> * * @param stackSummaries * A list of <code>StackSummary</code> structures containing information about the specified stacks. * @return Returns a reference to this object so that method calls can be chained together. */ public ListStacksResult withStackSummaries(StackSummary... stackSummaries) { if (this.stackSummaries == null) { setStackSummaries(new com.amazonaws.internal.SdkInternalList<StackSummary>(stackSummaries.length)); } for (StackSummary ele : stackSummaries) { this.stackSummaries.add(ele); } return this; }
/** * <p> * If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional page * exists, this value is null. * </p> * * @param nextToken * If the output exceeds 1 MB in size, a string that identifies the next page of stacks. If no additional * page exists, this value is null. * @return Returns a reference to this object so that method calls can be chained together. */ public ListStacksResult withNextToken(String nextToken) { setNextToken(nextToken); 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 (getStackSummaries() != null) sb.append("StackSummaries: ").append(getStackSummaries()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
/** * <p> * A list of <code>StackSummary</code> structures containing information about the specified stacks. * </p> * * @param stackSummaries * A list of <code>StackSummary</code> structures containing information about the specified stacks. * @return Returns a reference to this object so that method calls can be chained together. */ public ListStacksResult withStackSummaries(java.util.Collection<StackSummary> stackSummaries) { setStackSummaries(stackSummaries); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStackSummaries() == null) ? 0 : getStackSummaries().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); return hashCode; }
/** * <p> * A list of <code>StackSummary</code> structures containing information about the specified stacks. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setStackSummaries(java.util.Collection)} or {@link #withStackSummaries(java.util.Collection)} if you want * to override the existing values. * </p> * * @param stackSummaries * A list of <code>StackSummary</code> structures containing information about the specified stacks. * @return Returns a reference to this object so that method calls can be chained together. */ public ListStacksResult withStackSummaries(StackSummary... stackSummaries) { if (this.stackSummaries == null) { setStackSummaries(new com.amazonaws.internal.SdkInternalList<StackSummary>(stackSummaries.length)); } for (StackSummary ele : stackSummaries) { this.stackSummaries.add(ele); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListStacksResult == false) return false; ListStacksResult other = (ListStacksResult) obj; if (other.getStackSummaries() == null ^ this.getStackSummaries() == null) return false; if (other.getStackSummaries() != null && other.getStackSummaries().equals(this.getStackSummaries()) == false) return false; if (other.getNextToken() == null ^ this.getNextToken() == null) return false; if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == 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 (getStackSummaries() != null) sb.append("StackSummaries: ").append(getStackSummaries()).append(","); if (getNextToken() != null) sb.append("NextToken: ").append(getNextToken()); sb.append("}"); return sb.toString(); }
result.getStackSummaries().stream().filter(x -> namePattern.matcher(x.getStackName()).matches()).findFirst(); nextToken = result.getNextToken(); } while (null != nextToken);