org.figure8.join.businessfacades.reporting
Class DefaultReportingManager

java.lang.Object
  extended by org.figure8.join.businessfacades.reporting.DefaultReportingManager
All Implemented Interfaces:
ReportingManager

public class DefaultReportingManager
extends java.lang.Object
implements ReportingManager

This is the default implementation of ReportingManager.

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Constructor Summary
DefaultReportingManager()
          Creates a new instance of DefaultReportingManager
 
Method Summary
 Event getEvent(java.lang.String key)
          Retrieve an Event using its unique key
 java.util.List getEvents()
          Retrieve all already registered events
 MailingList getMailingList(Event event, java.lang.String resourceId)
          Retrieve the mailing list corresponding to an event on a specified resource
 MailingList getMailingList(java.lang.String name)
          Retrieve a MailigList using its name
 java.util.List getMailingLists()
          Retrieve all the existing mailing lists
 java.util.List getMailingLists(Event event)
          Retrieve the mailing list corresponding to an event
 Message getMessage(long id)
          Retrieve a message using its unique identifier
 java.util.List getMessages(java.util.Date startDate, java.util.Date endDate, Release release)
          Retrieve the messages published between startDate and endDate for a release
 java.util.List getOpenMessages(Release release)
          Retrieve the currently opened messages (ie : published) for a release
 java.util.List getSubscriptionsForUser(java.lang.String subscriberId)
          Retrieve all subscriptions corresponding to a subscriber
 void saveMailingList(MailingList list)
          Save a MilingList within datastore (create or update)
 void saveMessage(Message message)
          Save a Message within datastore (create or update)
 void setEventDao(EventDao dao)
           
 void setMailingListDao(MailingListDao dao)
           
 void setMessageDao(MessageDao dao)
           
 void setSubscriptionDao(SubscriptionDao dao)
           
 void susbcribeUser(java.lang.String subscriberId, java.util.List mailingLists)
          Subscribe a user to a set of mailing lists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultReportingManager

public DefaultReportingManager()
Creates a new instance of DefaultReportingManager

Method Detail

setEventDao

public void setEventDao(EventDao dao)
Parameters:
dao - The EventDao implementation to use

setMessageDao

public void setMessageDao(MessageDao dao)
Parameters:
dao - The MessageDao implementation to use

setMailingListDao

public void setMailingListDao(MailingListDao dao)
Parameters:
dao - The MailingListDao implementation to use

setSubscriptionDao

public void setSubscriptionDao(SubscriptionDao dao)
Parameters:
dao - The SubscriptionDao implementation to use

getEvents

public java.util.List getEvents()
Retrieve all already registered events

Specified by:
getEvents in interface ReportingManager
Returns:
A list of org.figure8.join.businessobjects.reporting.Event objects

getEvent

public Event getEvent(java.lang.String key)
Retrieve an Event using its unique key

Specified by:
getEvent in interface ReportingManager
Parameters:
key - The key of Event to retrieve
Returns:
The Event having this key or null if no one match

saveMessage

public void saveMessage(Message message)
Save a Message within datastore (create or update)

Specified by:
saveMessage in interface ReportingManager
Parameters:
message - The message to save

getOpenMessages

public java.util.List getOpenMessages(Release release)
Retrieve the currently opened messages (ie : published) for a release

Specified by:
getOpenMessages in interface ReportingManager
Parameters:
release - The release to filter messages for (may be null)
Returns:
A list of {org.figure8.join.businessobjects.reporting.Message}s

getMessages

public java.util.List getMessages(java.util.Date startDate,
                                  java.util.Date endDate,
                                  Release release)
Retrieve the messages published between startDate and endDate for a release

Specified by:
getMessages in interface ReportingManager
Parameters:
startDate - The date of messages research start
endDate - The date of messages research end
release - The release to filter messages for (may be null)
Returns:
A list of {org.figure8.join.businessobjects.reporting.Message}s

getMessage

public Message getMessage(long id)
Retrieve a message using its unique identifier

Specified by:
getMessage in interface ReportingManager
Parameters:
id - Identifier of message to retrieve
Returns:
The message having this id or null if not found.

saveMailingList

public void saveMailingList(MailingList list)
                     throws DuplicateEntityException
Save a MilingList within datastore (create or update)

Specified by:
saveMailingList in interface ReportingManager
Parameters:
list - The mailing list to save
Throws:
DuplicateEntityException - if another list with same name already exists

getMailingLists

public java.util.List getMailingLists(Event event)
Retrieve the mailing list corresponding to an event

Specified by:
getMailingLists in interface ReportingManager
Parameters:
event - The event to get lists for
Returns:
A list of org.figure8.join.businessobjects.reporting.MailingList objects

getMailingLists

public java.util.List getMailingLists()
Retrieve all the existing mailing lists

Specified by:
getMailingLists in interface ReportingManager
Returns:
A list of all the existing MailingLists

getMailingList

public MailingList getMailingList(java.lang.String name)
Retrieve a MailigList using its name

Specified by:
getMailingList in interface ReportingManager
Parameters:
name - The name of mailing list to retrieve
Returns:
The mailing list having this name or null if no correspondance found

getMailingList

public MailingList getMailingList(Event event,
                                  java.lang.String resourceId)
Retrieve the mailing list corresponding to an event on a specified resource

Specified by:
getMailingList in interface ReportingManager
Parameters:
event - The event to get lists for
resourceId - The identifier of resource to whom event applies
Returns:
A org.figure8.join.businessobjects.reporting.MailingList object

susbcribeUser

public void susbcribeUser(java.lang.String subscriberId,
                          java.util.List mailingLists)
Subscribe a user to a set of mailing lists. This will also unsubscribe user from existing mailing lists that are not present into given set.

Specified by:
susbcribeUser in interface ReportingManager
Parameters:
subscriberId - Unique identifier of user to register subscriptions
mailingLists - A list of org.figure8.join.businessobjects.reporting.MailingList objects

getSubscriptionsForUser

public java.util.List getSubscriptionsForUser(java.lang.String subscriberId)
Retrieve all subscriptions corresponding to a subscriber

Specified by:
getSubscriptionsForUser in interface ReportingManager
Parameters:
subscriberId - Unique identifier of user having subscriptions
Returns:
A list of org.figure8.join.businessobjects.reporting.Subscription


Copyright © 2005-2008 Join. All Rights Reserved.