Class DefaultNotificationManager
- java.lang.Object
- 
- com.atlassian.confluence.mail.notification.DefaultNotificationManager
 
- 
- All Implemented Interfaces:
- NotificationManager
 
 public class DefaultNotificationManager extends Object implements NotificationManager 
- 
- 
Constructor SummaryConstructors Constructor Description DefaultNotificationManager(NotificationDao notificationDao, com.atlassian.event.api.EventPublisher eventPublisher)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable NotificationaddContentNotification(com.atlassian.user.User user, ContentEntityObject content)NotificationaddDailyReportNotfication(com.atlassian.user.User user)NotificationaddDailyReportNotification(ConfluenceUser user)booleanaddLabelNotification(com.atlassian.user.User user, Label label)@Nullable NotificationaddSpaceNotification(com.atlassian.user.User user, Space space)@Nullable NotificationaddSpaceNotification(com.atlassian.user.User user, Space space, ContentTypeEnum type)Add a space notification for a particular content type.List<Notification>findNotificationsByFollowing(com.atlassian.user.User modifier)Iterable<Long>findPageAndSpaceNotificationIdsFromSpace(Space space)Retrieves ids of all notifications in a space.NotificationgetDailyReportNotificationForUser(com.atlassian.user.User user)List<Notification>getDailyReportNotifications()NotificationgetNetworkNotificationForUser(com.atlassian.user.User user)NotificationgetNotificationById(long id)NotificationgetNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content)NotificationgetNotificationByUserAndSpace(com.atlassian.user.User user, Space space)Return a notification if the user is watching the entire space.NotificationgetNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey)Return a notification if the user is watching the entire space with the given spaceKey.NotificationgetNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type)List<Notification>getNotificationsByContent(ContentEntityObject content)List<Notification>getNotificationsByContents(List<ContentEntityObject> contents)List<Notification>getNotificationsByLabel(Label label)List<Notification>getNotificationsBySpaceAndType(Space space, ContentTypeEnum type)List<Notification>getNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type)List<Notification>getNotificationsByUser(com.atlassian.user.User user)NotificationgetSiteBlogNotificationForUser(com.atlassian.user.User user)List<Notification>getSiteBlogNotifications()booleanisUserWatchingPageOrSpace(com.atlassian.user.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 SpacebooleanisWatchingContent(@Nullable com.atlassian.user.User user, @Nullable ContentEntityObject content)Returns true if the given user is directly watching the given content.booleanisWatchingLabel(com.atlassian.user.User user, Label label)voidremoveAllNotificationsForSpace(Space space)Remove all of the notifications set up for this space.voidremoveAllNotificationsForUser(com.atlassian.user.User user)Remove all of the notifications setup for this user.voidremoveContentNotification(com.atlassian.user.User user, ContentEntityObject content)voidremoveDailyReportNotification(com.atlassian.user.User user)voidremoveLabelNotification(com.atlassian.user.User user, Label label)voidremoveNotification(Notification notification)voidremoveSpaceNotification(com.atlassian.user.User user, Space space)voidsetNetworkNotificationForUser(ConfluenceUser user, boolean watchingNetwork)voidsetNetworkNotificationForUser(com.atlassian.user.User user, boolean watchingNetwork)voidsetSiteBlogNotificationForUser(ConfluenceUser user, boolean globalBlogWatchForUser)voidsetSiteBlogNotificationForUser(com.atlassian.user.User user, boolean globalBlogWatchForUser)
 
- 
- 
- 
Constructor Detail- 
DefaultNotificationManagerpublic DefaultNotificationManager(NotificationDao notificationDao, com.atlassian.event.api.EventPublisher eventPublisher) 
 
- 
 - 
Method Detail- 
getNotificationsByUserpublic List<Notification> getNotificationsByUser(com.atlassian.user.User user) - Specified by:
- getNotificationsByUserin interface- NotificationManager
 
 - 
getNotificationByUserAndSpacepublic Notification getNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey) Description copied from interface:NotificationManagerReturn 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 NotificationManager.getNotificationByUserAndSpaceAndType(com.atlassian.user.User, com.atlassian.confluence.spaces.Space, com.atlassian.confluence.search.service.ContentTypeEnum)instead.- Specified by:
- getNotificationByUserAndSpacein interface- NotificationManager
 
 - 
