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

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

Introduction

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

Prototype


public java.util.List<Job> getJobs() 

Source Link

Document

An array of Job objects that are in the specified pipeline.

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 ww w .ja v  a  2  s.co 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;
}