Interface NotificationManager
-
- All Known Implementing Classes:
DefaultNotificationManager
@Transactional(readOnly=true) public interface NotificationManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description @Nullable Notification
addContentNotification(com.atlassian.user.User user, ContentEntityObject content)
Notification
addDailyReportNotfication(com.atlassian.user.User user)
Deprecated.since 7.0.0, usesetNetworkNotificationForUser(ConfluenceUser, boolean)
Notification
addDailyReportNotification(ConfluenceUser user)
boolean
addLabelNotification(com.atlassian.user.User user, Label label)
@Nullable Notification
addSpaceNotification(com.atlassian.user.User user, Space space)
@Nullable Notification
addSpaceNotification(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.Notification
getDailyReportNotificationForUser(com.atlassian.user.User user)
List<Notification>
getDailyReportNotifications()
Notification
getNetworkNotificationForUser(com.atlassian.user.User user)
Notification
getNotificationById(long id)
Notification
getNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content)
Notification
getNotificationByUserAndSpace(com.atlassian.user.User user, Space space)
Return a notification if the user is watching the entire space.Notification
getNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey)
Return a notification if the user is watching the entire space with the given spaceKey.Notification
getNotificationByUserAndSpaceAndType(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)
Notification
getSiteBlogNotificationForUser(com.atlassian.user.User user)
List<Notification>
getSiteBlogNotifications()
boolean
isUserWatchingPageOrSpace(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 Spaceboolean
isWatchingContent(@Nullable com.atlassian.user.User user, @Nullable ContentEntityObject content)
Returns true if the given user is directly watching the given content.boolean
isWatchingLabel(com.atlassian.user.User user, Label label)
void
removeAllNotificationsForSpace(Space space)
Remove all of the notifications set up for this space.void
removeAllNotificationsForUser(com.atlassian.user.User user)
Remove all of the notifications setup for this user.void
removeContentNotification(com.atlassian.user.User user, ContentEntityObject content)
void
removeDailyReportNotification(com.atlassian.user.User user)
void
removeLabelNotification(com.atlassian.user.User user, Label label)
void
removeNotification(Notification notification)
void
removeSpaceNotification(com.atlassian.user.User user, Space space)
void
setNetworkNotificationForUser(ConfluenceUser user, boolean watchingNetwork)
void
setNetworkNotificationForUser(com.atlassian.user.User user, boolean watchingNetwork)
Deprecated.since 7.0.0, usesetNetworkNotificationForUser(ConfluenceUser, boolean)
void
setSiteBlogNotificationForUser(ConfluenceUser user, boolean globalBlogWatchForUser)
void
setSiteBlogNotificationForUser(com.atlassian.user.User user, boolean globalBlogWatchForUser)
Deprecated.since 7.0.0, usesetSiteBlogNotificationForUser(ConfluenceUser, boolean)
-
-
-
Method Detail
-
getNotificationsByUser
List<Notification> getNotificationsByUser(com.atlassian.user.User user)
-
getNotificationsByContent
List<Notification> getNotificationsByContent(ContentEntityObject content)
-
getNotificationsByContents
List<Notification> getNotificationsByContents(List<ContentEntityObject> contents)
-
getNotificationByUserAndContent
Notification getNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content)
-
getNotificationsBySpaceAndType
List<Notification> getNotificationsBySpaceAndType(Space space, ContentTypeEnum type)
-
getNotificationsBySpacesAndType
List<Notification> getNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type)
-
getNotificationByUserAndSpace
Notification getNotificationByUserAndSpace(com.atlassian.user.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(com.atlassian.user.User, com.atlassian.confluence.spaces.Space, com.atlassian.confluence.search.service.ContentTypeEnum)
instead.
-
getNotificationByUserAndSpace
Notification getNotificationByUserAndSpace(com.atlassian.user.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(com.atlassian.user.User, com.atlassian.confluence.spaces.Space, com.atlassian.confluence.search.service.ContentTypeEnum)
instead.
-
getNotificationByUserAndSpaceAndType
Notification getNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type)
-
addContentNotification
@Transactional @Nullable Notification addContentNotification(com.atlassian.user.User user, ContentEntityObject content)
-
addSpaceNotification
@Transactional @Nullable Notification addSpaceNotification(com.atlassian.user.User user, Space space)
-
removeSpaceNotification
@Transactional void removeSpaceNotification(com.atlassian.user.User user, Space space)
- Since:
- 5.9.1
-
removeContentNotification
@Transactional void removeContentNotification(com.atlassian.user.User user, ContentEntityObject content)
-
isWatchingContent
boolean isWatchingContent(@Nullable com.atlassian.user.User user, @Nullable ContentEntityObject content)
Returns true if the given user is directly watching the given content.Returns false if either the user or the content is null.
- Parameters:
user
- user to checkcontent
- content to check- Returns:
- true if the given user is directly watching the given content
- Since:
- 5.3
-
addLabelNotification
@Transactional boolean addLabelNotification(com.atlassian.user.User user, Label label)
-
removeLabelNotification
@Transactional void removeLabelNotification(com.atlassian.user.User user, Label label)
-
isWatchingLabel
boolean isWatchingLabel(com.atlassian.user.User user, Label label)
-
getNotificationsByLabel
List<Notification> getNotificationsByLabel(Label label)
-
addSpaceNotification
@Transactional @Nullable Notification addSpaceNotification(com.atlassian.user.User user, Space space, ContentTypeEnum type)
Add a space notification for a particular content type. For example, watch only blogs in a space.
-
addDailyReportNotfication
@Deprecated @Transactional Notification addDailyReportNotfication(com.atlassian.user.User user)
Deprecated.since 7.0.0, usesetNetworkNotificationForUser(ConfluenceUser, boolean)
-
addDailyReportNotification
@Transactional Notification addDailyReportNotification(ConfluenceUser user)
- Since:
- 7.0.0
-
removeDailyReportNotification
@Transactional void removeDailyReportNotification(com.atlassian.user.User user)
-
removeNotification
@Transactional void removeNotification(Notification notification)
-
isUserWatchingPageOrSpace
boolean isUserWatchingPageOrSpace(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 SpaceThis method can be used to check if a user is watching a page directly or indirectly.
-
removeAllNotificationsForUser
@Transactional void removeAllNotificationsForUser(com.atlassian.user.User user)
Remove all of the notifications setup for this user. This includes space, page and daily report notifications.
-
removeAllNotificationsForSpace
@Transactional void removeAllNotificationsForSpace(Space space)
Remove all of the notifications set up for this space.
-
getDailyReportNotifications
List<Notification> getDailyReportNotifications()
-
getDailyReportNotificationForUser
Notification getDailyReportNotificationForUser(com.atlassian.user.User user)
-
getSiteBlogNotificationForUser
Notification getSiteBlogNotificationForUser(com.atlassian.user.User user)
-
getNetworkNotificationForUser
Notification getNetworkNotificationForUser(com.atlassian.user.User user)
-
getNotificationById
Notification getNotificationById(long id)
-
setSiteBlogNotificationForUser
@Deprecated @Transactional void setSiteBlogNotificationForUser(com.atlassian.user.User user, boolean globalBlogWatchForUser)
Deprecated.since 7.0.0, usesetSiteBlogNotificationForUser(ConfluenceUser, boolean)
-
setSiteBlogNotificationForUser
@Transactional void setSiteBlogNotificationForUser(ConfluenceUser user, boolean globalBlogWatchForUser)
- Since:
- 7.0.0
-
setNetworkNotificationForUser
@Deprecated @Transactional void setNetworkNotificationForUser(com.atlassian.user.User user, boolean watchingNetwork)
Deprecated.since 7.0.0, usesetNetworkNotificationForUser(ConfluenceUser, boolean)
-
setNetworkNotificationForUser
@Transactional void setNetworkNotificationForUser(ConfluenceUser user, boolean watchingNetwork)
- Since:
- 7.0.0
-
getSiteBlogNotifications
List<Notification> getSiteBlogNotifications()
-
findNotificationsByFollowing
List<Notification> findNotificationsByFollowing(com.atlassian.user.User modifier)
Retrieves the list of NetworkNotification
s forUser
s who are following the givenUser
. That is, allNotification
s that returntrue
fromNotification.isNetwork()
and belong to somebody who is followingmodifier
via aConnection
.- 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
-
findPageAndSpaceNotificationIdsFromSpace
Iterable<Long> findPageAndSpaceNotificationIdsFromSpace(Space space)
Retrieves 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.- Parameters:
space
- a space to find the notifications for- Returns:
- ids of all the notifications in the space.
- Since:
- 4.2
-
-