getNotificationByUserAndSpacepublic Notification getNotificationByUserAndSpace(com.atlassian.user.User user, Space space) Description copied from interface:NotificationManagerReturn a notification if the user is watching the entire space.Note that notifications with specified ContentTypeEnum values will not be returned. Use NotificationManager.getNotificationByUserAndSpaceAndType(com.atlassian.user.User, com.atlassian.confluence.spaces.Space, com.atlassian.confluence.search.service.ContentTypeEnum)instead.- Specified by:
- getNotificationByUserAndSpacein interface- NotificationManager
 
 - 
getNotificationByUserAndSpaceAndTypepublic Notification getNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type) - Specified by:
- getNotificationByUserAndSpaceAndTypein interface- NotificationManager
 
 - 
addSpaceNotificationpublic @Nullable Notification addSpaceNotification(com.atlassian.user.User user, Space space) - Specified by:
- addSpaceNotificationin interface- NotificationManager
 
 - 
removeSpaceNotificationpublic void removeSpaceNotification(com.atlassian.user.User user, Space space)- Specified by:
- removeSpaceNotificationin interface- NotificationManager
 
 - 
addContentNotificationpublic @Nullable Notification addContentNotification(com.atlassian.user.User user, ContentEntityObject content) - Specified by:
- addContentNotificationin interface- NotificationManager
 
 - 
removeContentNotificationpublic void removeContentNotification(com.atlassian.user.User user, ContentEntityObject content)- Specified by:
- removeContentNotificationin interface- NotificationManager
 
 - 
getNotificationsByContentpublic List<Notification> getNotificationsByContent(ContentEntityObject content) - Specified by:
- getNotificationsByContentin interface- NotificationManager
 
 - 
getNotificationsByContentspublic List<Notification> getNotificationsByContents(List<ContentEntityObject> contents) - Specified by:
- getNotificationsByContentsin interface- NotificationManager
 
 - 
getNotificationByUserAndContentpublic Notification getNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content) - Specified by:
- getNotificationByUserAndContentin interface- NotificationManager
 
 - 
isWatchingContentpublic boolean isWatchingContent(@Nullable com.atlassian.user.User user, @Nullable ContentEntityObject content)Description copied from interface:NotificationManagerReturns true if the given user is directly watching the given content.Returns false if either the user or the content is null. - Specified by:
- isWatchingContentin interface- NotificationManager
- Parameters:
- user- user to check
- content- content to check
- Returns:
- true if the given user is directly watching the given content
 
 - 
addLabelNotificationpublic boolean addLabelNotification(com.atlassian.user.User user, Label label)- Specified by:
- addLabelNotificationin interface- NotificationManager
 
 - 
removeLabelNotificationpublic void removeLabelNotification(com.atlassian.user.User user, Label label)- Specified by:
- removeLabelNotificationin interface- NotificationManager
 
 - 
isWatchingLabelpublic boolean isWatchingLabel(com.atlassian.user.User user, Label label)- Specified by:
- isWatchingLabelin interface- NotificationManager
 
 - 
getNotificationsByLabelpublic List<Notification> getNotificationsByLabel(Label label) - Specified by:
- getNotificationsByLabelin interface- NotificationManager
 
 - 
addSpaceNotificationpublic @Nullable Notification addSpaceNotification(com.atlassian.user.User user, Space space, ContentTypeEnum type) Description copied from interface:NotificationManagerAdd a space notification for a particular content type. For example, watch only blogs in a space.- Specified by:
- addSpaceNotificationin interface- NotificationManager
 
 - 
removeNotificationpublic void removeNotification(Notification notification) - Specified by:
- removeNotificationin interface- NotificationManager
 
 - 
isUserWatchingPageOrSpacepublic boolean isUserWatchingPageOrSpace(com.atlassian.user.User user, Space space, AbstractPage page)Description copied from interface:NotificationManagerReturns 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 SpaceThis method can be used to check if a user is watching a page directly or indirectly. - Specified by:
- isUserWatchingPageOrSpacein interface- NotificationManager
 
 - 
getNotificationsBySpaceAndTypepublic List<Notification> getNotificationsBySpaceAndType(Space space, ContentTypeEnum type) - Specified by:
- getNotificationsBySpaceAndTypein interface- NotificationManager
 
 - 
getNotificationsBySpacesAndTypepublic List<Notification> getNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type) - Specified by:
- getNotificationsBySpacesAndTypein interface- NotificationManager
 
 - 
