Search in sources :

Example 1 with FileUploadTask

use of com.tencentcloudapi.vod.v20180717.models.FileUploadTask in project cloud-sdk by mizhousoft.

the class QCloudVODServiceImpl method convertToEvent.

private VodEvent convertToEvent(EventContent content) {
    String eventId = content.getEventHandle();
    String eventType = content.getEventType();
    if ("NewFileUpload".equals(eventType)) {
        FileUploadTask uploadTask = content.getFileUploadEvent();
        MediaMeta mediaMeta = buildMediaMeta(uploadTask.getFileId(), uploadTask.getMediaBasicInfo(), uploadTask.getMetaData(), null);
        return new VodNewFileUploadEvent(eventId, mediaMeta);
    } else if ("ProcedureStateChanged".equals(eventType)) {
        ProcedureTask precTask = content.getProcedureStateChangeEvent();
        boolean completed = "FINISH".equals(precTask.getStatus());
        return new VodStateChangedEvent(eventId, precTask.getFileId(), completed);
    } else if ("FileDeleted".equals(eventType)) {
        FileDeleteTask deleteTask = content.getFileDeleteEvent();
        return new VodFileDeletedEvent(eventId, deleteTask.getFileIdSet());
    } else {
        return new VodEvent(eventId);
    }
}
Also used : VodFileDeletedEvent(com.mizhousoft.cloudsdk.vod.event.VodFileDeletedEvent) FileUploadTask(com.tencentcloudapi.vod.v20180717.models.FileUploadTask) FileDeleteTask(com.tencentcloudapi.vod.v20180717.models.FileDeleteTask) ProcedureTask(com.tencentcloudapi.vod.v20180717.models.ProcedureTask) VodNewFileUploadEvent(com.mizhousoft.cloudsdk.vod.event.VodNewFileUploadEvent) MediaMeta(com.mizhousoft.cloudsdk.vod.MediaMeta) VodStateChangedEvent(com.mizhousoft.cloudsdk.vod.event.VodStateChangedEvent) VodEvent(com.mizhousoft.cloudsdk.vod.event.VodEvent)

Aggregations

MediaMeta (com.mizhousoft.cloudsdk.vod.MediaMeta)1 VodEvent (com.mizhousoft.cloudsdk.vod.event.VodEvent)1 VodFileDeletedEvent (com.mizhousoft.cloudsdk.vod.event.VodFileDeletedEvent)1 VodNewFileUploadEvent (com.mizhousoft.cloudsdk.vod.event.VodNewFileUploadEvent)1 VodStateChangedEvent (com.mizhousoft.cloudsdk.vod.event.VodStateChangedEvent)1 FileDeleteTask (com.tencentcloudapi.vod.v20180717.models.FileDeleteTask)1 FileUploadTask (com.tencentcloudapi.vod.v20180717.models.FileUploadTask)1 ProcedureTask (com.tencentcloudapi.vod.v20180717.models.ProcedureTask)1