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);
}
}
Aggregations