Interface NotificationDao
- All Known Subinterfaces:
NotificationDaoInternal
- All Known Implementing Classes:
CachingNotificationDao
,DelegatingNotificationDaoInternal
,HibernateNotificationDao
public interface NotificationDao
Data Access Object interface for dealing with notifications.
-
Method Summary
Modifier and TypeMethodDescriptionFind all daily report notifications.findAllNotificationsBySpace
(Space space) Find all notifications linked to the specified space regardless of type specified.findAllNotificationsByUser
(com.atlassian.user.User user) Find all notifications owned by the specified user, including digest etc.Find the specified user's daily report notification.findGlobalBlogWatchForUser
(com.atlassian.user.User user) Find the global blog notification for this user if they have one.findNetworkNotificationByUser
(com.atlassian.user.User user) Find the Network notification for this user if they have one.findNotificationById
(long id) Find a notification by its IDfindNotificationByUserAndContent
(com.atlassian.user.User user, ContentEntityObject content) Find any user notification linked to the specified content.findNotificationByUserAndLabel
(com.atlassian.user.User user, Label label) Find any user notification linked to the specified label.findNotificationByUserAndSpace
(com.atlassian.user.User user, Space space) Find any user notification linked to the specified space regardless of type.findNotificationByUserAndSpace
(com.atlassian.user.User user, String spaceKey) Find any user notification linked to the specified space regardless of type.findNotificationByUserAndSpaceAndType
(com.atlassian.user.User user, Space space, ContentTypeEnum type) Find the user notification linked to the specified space with a type specified - may be null if watching the whole space.findNotificationsByContentId
(long contentId) Find all user notification linked to the specified content.findNotificationsByContents
(List<ContentEntityObject> contents) findNotificationsByFollowing
(com.atlassian.user.User user) findNotificationsByLabel
(Label label) findNotificationsBySpaceAndType
(Space space, ContentTypeEnum type) Find all notifications linked to the specified space for a certain type.findNotificationsBySpacesAndType
(List<Space> spaces, ContentTypeEnum type) Find all notifications linked to the specified spaces for a certain type.findNotificationsByUser
(com.atlassian.user.User user) Find the space and page notifications owned by the specified user.Retrieves ids for all notifications in a space.Find the global blog notification for all users.boolean
isWatchingContent
(@NonNull ConfluenceUser user, @NonNull ContentEntityObject content) Returns true if the given user is directly watching the given content.
-
Method Details
-
findNotificationsByUser
Find the space and page notifications owned by the specified user.- Returns:
- a list of Notification objects.
-
findAllNotificationsByUser
Find all notifications owned by the specified user, including digest etc.- Returns:
- a list of Notification objects.
-
findAllNotificationsBySpace
Find all notifications linked to the specified space regardless of type specified. This does not include notifications for pages in the space.- Returns:
- a list of Notification objects.
-
findPageAndSpaceNotificationIdsFromSpace
Retrieves ids for 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
-
findNotificationsBySpaceAndType
Find all notifications linked to the specified space for a certain type.- Returns:
- a list of Notification objects.
-
findNotificationsBySpacesAndType
Find all notifications linked to the specified spaces for a certain type.- Returns:
- a list of Notification objects.
-
findNotificationByUserAndSpace
Find any user notification linked to the specified space regardless of type. -
findNotificationByUserAndSpace
Find any user notification linked to the specified space regardless of type. -
findNotificationByUserAndContent
Notification findNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content) Find any user notification linked to the specified content. -
findNotificationsByContent
-
findNotificationsByContentId
Find all user notification linked to the specified content.- Parameters:
content
- id for which to find all the notifications- Returns:
- All the notifications active for that content
-
findNotificationsByContents
-
findNotificationByUserAndLabel
Find any user notification linked to the specified label. -
findNotificationsByLabel
-
findNotificationByUserAndSpaceAndType
Notification findNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type) Find the user notification linked to the specified space with a type specified - may be null if watching the whole space. -
findDailyReportNotification
Find the specified user's daily report notification.- Parameters:
username
-- Returns:
- a notification object or null if no daily report notification exists for the specified user.
-
findAllDailyReportNotifications
List<Notification> findAllDailyReportNotifications()Find all daily report notifications. These notifications are not associated with a page OR a space.- Returns:
- a list of notifications.
-
findGlobalBlogWatchForUser
Find the global blog notification for this user if they have one. -
findNetworkNotificationByUser
Find the Network notification for this user if they have one. -
findNotificationById
Find a notification by its ID -
findSiteBlogNotifications
List<Notification> findSiteBlogNotifications()Find the global blog notification for all users. -
findNotificationsByFollowing
-
isWatchingContent
Returns true if the given user is directly watching the given content.- Parameters:
user
- user to checkcontent
- content to check- Returns:
- true if the given user is directly watching the given content
- Since:
- 5.9
-