Example usage for com.amazonaws.services.elastictranscoder.model ListJobsByPipelineResult getNextPageToken

List of usage examples for com.amazonaws.services.elastictranscoder.model ListJobsByPipelineResult getNextPageToken

Introduction

In this page you can find the example usage for com.amazonaws.services.elastictranscoder.model ListJobsByPipelineResult getNextPageToken.

Prototype


public String getNextPageToken() 

Source Link

Document

A value that you use to access the second and subsequent pages of results, if any.

Usage

From source file:org.alanwilliamson.amazon.transcoder.job.List.java

License:Open Source License

public cfData execute(cfSession _session, cfArgStructData argStruct) throws cfmRunTimeException {
    AmazonKey amazonKey = getAmazonKey(_session, argStruct);
    AmazonElasticTranscoder et = getAmazonElasticTranscoder(amazonKey);

    String pipelineid = getNamedStringParam(argStruct, "pipelineid", null);
    if (pipelineid == null)
        throwException(_session, "Please specify a pipelineid");

    try {/*from w  ww  .ja  v  a2s. c  o m*/
        cfArrayData jobs = cfArrayData.createArray(1);

        ListJobsByPipelineRequest listObjectsRequest = new ListJobsByPipelineRequest();

        ListJobsByPipelineResult lpr;

        do {
            lpr = et.listJobsByPipeline(listObjectsRequest);

            for (Job job : lpr.getJobs())
                jobs.addElement(getJob(job));

            listObjectsRequest.setPageToken(lpr.getNextPageToken());
        } while (listObjectsRequest.getPageToken() != null);

        return jobs;

    } catch (Exception e) {
        throwException(_session, "AmazonElasticTranscoder: " + e.getMessage());
    }

    return cfBooleanData.TRUE;
}