Example usage for com.amazonaws.services.cloudformation.model DescribeStacksRequest getNextToken

List of usage examples for com.amazonaws.services.cloudformation.model DescribeStacksRequest getNextToken

Introduction

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

Prototype


public String getNextToken() 

Source Link

Document

A string that identifies the next page of stacks that you want to retrieve.

Usage

From source file:org.xmlsh.aws.cfnDescribeStacks.java

License:BSD License

private int describe(String name) throws IOException, XMLStreamException, SaxonApiException, CoreException {

    OutputPort stdout = getStdout();/*  w  ww.j  a v a 2 s .  co  m*/
    mWriter = new SafeXMLStreamWriter(stdout.asXMLStreamWriter(getSerializeOpts()));

    startDocument();
    startElement(getName());

    DescribeStacksRequest request = new DescribeStacksRequest();
    if (name != null)
        request.setStackName(name);

    traceCall("describeStacks");

    DescribeStacksResult result = getAWSClient().describeStacks(request);

    do {
        for (Stack stack : result.getStacks()) {
            writeStack(stack);
        }
        request.setNextToken(result.getNextToken());
    } while (request.getNextToken() != null);

    endElement();
    endDocument();
    closeWriter();

    stdout.writeSequenceTerminator(getSerializeOpts());

    return 0;

}