public class DefaultNotificationManager extends Object implements NotificationManager
| Constructor and Description |
|---|
DefaultNotificationManager(NotificationDao notificationDao,
com.atlassian.event.api.EventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
Notification |
addContentNotification(com.atlassian.user.User user,
ContentEntityObject content) |
Notification |
addDailyReportNotfication(com.atlassian.user.User user) |
boolean |
addLabelNotification(com.atlassian.user.User user,
Label label) |
Notification |
addPageNotification(com.atlassian.user.User user,
AbstractPage page)
Deprecated.
|
Notification |
addSpaceNotification(com.atlassian.user.User user,
Space space) |
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 |
getNotificationByUserAndContent(com.atlassian.user.User user,
ContentEntityObject content) |
Notification |
getNotificationByUserAndPage(com.atlassian.user.User user,
AbstractPage page)
Deprecated.
|
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> |
getNotificationsByLabel(Label label) |
List<Notification> |
getNotificationsByPage(AbstractPage page)
Deprecated.
since 5.3. Use
getNotificationsByContent(com.atlassian.confluence.core.ContentEntityObject) instead. |
List<Notification> |
getNotificationsBySpace(Space space)
Deprecated.
since 5.3. Use
getNotificationsByContent(com.atlassian.confluence.core.ContentEntityObject) instead. |
List<Notification> |
getNotificationsBySpaceAndType(Space space,
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 Space
|
boolean |
isWatchingContent(com.atlassian.user.User user,
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(com.atlassian.user.User user,
boolean watchingNetwork) |
void |
setSiteBlogNotificationForUser(com.atlassian.user.User user,
boolean globalBlogWatchForUser) |
public DefaultNotificationManager(NotificationDao notificationDao, com.atlassian.event.api.EventPublisher eventPublisher)
public List<Notification> getNotificationsByUser(com.atlassian.user.User user)
getNotificationsByUser in interface NotificationManager@Deprecated public Notification getNotificationByUserAndPage(com.atlassian.user.User user, AbstractPage page)
getNotificationByUserAndContent(com.atlassian.user.User, com.atlassian.confluence.core.ContentEntityObject) instead.getNotificationByUserAndPage in interface NotificationManagerpublic Notification getNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey)
NotificationManager
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.
getNotificationByUserAndSpace in interface NotificationManagerpublic Notification getNotificationByUserAndSpace(com.atlassian.user.User user, Space space)
NotificationManager
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.
getNotificationByUserAndSpace in interface NotificationManagerpublic Notification getNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type)
getNotificationByUserAndSpaceAndType in interface NotificationManager@Deprecated public Notification addPageNotification(com.atlassian.user.User user, AbstractPage page)
addContentNotification(com.atlassian.user.User, com.atlassian.confluence.core.ContentEntityObject) instead.addPageNotification in interface NotificationManager@Nullable public Notification addSpaceNotification(com.atlassian.user.User user, Space space)
addSpaceNotification in interface NotificationManagerpublic void removeSpaceNotification(com.atlassian.user.User user,
Space space)
removeSpaceNotification in interface NotificationManager@Nullable public Notification addContentNotification(com.atlassian.user.User user, ContentEntityObject content)
addContentNotification in interface NotificationManagerpublic void removeContentNotification(com.atlassian.user.User user,
ContentEntityObject content)
removeContentNotification in interface NotificationManagerpublic List<Notification> getNotificationsByContent(ContentEntityObject content)
getNotificationsByContent in interface NotificationManagerpublic Notification getNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content)
getNotificationByUserAndContent in interface NotificationManagerpublic boolean isWatchingContent(@Nullable com.atlassian.user.User user, @Nullable ContentEntityObject content)
NotificationManagerReturns false if either the user or the content is null.
isWatchingContent in interface NotificationManageruser - user to checkcontent - content to checkpublic boolean addLabelNotification(com.atlassian.user.User user,
Label label)
addLabelNotification in interface NotificationManagerpublic void removeLabelNotification(com.atlassian.user.User user,
Label label)
removeLabelNotification in interface NotificationManagerpublic boolean isWatchingLabel(com.atlassian.user.User user,
Label label)
isWatchingLabel in interface NotificationManagerpublic List<Notification> getNotificationsByLabel(Label label)
getNotificationsByLabel in interface NotificationManager@Nullable public Notification addSpaceNotification(com.atlassian.user.User user, Space space, ContentTypeEnum type)
NotificationManageraddSpaceNotification in interface NotificationManagerpublic void removeNotification(Notification notification)
removeNotification in interface NotificationManagerpublic boolean isUserWatchingPageOrSpace(com.atlassian.user.User user,
Space space,
AbstractPage page)
NotificationManagerThis method can be used to check if a user is watching a page directly or indirectly.
isUserWatchingPageOrSpace in interface NotificationManager@Deprecated public List<Notification> getNotificationsByPage(AbstractPage page)
getNotificationsByContent(com.atlassian.confluence.core.ContentEntityObject) instead.getNotificationsByPage in interface NotificationManager@Deprecated public List<Notification> getNotificationsBySpace(Space space)
getNotificationsByContent(com.atlassian.confluence.core.ContentEntityObject) instead.NotificationManagergetNotificationsBySpace in interface NotificationManagerpublic List<Notification> getNotificationsBySpaceAndType(Space space, ContentTypeEnum type)
getNotificationsBySpaceAndType in interface NotificationManagerpublic void removeAllNotificationsForUser(com.atlassian.user.User user)
NotificationManagerremoveAllNotificationsForUser in interface NotificationManagerpublic void removeAllNotificationsForSpace(Space space)
NotificationManagerremoveAllNotificationsForSpace in interface NotificationManagerpublic List<Notification> getDailyReportNotifications()
getDailyReportNotifications in interface NotificationManagerpublic Notification getDailyReportNotificationForUser(com.atlassian.user.User user)
getDailyReportNotificationForUser in interface NotificationManagerpublic List<Notification> getSiteBlogNotifications()
getSiteBlogNotifications in interface NotificationManagerpublic List<Notification> findNotificationsByFollowing(com.atlassian.user.User modifier)
NotificationManagerNotifications for Users who are
following the given User. That is, all Notifications that
return true from Notification.isNetwork() and belong to somebody
who is following modifier via a Connection.findNotificationsByFollowing in interface NotificationManagermodifier - usually a user who has modified a piece of content.modifier.Connectionpublic Iterable<Long> findPageAndSpaceNotificationIdsFromSpace(Space space)
NotificationManagerfindPageAndSpaceNotificationIdsFromSpace in interface NotificationManagerspace - a space to find the notifications forpublic Notification getSiteBlogNotificationForUser(com.atlassian.user.User user)
getSiteBlogNotificationForUser in interface NotificationManagerpublic Notification getNetworkNotificationForUser(com.atlassian.user.User user)
getNetworkNotificationForUser in interface NotificationManagerpublic void setSiteBlogNotificationForUser(com.atlassian.user.User user,
boolean globalBlogWatchForUser)
setSiteBlogNotificationForUser in interface NotificationManagerpublic void setNetworkNotificationForUser(com.atlassian.user.User user,
boolean watchingNetwork)
setNetworkNotificationForUser in interface NotificationManagerpublic Notification addDailyReportNotfication(com.atlassian.user.User user)
addDailyReportNotfication in interface NotificationManagerpublic void removeDailyReportNotification(com.atlassian.user.User user)
removeDailyReportNotification in interface NotificationManagerCopyright © 2003–2018 Atlassian. All rights reserved.