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.usertracking.api;
23  
24  import java.util.Calendar;
25  
26  /**
27   * A class that represents a report
28   *
29   */
30  public interface Report {
31  
32    /**
33     * Sets the the date the data of the report starts from
34     *
35     * @param from
36     */
37    void setFrom(Calendar from);
38  
39    /**
40     * Sets the date the data of the report is referring to
41     *
42     * @param to
43     */
44    void setTo(Calendar to);
45  
46    /**
47     * Sets the sum of views of all report items
48     *
49     * @param views
50     */
51    void setViews(int views);
52  
53    /**
54     * Sets the sum of the number of played seconds of all report items
55     *
56     * @param played
57     */
58    void setPlayed(long played);
59  
60    /**
61     * Sets the total of report items
62     *
63     * @param total
64     */
65    void setTotal(int total);
66  
67    /**
68     * Sets the maximum number of report items of the report (used for paging)
69     *
70     * @param limit
71     */
72    void setLimit(int limit);
73  
74    /**
75     * Sets the number of the report item to start with in the list of all report items (used for paging)
76     *
77     * @param offset
78     */
79    void setOffset(int offset);
80  
81    /**
82     * Add an report item to the report
83     *
84     * @param reportItem
85     */
86    void add(ReportItem reportItem);
87  
88    /**
89     * Gets the date the data of the report starts from
90     *
91     * @return
92     */
93    Calendar getFrom();
94  
95    /**
96     * Gets the date the data of the report is referring to
97     *
98     * @return
99     */
100   Calendar getTo();
101 
102   /**
103    * Gets the sum of views of all report items
104    *
105    * @return
106    */
107   int getViews();
108 
109   /**
110    * Gets the sum of the number of played seconds of all report items
111    *
112    * @return
113    */
114   long getPlayed();
115 
116   /**
117    * Gets the total of report items
118    *
119    * @return
120    */
121   int getTotal();
122 
123   /**
124    * Gets the maximum number of report items of the report (used for paging)
125    *
126    * @return
127    */
128   int getLimit();
129 
130   /**
131    * Gets the number of the report item to start with in the list of all report items (used for paging)
132    *
133    * @return
134    */
135   int getOffset();
136 
137 }