Class DefaultNotificationManager
java.lang.Object
com.atlassian.confluence.mail.notification.DefaultNotificationManager
- All Implemented Interfaces:
NotificationManager
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultNotificationManager(NotificationDaoInternal notificationDao, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescription@Nullable NotificationaddContentNotification(com.atlassian.user.User user, ContentEntityObject content) addDailyReportNotfication(com.atlassian.user.User 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.findNotificationsByFollowing(com.atlassian.user.User modifier) Retrieves ids of all notifications in a space.getDailyReportNotificationForUser(com.atlassian.user.User user) getNetworkNotificationForUser(com.atlassian.user.User user) getNotificationById(long id) getNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content) getNotificationByUserAndSpace(com.atlassian.user.User user, Space space) Return a notification if the user is watching the entire space.getNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey) Return a notification if the user is watching the entire space with the given spaceKey.getNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type) getNotificationsByContents(List<ContentEntityObject> contents) getNotificationsByLabel(Label label) getNotificationsBySpaceAndType(Space space, ContentTypeEnum type) getNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type) getNotificationsByUser(com.atlassian.user.User user) getSiteBlogNotificationForUser(com.atlassian.user.User user) 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) voidRemove 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) voidremoveContentNotificationAllUsers(long contentId) 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 Details
-
DefaultNotificationManager
public DefaultNotificationManager(NotificationDaoInternal notificationDao, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
getNotificationsByUser
- Specified by:
getNotificationsByUserin interfaceNotificationManager
-
getNotificationByUserAndSpace
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 interfaceNotificationManager
-
getNotificationByUserAndSpace
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 interfaceNotificationManager
-
getNotificationByUserAndSpaceAndType
public Notification getNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type) - Specified by:
getNotificationByUserAndSpaceAndTypein interfaceNotificationManager
-
addSpaceNotification
- Specified by:
addSpaceNotificationin interfaceNotificationManager
-
removeSpaceNotification
- Specified by:
removeSpaceNotificationin interfaceNotificationManager
-
addContentNotification
public @Nullable Notification addContentNotification(com.atlassian.user.User user, ContentEntityObject content) - Specified by:
addContentNotificationin interfaceNotificationManager
-
removeContentNotification
- Specified by:
removeContentNotificationin interfaceNotificationManager
-
removeContentNotificationAllUsers
public void removeContentNotificationAllUsers(long contentId) - Specified by:
removeContentNotificationAllUsersin interfaceNotificationManager
-
getNotificationsByContent
- Specified by:
getNotificationsByContentin interfaceNotificationManager
-
getNotificationsByContents
- Specified by:
getNotificationsByContentsin interfaceNotificationManager
-
getNotificationByUserAndContent
public Notification getNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content) - Specified by:
getNotificationByUserAndContentin interfaceNotificationManager
-
isWatchingContent
public 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 interfaceNotificationManager- Parameters:
user- user to checkcontent- content to check- Returns:
- true if the given user is directly watching the given content
-
addLabelNotification
- Specified by:
addLabelNotificationin interfaceNotificationManager
-
removeLabelNotification
- Specified by:
removeLabelNotificationin interfaceNotificationManager
-
isWatchingLabel
- Specified by:
isWatchingLabelin interfaceNotificationManager
-
getNotificationsByLabel
- Specified by:
getNotificationsByLabelin interfaceNotificationManager
-
addSpaceNotification
public @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 interfaceNotificationManager
-
removeNotification
- Specified by:
removeNotificationin interfaceNotificationManager
-
isUserWatchingPageOrSpace
public 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 interfaceNotificationManager
-
getNotificationsBySpaceAndType
- Specified by:
getNotificationsBySpaceAndTypein interfaceNotificationManager
-
getNotificationsBySpacesAndType
- Specified by:
getNotificationsBySpacesAndTypein interfaceNotificationManager
-
removeAllNotificationsForUser
public 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 interfaceNotificationManager
-
removeAllNotificationsForSpace
Description copied from interface:NotificationManagerRemove all of the notifications set up for this space.- Specified by:
removeAllNotificationsForSpacein interfaceNotificationManager
-
getDailyReportNotifications
- Specified by:
getDailyReportNotificationsin interfaceNotificationManager
-
getDailyReportNotificationForUser
- Specified by:
getDailyReportNotificationForUserin interfaceNotificationManager
-
getSiteBlogNotifications
- Specified by:
getSiteBlogNotificationsin interfaceNotificationManager
-
findNotificationsByFollowing
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 interfaceNotificationManager- 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:
-
findPageAndSpaceNotificationIdsFromSpace
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 interfaceNotificationManager- Parameters:
space- a space to find the notifications for- Returns:
- ids of all the notifications in the space.
-
getSiteBlogNotificationForUser
- Specified by:
getSiteBlogNotificationForUserin interfaceNotificationManager
-
getNetworkNotificationForUser
- Specified by:
getNetworkNotificationForUserin interfaceNotificationManager
-
getNotificationById
- Specified by:
getNotificationByIdin interfaceNotificationManager
-
setSiteBlogNotificationForUser
public void setSiteBlogNotificationForUser(com.atlassian.user.User user, boolean globalBlogWatchForUser) - Specified by:
setSiteBlogNotificationForUserin interfaceNotificationManager
-
setSiteBlogNotificationForUser
- Specified by:
setSiteBlogNotificationForUserin interfaceNotificationManager
-
setNetworkNotificationForUser
public void setNetworkNotificationForUser(com.atlassian.user.User user, boolean watchingNetwork) - Specified by:
setNetworkNotificationForUserin interfaceNotificationManager
-
setNetworkNotificationForUser
- Specified by:
setNetworkNotificationForUserin interfaceNotificationManager
-
addDailyReportNotfication
- Specified by:
addDailyReportNotficationin interfaceNotificationManager
-
addDailyReportNotification
- Specified by:
addDailyReportNotificationin interfaceNotificationManager
-
removeDailyReportNotification
public void removeDailyReportNotification(com.atlassian.user.User user) - Specified by:
removeDailyReportNotificationin interfaceNotificationManager
-