Example usage for com.amazonaws.services.elastictranscoder.model ListJobsByPipelineRequest getPageToken

List of usage examples for com.amazonaws.services.elastictranscoder.model ListJobsByPipelineRequest getPageToken

Introduction

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

Prototype


public String getPageToken() 

Source Link

Document

When Elastic Transcoder returns more than one page of results, use pageToken in subsequent GET requests to get each successive page of results.

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 {/* w ww.  j  a v a 2s . 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;
}