View Javadoc
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  
22  package org.opencastproject.editor.api;
23  
24  import org.opencastproject.security.api.UnauthorizedException;
25  
26  import java.io.IOException;
27  
28  /**
29   * Api for the Editor Service
30   */
31  public interface EditorService {
32  
33    String JOB_TYPE = "org.opencastproject.editor";
34  
35    /** The default file name for generated Smil catalogs. */
36    String TARGET_FILE_NAME = "cut.smil";
37  
38    /**
39     * Provide information to edit video and audio data relevant to the given mediaPackageId
40     */
41    EditingData getEditData(String mediaPackageId)
42            throws EditorServiceException, UnauthorizedException;
43  
44    /**
45     * Create or refresh lock for the mediapackage
46     * @param mediaPackageId
47     * @param lockData identify the owner of the lock
48     * @throws EditorServiceException if invalid mediapackge or locked by other
49     */
50    void  lockMediaPackage(String mediaPackageId, LockData lockData) throws EditorServiceException;
51  
52    /**
53     * Remove lock for the mediapackage
54     * @param mediaPackageId
55     * @param lockData identify the owner of the lock
56     * @throws EditorServiceException if invalid mediapackge or locked by other
57     */
58    void unlockMediaPackage(String mediaPackageId, LockData lockData) throws EditorServiceException;
59  
60    /**
61     * Store information about edited data relevant to the given mediaPackageId
62     * @param editingData
63     */
64    void setEditData(String mediaPackageId, EditingData editingData) throws EditorServiceException, IOException;
65  
66    /**
67     * Provide all meta information about the given mediaPackageId
68     */
69    String getMetadata(String mediaPackageId) throws EditorServiceException;
70  }