1 /**
2 * Copyright 2005-2006 the original author or authors.
3 *
4 * Licensed under the Gnu General Pubic License, Version 2.0 (the
5 * "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/gpl-license.php
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the Gnu General Public License for more details.
14 */
15 package org.figure8.join.businessfacades.reporting;
16
17 import org.figure8.join.core.DuplicateEntityException;
18 import org.figure8.join.businessobjects.commons.Release;
19 import org.figure8.join.businessobjects.reporting.Event;
20 import org.figure8.join.businessobjects.reporting.Message;
21 import org.figure8.join.businessobjects.reporting.MailingList;
22
23 import java.util.Date;
24 import java.util.List;
25 /**
26 * This is a business facades that exposes all methods related to Join reporting services.
27 * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
28 * @version $Revision: 1.3 $
29 */
30 public interface ReportingManager{
31
32
33
34 /**
35 * Retrieve all already registered events
36 * @return A list of {@code org.figure8.join.businessobjects.reporting.Event} objects
37 */
38 public abstract List getEvents();
39
40 /**
41 * Retrieve an Event using its unique key
42 * @param key The key of Event to retrieve
43 * @return The Event having this key or null if no one match
44 */
45 public abstract Event getEvent(String key);
46
47 /**
48 * Save a Message within datastore (create or update)
49 * @param message The message to save
50 */
51 public abstract void saveMessage(Message message);
52
53 /**
54 * Retrieve the currently opened messages (ie : published) for a release
55 * @param release The release to filter messages for (may be null)
56 * @return A list of {org.figure8.join.businessobjects.reporting.Message}s
57 */
58 public abstract List getOpenMessages(Release release);
59
60 /**
61 * Retrieve the messages published between startDate and endDate for a release
62 * @param startDate The date of messages research start
63 * @param endDate The date of messages research end
64 * @param release The release to filter messages for (may be null)
65 * @return A list of {org.figure8.join.businessobjects.reporting.Message}s
66 */
67 public abstract List getMessages(Date startDate, Date endDate, Release release);
68
69 /**
70 * Retrieve a message using its unique identifier
71 * @param id Identifier of message to retrieve
72 * @return The message having this id or null if not found.
73 */
74 public abstract Message getMessage(long id);
75
76 /**
77 * Save a MilingList within datastore (create or update)
78 * @param list The mailing list to save
79 * @throws DuplicateEntityException if another list with same name already exists
80 */
81 public abstract void saveMailingList(MailingList list) throws DuplicateEntityException;
82
83 /**
84 * Retrieve the mailing list corresponding to an event
85 * @param event The event to get lists for
86 * @return A list of {@code org.figure8.join.businessobjects.reporting.MailingList} objects
87 */
88 public abstract List getMailingLists(Event event);
89
90 /**
91 * Retrieve all the existing mailing lists
92 * @return A list of all the existing {@code MailingList}s
93 */
94 public abstract List getMailingLists();
95
96 /**
97 * Retrieve a MailigList using its name
98 * @param name The name of mailing list to retrieve
99 * @return The mailing list having this name or null if no correspondance found
100 */
101 public abstract MailingList getMailingList(String name);
102
103 /**
104 * Retrieve the mailing list corresponding to an event on a specified resource
105 * @param event The event to get lists for
106 * @param resourceId The identifier of resource to whom event applies
107 * @return A {@code org.figure8.join.businessobjects.reporting.MailingList} object
108 */
109 public abstract MailingList getMailingList(Event event, String resourceId);
110
111 /**
112 * Subscribe a user to a set of mailing lists. This will also unsubscribe
113 * user from existing mailing lists that are not present into given set.
114 * @param subscriberId Unique identifier of user to register subscriptions
115 * @param mailingLists A list of {@code org.figure8.join.businessobjects.reporting.MailingList} objects
116 */
117 public abstract void susbcribeUser(String subscriberId, List mailingLists);
118
119 /**
120 * Retrieve all subscriptions corresponding to a subscriber
121 * @param subscriberId Unique identifier of user having subscriptions
122 * @return A list of {@code org.figure8.join.businessobjects.reporting.Subscription}
123 */
124 public abstract List getSubscriptionsForUser(String subscriberId);
125 }