org.itracker.services.implementations
Class NotificationServiceImpl

java.lang.Object
  extended by org.itracker.services.implementations.NotificationServiceImpl
All Implemented Interfaces:
NotificationService

public class NotificationServiceImpl
extends Object
implements NotificationService


Constructor Summary
NotificationServiceImpl()
           
NotificationServiceImpl(EmailService emailService, ProjectService projectService, NotificationDAO notificationDao, IssueActivityDAO issueActivityDao, IssueDAO issueDao)
           
 
Method Summary
 boolean addIssueNotification(Notification notification)
          TODO: whats its use? Moved from IssueService, could not find out the purpose of this method.
 EmailService getEmailService()
           
 IssueActivityDAO getIssueActivityDao()
           
 IssueDAO getIssueDao()
           
 List<Notification> getIssueNotifications(Issue issue)
          Retrieves all notifications for an issue where the notification's user is also active.
 List<Notification> getIssueNotifications(Issue issue, boolean primaryOnly, boolean activeOnly)
           
 List<Notification> getPrimaryIssueNotifications(Issue issue)
          Retrieves the primary issue notifications.
 ProjectService getProjectService()
           
 boolean hasIssueNotification(Issue issue, Integer userId)
           
 boolean hasIssueNotification(Issue issue, Integer userId, Notification.Role role)
           
 boolean removeIssueNotification(Integer notificationId)
          Retrieves an array of issue notifications.
 void sendNotification(Integer notificationId, Notification.Type type, String url)
          TODO url should be automatically generated by configuration (baseurl) and notification (issue-id).
 void sendNotification(Issue issue, Notification.Type type, String baseURL)
           
 void sendNotification(Issue issue, Notification.Type type, String baseURL, javax.mail.internet.InternetAddress[] receipients, Integer lastModifiedDays)
           
 void sendNotification(Notification notification, Notification.Type type, String url)
           
 void setEmailService(EmailService emailService)
           
 void setIssueActivityDao(IssueActivityDAO issueActivityDao)
           
 void setIssueDao(IssueDAO issueDao)
           
 void setNotificationDao(NotificationDAO notificationDao)
           
 void setProjectService(ProjectService projectService)
           
 void updateIssueActivityNotification(Issue issue, Boolean notificationSent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationServiceImpl

public NotificationServiceImpl()

NotificationServiceImpl

public NotificationServiceImpl(EmailService emailService,
                               ProjectService projectService,
                               NotificationDAO notificationDao,
                               IssueActivityDAO issueActivityDao,
                               IssueDAO issueDao)
Method Detail

sendNotification

public void sendNotification(Notification notification,
                             Notification.Type type,
                             String url)
Specified by:
sendNotification in interface NotificationService

sendNotification

public void sendNotification(Issue issue,
                             Notification.Type type,
                             String baseURL)
Specified by:
sendNotification in interface NotificationService

setEmailService

public void setEmailService(EmailService emailService)

updateIssueActivityNotification

public void updateIssueActivityNotification(Issue issue,
                                            Boolean notificationSent)

addIssueNotification

public boolean addIssueNotification(Notification notification)
Description copied from interface: NotificationService
TODO: whats its use? Moved from IssueService, could not find out the purpose of this method. What will happen with this added Notification?

Specified by:
addIssueNotification in interface NotificationService

getIssueNotifications

public List<Notification> getIssueNotifications(Issue issue,
                                                boolean primaryOnly,
                                                boolean activeOnly)
Specified by:
getIssueNotifications in interface NotificationService
Returns:

getIssueNotifications

public List<Notification> getIssueNotifications(Issue issue)
Description copied from interface: NotificationService
Retrieves all notifications for an issue where the notification's user is also active.

Specified by:
getIssueNotifications in interface NotificationService

getPrimaryIssueNotifications

public List<Notification> getPrimaryIssueNotifications(Issue issue)
Description copied from interface: NotificationService
Retrieves the primary issue notifications. Primary notifications are defined as the issue owner (or creator if not assigned), and any project owners. This should encompass the list of people that should be notified so that action can be taken on an issue that needs immediate attention.

Specified by:
getPrimaryIssueNotifications in interface NotificationService

hasIssueNotification

public boolean hasIssueNotification(Issue issue,
                                    Integer userId)
Specified by:
hasIssueNotification in interface NotificationService
Returns:

hasIssueNotification

public boolean hasIssueNotification(Issue issue,
                                    Integer userId,
                                    Notification.Role role)
Specified by:
hasIssueNotification in interface NotificationService
Parameters:
issue -
userId -
role -
Returns:

removeIssueNotification

public boolean removeIssueNotification(Integer notificationId)
Description copied from interface: NotificationService
Retrieves an array of issue notifications. The notifications by default is the creator and owner of the issue, all project admins for the issue's project, and anyone else that has a notfication on file.

Specified by:
removeIssueNotification in interface NotificationService
See Also:
org.itracker.services.implementations.IssueServiceImpl#getPrimaryIssueNotifications

sendNotification

public void sendNotification(Issue issue,
                             Notification.Type type,
                             String baseURL,
                             javax.mail.internet.InternetAddress[] receipients,
                             Integer lastModifiedDays)
Specified by:
sendNotification in interface NotificationService

getEmailService

public EmailService getEmailService()
Returns:
the emailService

getProjectService

public ProjectService getProjectService()
Returns:
the projectService

setProjectService

public void setProjectService(ProjectService projectService)
Parameters:
projectService - the projectService to set

setNotificationDao

public void setNotificationDao(NotificationDAO notificationDao)
Parameters:
notificationDao - the notificationDao to set

sendNotification

public void sendNotification(Integer notificationId,
                             Notification.Type type,
                             String url)
TODO url should be automatically generated by configuration (baseurl) and notification (issue-id).

Parameters:
notificationId -
url -

getIssueActivityDao

public IssueActivityDAO getIssueActivityDao()
Returns:
the issueActivityDao

setIssueActivityDao

public void setIssueActivityDao(IssueActivityDAO issueActivityDao)
Parameters:
issueActivityDao - the issueActivityDao to set

getIssueDao

public IssueDAO getIssueDao()
Returns:
the issueDao

setIssueDao

public void setIssueDao(IssueDAO issueDao)
Parameters:
issueDao - the issueDao to set


Copyright © 2002-2012 itracker. All Rights Reserved.