Interface NotificationDao
-
- All Superinterfaces:
ObjectDao
- All Known Subinterfaces:
NotificationDaoInternal
- All Known Implementing Classes:
CachingNotificationDao
,DelegatingNotificationDaoInternal
,HibernateNotificationDao
public interface NotificationDao extends ObjectDao
Data Access Object interface for dealing with notifications.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<Notification>
findAllDailyReportNotifications()
Find all daily report notifications.List<Notification>
findAllNotificationsBySpace(Space space)
Find all notifications linked to the specified space regardless of type specified.List<Notification>
findAllNotificationsByUser(com.atlassian.user.User user)
Find all notifications owned by the specified user, including digest etc.Notification
findDailyReportNotification(String username)
Find the specified user's daily report notification.Notification
findGlobalBlogWatchForUser(com.atlassian.user.User user)
Find the global blog notification for this user if they have one.Notification
findNetworkNotificationByUser(com.atlassian.user.User user)
Find the Network notification for this user if they have one.Notification
findNotificationById(long id)
Find a notification by its IDNotification
findNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content)
Find any user notification linked to the specified content.Notification
findNotificationByUserAndLabel(com.atlassian.user.User user, Label label)
Find any user notification linked to the specified label.Notification
findNotificationByUserAndSpace(com.atlassian.user.User user, Space space)
Find any user notification linked to the specified space regardless of type.Notification
findNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey)
Find any user notification linked to the specified space regardless of type.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.List<Notification>
findNotificationsByContent(ContentEntityObject content)
List<Notification>
findNotificationsByContents(List<ContentEntityObject> contents)
List<Notification>
findNotificationsByFollowing(com.atlassian.user.User user)
List<Notification>
findNotificationsByLabel(Label label)
List<Notification>
findNotificationsBySpaceAndType(Space space, ContentTypeEnum type)
Find all notifications linked to the specified space for a certain type.List<Notification>
findNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type)
Find all notifications linked to the specified spaces for a certain type.List<Notification>
findNotificationsByUser(com.atlassian.user.User user)
Find the space and page notifications owned by the specified user.Iterable<Long>
findPageAndSpaceNotificationIdsFromSpace(Space space)
Retrieves ids for all notifications in a space.List<Notification>
findSiteBlogNotifications()
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.-
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, findByClassIds, getPersistentClass, refresh, remove, replicate, save, saveRaw
-
-
-
-
Method Detail
-
findNotificationsByUser
List<Notification> findNotificationsByUser(com.atlassian.user.User user)
Find the space and page notifications owned by the specified user.- Returns:
- a list of Notification objects.
-
findAllNotificationsByUser
List<Notification> findAllNotificationsByUser(com.atlassian.user.User user)
Find all notifications owned by the specified user, including digest etc.- Returns:
- a list of Notification objects.
-
findAllNotificationsBySpace
List<Notification> findAllNotificationsBySpace(Space space)
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
Iterable<Long> findPageAndSpaceNotificationIdsFromSpace(Space space)
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
List<Notification> findNotificationsBySpaceAndType(Space space, ContentTypeEnum type)
Find all notifications linked to the specified space for a certain type.- Returns:
- a list of Notification objects.
-
findNotificationsBySpacesAndType
List<Notification> findNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type)
Find all notifications linked to the specified spaces for a certain type.- Returns:
- a list of Notification objects.
-
findNotificationByUserAndSpace
Notification findNotificationByUserAndSpace(com.atlassian.user.User user, String spaceKey)
Find any user notification linked to the specified space regardless of type.
-
findNotificationByUserAndSpace
Notification findNotificationByUserAndSpace(com.atlassian.user.User user, Space space)
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
List<Notification> findNotificationsByContent(ContentEntityObject content)
-
findNotificationsByContents
List<Notification> findNotificationsByContents(List<ContentEntityObject> contents)
-
findNotificationByUserAndLabel
Notification findNotificationByUserAndLabel(com.atlassian.user.User user, Label label)
Find any user notification linked to the specified label.
-
findNotificationsByLabel
List<Notification> findNotificationsByLabel(Label label)
-
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
Notification findDailyReportNotification(String username)
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
Notification findGlobalBlogWatchForUser(com.atlassian.user.User user)
Find the global blog notification for this user if they have one.
-
findNetworkNotificationByUser
Notification findNetworkNotificationByUser(com.atlassian.user.User user)
Find the Network notification for this user if they have one.
-
findNotificationById
Notification findNotificationById(long id)
Find a notification by its ID
-
findSiteBlogNotifications
List<Notification> findSiteBlogNotifications()
Find the global blog notification for all users.
-
findNotificationsByFollowing
List<Notification> findNotificationsByFollowing(com.atlassian.user.User user)
-
isWatchingContent
boolean isWatchingContent(@NonNull ConfluenceUser user, @NonNull ContentEntityObject content)
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
-
-