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  package org.opencastproject.event.comment;
22  
23  import org.opencastproject.util.NotFoundException;
24  
25  import java.util.List;
26  
27  public interface EventCommentService {
28    /**
29     * Get the available reasons for commenting on an event.
30     *
31     * @return A list of reasons of why a comment was made.
32     * @throws EventCommentException
33     *           Thrown if there was an issue getting the comment reasons.
34     */
35    List<String> getReasons() throws EventCommentException;
36  
37    /**
38     * Get a comment for a particular event.
39     * @param commentId
40     *          The id for the comment.
41     *
42     * @return The comment
43     * @throws NotFoundException
44     *           Thrown if the comment cannot be found.
45     * @throws EventCommentException
46     *           Thrown if there was an issue getting the comment.
47     */
48    EventComment getComment(long commentId) throws NotFoundException, EventCommentException;
49  
50    /**
51     * Get all of the comments for an event.
52     *
53     * @param eventId
54     *          The id of the event to get the comments for (mediapackage id).
55     * @return The {@link List} of comments.
56     * @throws EventCommentException
57     *           Thrown if there was a problem getting the comments.
58     */
59    List<EventComment> getComments(String eventId) throws EventCommentException;
60  
61    /**
62     * Delete a comment from an event.
63     * @param commentId
64     *          The id of the comment.
65     *
66     * @throws NotFoundException
67     *           Thrown if cannot find the event / comment.
68     * @throws EventCommentException
69     *           Thrown if there is a problem deleting the comment.
70     */
71    void deleteComment(long commentId) throws NotFoundException, EventCommentException;
72  
73    /**
74     * Delete all comments from an event.
75     * @param eventId
76     *          The id of the event to get the comments for (mediapackage id).
77     *
78     * @throws NotFoundException
79     *           Thrown if cannot find the event
80     * @throws EventCommentException
81     *           Thrown if there is a problem deleting the comments.
82     */
83    void deleteComments(String eventId) throws NotFoundException, EventCommentException;
84  
85    /**
86     * Update a comment.
87     * @param comment
88     *          The new comment status to update to.
89     *
90     * @return The comment updated.
91     * @throws EventCommentException
92     *           Thrown if there is a problem updating the comment.
93     */
94    EventComment updateComment(EventComment comment) throws EventCommentException;
95  }