1 /*
2 * Licensed to The Apereo Foundation under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work for additional
4 * information regarding copyright ownership.
5 *
6 *
7 * The Apereo Foundation licenses this file to you under the Educational
8 * Community License, Version 2.0 (the "License"); you may not use this file
9 * except in compliance with the License. You may obtain a copy of the License
10 * at:
11 *
12 * http://opensource.org/licenses/ecl2.txt
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17 * License for the specific language governing permissions and limitations under
18 * the License.
19 *
20 */
21 package org.opencastproject.transcription.persistence;
22
23 import java.util.Date;
24 import java.util.List;
25
26 /*
27 * Interface for transcription service database.
28 */
29 public interface TranscriptionDatabase {
30
31 /*
32 * Store transcription service job
33 */
34 TranscriptionJobControl storeJobControl(String mpId, String trackId, String jobId, String jobStatus,
35 long trackDuration, Date dateExpected, String provider) throws TranscriptionDatabaseException;
36
37 /*
38 * Store transcription provider
39 */
40 TranscriptionProviderControl storeProviderControl(String provider) throws TranscriptionDatabaseException;
41
42 /*
43 * Delete transcription job
44 */
45 void deleteJobControl(String jobId) throws TranscriptionDatabaseException;
46
47 /*
48 * Update transcription job
49 */
50 void updateJobControl(String jobId, String jobStatus) throws TranscriptionDatabaseException;
51
52 /*
53 * Get transcription job by job Id
54 */
55 TranscriptionJobControl findByJob(String jobId) throws TranscriptionDatabaseException;
56
57 /*
58 * Get transcription service job list by mediapackage Id
59 */
60 List<TranscriptionJobControl> findByMediaPackage(String mpId) throws TranscriptionDatabaseException;
61
62 /*
63 * Get transcription service job list by transcription status
64 */
65 List<TranscriptionJobControl> findByStatus(String... status) throws TranscriptionDatabaseException;
66
67 /*
68 * Get transcription service job list by mediapackage Id, track Id and transcription status
69 */
70 List<TranscriptionJobControl> findByMediaPackageTrackAndStatus(String mpId, String trackId, String... status)
71 throws TranscriptionDatabaseException;
72
73 /*
74 * Find transcription provider ID by provider name
75 */
76 TranscriptionProviderControl findIdByProvider(String provider) throws TranscriptionDatabaseException;
77
78 /*
79 * Find transcription provider name by provider ID
80 */
81 TranscriptionProviderControl findProviderById(Long id) throws TranscriptionDatabaseException;
82 }