Search in sources :

Example 1 with MediaJobObject

use of com.qcloud.cos.model.ciModel.job.MediaJobObject in project cos-java-sdk-v5 by tencentyun.

the class MediaJobTest method describeMediaJobsTest.

@Test
public void describeMediaJobsTest() {
    if (!judgeUserInfoValid()) {
        return;
    }
    MediaQueueRequest queueRequest = new MediaQueueRequest();
    queueRequest.setBucketName(bucket);
    MediaListQueueResponse queueResponse = cosclient.describeMediaQueues(queueRequest);
    if (queueResponse != null && queueResponse.getQueueList().size() != 0) {
        MediaJobsRequest request = new MediaJobsRequest();
        request.setBucketName(bucket);
        String queueId = queueResponse.getQueueList().get(0).getQueueId();
        request.setQueueId(queueId);
        request.setTag(TAG);
        MediaListJobResponse response = cosclient.describeMediaJobs(request);
        List<MediaJobObject> jobsDetail = response.getJobsDetailList();
        for (MediaJobObject mediaJobObject : jobsDetail) {
            assertEquals(TAG, mediaJobObject.getTag());
            assertEquals(queueId, mediaJobObject.getQueueId());
        }
    }
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) MediaQueueRequest(com.qcloud.cos.model.ciModel.queue.MediaQueueRequest) MediaListQueueResponse(com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse) MediaJobObject(com.qcloud.cos.model.ciModel.job.MediaJobObject) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse) Test(org.junit.Test)

Example 2 with MediaJobObject

use of com.qcloud.cos.model.ciModel.job.MediaJobObject in project cos-java-sdk-v5 by tencentyun.

the class JobDemo method describeMediaJobs.

/**
 * describeMediaJobs 查询任务列表
 *
 * @param client
 */
public static void describeMediaJobs(COSClient client) {
    // 1.创建任务请求对象
    MediaJobsRequest request = new MediaJobsRequest();
    // 2.添加请求参数 参数详情请见api接口文档
    request.setBucketName("DemoBucket-123456789");
    request.setQueueId("p9900025e4ec44b5e8225e70a5217****");
    request.setTag("Transcode");
    // 3.调用接口,获取任务响应对象
    MediaListJobResponse response = client.describeMediaJobs(request);
    List<MediaJobObject> jobsDetail = response.getJobsDetailList();
    for (MediaJobObject mediaJobObject : jobsDetail) {
        System.out.println(mediaJobObject.getOperation().getTranscode());
    }
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) MediaJobObject(com.qcloud.cos.model.ciModel.job.MediaJobObject) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse)

Example 3 with MediaJobObject

use of com.qcloud.cos.model.ciModel.job.MediaJobObject in project cos-java-sdk-v5 by tencentyun.

the class MediaJobTest method describeMediaJobTest.

@Test
public void describeMediaJobTest() {
    if (!judgeUserInfoValid()) {
        return;
    }
    MediaQueueRequest queueRequest = new MediaQueueRequest();
    queueRequest.setBucketName(bucket);
    MediaListQueueResponse queueResponse = cosclient.describeMediaQueues(queueRequest);
    if (queueResponse != null && queueResponse.getQueueList().size() != 0) {
        MediaJobsRequest request = new MediaJobsRequest();
        request.setBucketName(bucket);
        String queueId = queueResponse.getQueueList().get(0).getQueueId();
        request.setQueueId(queueId);
        request.setTag(TAG);
        MediaListJobResponse response = cosclient.describeMediaJobs(request);
        List<MediaJobObject> jobsDetail = response.getJobsDetailList();
        for (MediaJobObject mediaJobObject : jobsDetail) {
            request = new MediaJobsRequest();
            request.setBucketName(bucket);
            request.setJobId(mediaJobObject.getJobId());
            MediaJobResponse jobResponse = cosclient.describeMediaJob(request);
            System.out.println(jobResponse);
            assertEquals(queueId, jobResponse.getJobsDetail().getQueueId());
        }
    }
}
Also used : MediaJobsRequest(com.qcloud.cos.model.ciModel.job.MediaJobsRequest) MediaQueueRequest(com.qcloud.cos.model.ciModel.queue.MediaQueueRequest) MediaJobResponse(com.qcloud.cos.model.ciModel.job.MediaJobResponse) MediaListQueueResponse(com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse) MediaJobObject(com.qcloud.cos.model.ciModel.job.MediaJobObject) MediaListJobResponse(com.qcloud.cos.model.ciModel.job.MediaListJobResponse) Test(org.junit.Test)

Aggregations

MediaJobObject (com.qcloud.cos.model.ciModel.job.MediaJobObject)3 MediaJobsRequest (com.qcloud.cos.model.ciModel.job.MediaJobsRequest)3 MediaListJobResponse (com.qcloud.cos.model.ciModel.job.MediaListJobResponse)3 MediaListQueueResponse (com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse)2 MediaQueueRequest (com.qcloud.cos.model.ciModel.queue.MediaQueueRequest)2 Test (org.junit.Test)2 MediaJobResponse (com.qcloud.cos.model.ciModel.job.MediaJobResponse)1