removeAllNotificationsForUserpublic void removeAllNotificationsForUser(com.atlassian.user.User user) Description copied from interface:NotificationManagerRemove all of the notifications setup for this user. This includes space, page and daily report notifications.- Specified by:
- removeAllNotificationsForUserin interface- NotificationManager
 
 - 
removeAllNotificationsForSpacepublic void removeAllNotificationsForSpace(Space space) Description copied from interface:NotificationManagerRemove all of the notifications set up for this space.- Specified by:
- removeAllNotificationsForSpacein interface- NotificationManager
 
 - 
getDailyReportNotificationspublic List<Notification> getDailyReportNotifications() - Specified by:
- getDailyReportNotificationsin interface- NotificationManager
 
 - 
getDailyReportNotificationForUserpublic Notification getDailyReportNotificationForUser(com.atlassian.user.User user) - Specified by:
- getDailyReportNotificationForUserin interface- NotificationManager
 
 - 
getSiteBlogNotificationspublic List<Notification> getSiteBlogNotifications() - Specified by:
- getSiteBlogNotificationsin interface- NotificationManager
 
 - 
findNotificationsByFollowingpublic List<Notification> findNotificationsByFollowing(com.atlassian.user.User modifier) Description copied from interface:NotificationManagerRetrieves the list of NetworkNotifications forUsers who are following the givenUser. That is, allNotifications that returntruefromNotification.isNetwork()and belong to somebody who is followingmodifiervia aConnection.- Specified by:
- findNotificationsByFollowingin interface- NotificationManager
- Parameters:
- modifier- usually a user who has modified a piece of content.
- Returns:
- notifications for anybody subscribed to network notifications who follows modifier.
- See Also:
- Connection
 
 - 
findPageAndSpaceNotificationIdsFromSpacepublic Iterable<Long> findPageAndSpaceNotificationIdsFromSpace(Space space) Description copied from interface:NotificationManagerRetrieves ids of all notifications in a space. This is useful for large-scale operations such as space exports. The result includes all notifications for the space, including notifications for pages in the space.- Specified by:
- findPageAndSpaceNotificationIdsFromSpacein interface- NotificationManager
- Parameters:
- space- a space to find the notifications for
- Returns:
- ids of all the notifications in the space.
 
 - 
getSiteBlogNotificationForUserpublic Notification getSiteBlogNotificationForUser(com.atlassian.user.User user) - Specified by:
- getSiteBlogNotificationForUserin interface- NotificationManager
 
 - 
getNetworkNotificationForUserpublic Notification getNetworkNotificationForUser(com.atlassian.user.User user) - Specified by:
- getNetworkNotificationForUserin interface- NotificationManager
 
 - 
getNotificationByIdpublic Notification getNotificationById(long id) - Specified by:
- getNotificationByIdin interface- NotificationManager
 
 - 
setSiteBlogNotificationForUserpublic void setSiteBlogNotificationForUser(com.atlassian.user.User user, boolean globalBlogWatchForUser)- Specified by:
- setSiteBlogNotificationForUserin interface- NotificationManager
 
 - 
setSiteBlogNotificationForUserpublic void setSiteBlogNotificationForUser(ConfluenceUser user, boolean globalBlogWatchForUser) - Specified by:
- setSiteBlogNotificationForUserin interface- NotificationManager
 
 - 
setNetworkNotificationForUserpublic void setNetworkNotificationForUser(com.atlassian.user.User user, boolean watchingNetwork)- Specified by:
- setNetworkNotificationForUserin interface- NotificationManager
 
 - 
setNetworkNotificationForUserpublic void setNetworkNotificationForUser(ConfluenceUser user, boolean watchingNetwork) - Specified by:
- setNetworkNotificationForUserin interface- NotificationManager
 
 - 
addDailyReportNotficationpublic Notification addDailyReportNotfication(com.atlassian.user.User user) - Specified by:
- addDailyReportNotficationin interface- NotificationManager
 
 - 
addDailyReportNotificationpublic Notification addDailyReportNotification(ConfluenceUser user) - Specified by:
- addDailyReportNotificationin interface- NotificationManager
 
 - 
removeDailyReportNotificationpublic void removeDailyReportNotification(com.atlassian.user.User user) - Specified by:
- removeDailyReportNotificationin interface- NotificationManager
 
 
- 
 
-