public class

DefaultNotificationManager

extends Object
implements NotificationManager
java.lang.Object
   ↳ com.atlassian.confluence.mail.notification.DefaultNotificationManager

Summary

Public Constructors
DefaultNotificationManager()
Public Methods
Notification addDailyReportNotfication(User user)
Notification addPageNotification(User user, AbstractPage page)
Notification addSpaceNotification(User user, Space space)
Notification addSpaceNotification(User user, Space space, ContentTypeEnum type)
Add a space notification for a particular content type.
List<Notification> findNotificationsByFollowing(User modifier)
Retrieves the list of Network Notifications for Users who are following the given User.
Notification getDailyReportNotificationForUser(User user)
List<Notification> getDailyReportNotifications()
Notification getNetworkNotificationForUser(User user)
Notification getNotificationByUserAndPage(User user, AbstractPage page)
Notification getNotificationByUserAndSpace(User user, String spaceKey)
Return a notification if the user is watching the entire space with the given spaceKey.
Notification getNotificationByUserAndSpace(User user, Space space)
Return a notification if the user is watching the entire space.
Notification getNotificationByUserAndSpaceAndType(User user, Space space, ContentTypeEnum type)
NotificationDao getNotificationDao()
List<Notification> getNotificationsByPage(AbstractPage page)
List<Notification> getNotificationsBySpace(Space space)
Return all notifications for a space, regardless of content type.
List<Notification> getNotificationsBySpaceAndType(Space space, ContentTypeEnum type)
List<Notification> getNotificationsByUser(User user)
Notification getSiteBlogNotificationForUser(User user)
List<Notification> getSiteBlogNotifications()
boolean isUserWatchingPageOrSpace(User user, Space space, AbstractPage page)
Returns true if: a) the user is watching the AbstractPage b) the user is watching the space, or c) the user is watching the contentType of the AbstractPage for the Space This method can be used to check if a user is watching a page directly or indirectly.
void removeAllNotificationsForSpace(Space space)
Remove all of the notifications set up for this space.
void removeAllNotificationsForUser(User user)
Remove all of the notifications setup for this user.
void removeDailyReportNotification(User user)
void removeNotification(Notification notification)
void setEventManager(EventManager eventManager)
void setNetworkNotificationForUser(User user, boolean watchingNetwork)
void setNotificationDao(NotificationDao notificationDao)
void setSiteBlogNotificationForUser(User user, boolean globalBlogWatchForUser)
Protected Methods
Notification addNotification(User user, Space space, AbstractPage page)
Adds a page or space notification for a user.
Notification addNotification(User user, Space space, AbstractPage page, ContentTypeEnum type)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.mail.notification.NotificationManager

Public Constructors

public DefaultNotificationManager ()

Public Methods

public Notification addDailyReportNotfication (User user)

public Notification addPageNotification (User user, AbstractPage page)

public Notification addSpaceNotification (User user, Space space)

public Notification addSpaceNotification (User user, Space space, ContentTypeEnum type)

Add a space notification for a particular content type. For example, watch only blogs in a space.

public List<Notification> findNotificationsByFollowing (User modifier)

Retrieves the list of Network Notifications for Users who are following the given User. That is, all Notifications that return true from isNetwork() and belong to somebody who is following modifier via a Connection.

Parameters
modifier usually a user who has modified a piece of content.
Returns
  • notifications for anybody subscribed to network notifications who follows modifier.

public Notification getDailyReportNotificationForUser (User user)

public List<Notification> getDailyReportNotifications ()

public Notification getNetworkNotificationForUser (User user)

public Notification getNotificationByUserAndPage (User user, AbstractPage page)

public Notification getNotificationByUserAndSpace (User user, String spaceKey)

Return a notification if the user is watching the entire space with the given spaceKey. Note that notifications with specified ContentTypeEnum values will not be returned. Use getNotificationByUserAndSpaceAndType(User, Space, ContentTypeEnum) instead.

public Notification getNotificationByUserAndSpace (User user, Space space)

Return a notification if the user is watching the entire space. Note that notifications with specified ContentTypeEnum values will not be returned. Use getNotificationByUserAndSpaceAndType(User, Space, ContentTypeEnum) instead.

public Notification getNotificationByUserAndSpaceAndType (User user, Space space, ContentTypeEnum type)

public NotificationDao getNotificationDao ()

public List<Notification> getNotificationsByPage (AbstractPage page)

public List<Notification> getNotificationsBySpace (Space space)

Return all notifications for a space, regardless of content type.

public List<Notification> getNotificationsBySpaceAndType (Space space, ContentTypeEnum type)

public List<Notification> getNotificationsByUser (User user)

public Notification getSiteBlogNotificationForUser (User user)

public List<Notification> getSiteBlogNotifications ()

public boolean isUserWatchingPageOrSpace (User user, Space space, AbstractPage page)

Returns true if: a) the user is watching the AbstractPage b) the user is watching the space, or c) the user is watching the contentType of the AbstractPage for the Space This method can be used to check if a user is watching a page directly or indirectly.

public void removeAllNotificationsForSpace (Space space)

Remove all of the notifications set up for this space.

public void removeAllNotificationsForUser (User user)

Remove all of the notifications setup for this user. This includes space, page and daily report notifications.

public void removeDailyReportNotification (User user)

public void removeNotification (Notification notification)

public void setEventManager (EventManager eventManager)

public void setNetworkNotificationForUser (User user, boolean watchingNetwork)

public void setNotificationDao (NotificationDao notificationDao)

public void setSiteBlogNotificationForUser (User user, boolean globalBlogWatchForUser)

Protected Methods

protected Notification addNotification (User user, Space space, AbstractPage page)

Adds a page or space notification for a user.

Parameters
user The user to add the notification for, should not be null
space The space to add a watch for or that the page belongs to, can be null if user requests a page that doesn't exist
page Page to be watched, null if trying to add a Space watch or if user requests a page that doesn't exist
Returns
  • The notification that was added, or the existing notification if the watch already existed

protected Notification addNotification (User user, Space space, AbstractPage page, ContentTypeEnum type)