use of com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse 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());
}
}
}
use of com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse in project cos-java-sdk-v5 by tencentyun.
the class MediaQueueTest method describeMediaQueuesTest.
@Test
public void describeMediaQueuesTest() {
if (!judgeUserInfoValid()) {
return;
}
MediaQueueRequest request = new MediaQueueRequest();
request.setBucketName(bucket);
MediaListQueueResponse response = cosclient.describeMediaQueues(request);
if (response != null && response.getQueueList().size() != 0) {
assertNotEquals("0", response.getTotalCount());
assertTrue(Integer.parseInt(response.getTotalCount()) > 0);
assertTrue(Integer.parseInt(response.getPageSize()) > 0);
assertTrue(Integer.parseInt(response.getPageNumber()) > 0);
assertEquals(bucket, response.getQueueList().get(0).getBucketId());
}
}
use of com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse 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());
}
}
}
use of com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse in project cos-java-sdk-v5 by tencentyun.
the class MediaQueueTest method updateMediaQueueTest.
@Test
public void updateMediaQueueTest() {
if (!judgeUserInfoValid()) {
return;
}
MediaQueueRequest request = new MediaQueueRequest();
request.setBucketName(bucket);
MediaListQueueResponse response = cosclient.describeMediaQueues(request);
if (response != null) {
List<MediaQueueObject> queueList = response.getQueueList();
if (queueList.size() != 0) {
MediaQueueObject mediaQueueObject = queueList.get(0);
request = new MediaQueueRequest();
request.setBucketName(bucket);
request.setQueueId(mediaQueueObject.getQueueId());
request.getNotifyConfig().setUrl(QUEUE_URL);
request.setState(QUEUE_STATE);
request.setName(QUEUE_NAME);
MediaQueueResponse updateResponse = cosclient.updateMediaQueue(request);
MediaQueueObject queue = updateResponse.getQueue();
assertEquals(bucket, queue.getBucketId());
assertEquals(QUEUE_NAME, queue.getName());
assertEquals(QUEUE_STATE, queue.getState());
}
}
}
use of com.qcloud.cos.model.ciModel.queue.MediaListQueueResponse in project cos-java-sdk-v5 by tencentyun.
the class QueueDemo method describeMediaQueues.
/**
* DescribeMediaQueues 接口用于搜索队列。
* @param client
*/
public static void describeMediaQueues(COSClient client) {
// 1.创建队列请求对象
MediaQueueRequest request = new MediaQueueRequest();
// 2.添加请求参数 参数详情请见api接口文档
request.setBucketName("DemoBucket-123456789");
// 3.调用接口,获取队列响应对象
MediaListQueueResponse response = client.describeMediaQueues(request);
System.out.println(response);
}
Aggregations