Class HibernateNotificationDao
java.lang.Object
org.springframework.dao.support.DaoSupport
com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao<Notification>
com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao
- All Implemented Interfaces:
NotificationDaoInternal
,NotificationDao
,org.springframework.beans.factory.InitializingBean
public class HibernateNotificationDao
extends ConfluenceHibernateObjectDao<Notification>
implements NotificationDaoInternal
-
Nested Class Summary
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
Constructors -
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 id) 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.void
remove
(Notification notification) Remove an object from the databaseMethods inherited from class com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao
updateModificationData
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, getHibernateTemplate, getSessionFactory, publishEvent, reIndex, save, saveEntity, saveRaw, setHibernateTemplate, setSessionFactory, uniqueResult
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.internal.notification.persistence.NotificationDaoInternal
findAll, save
-
Constructor Details
-
HibernateNotificationDao
public HibernateNotificationDao()
-
-
Method Details
-
findNotificationsByUser
Description copied from interface:NotificationDao
Find the space and page notifications owned by the specified user.- Specified by:
findNotificationsByUser
in interfaceNotificationDao
- Returns:
- a list of Notification objects.
-
findAllNotificationsByUser
Description copied from interface:NotificationDao
Find all notifications owned by the specified user, including digest etc.- Specified by:
findAllNotificationsByUser
in interfaceNotificationDao
- Returns:
- a list of Notification objects.
-
findAllNotificationsBySpace
Description copied from interface:NotificationDao
Find all notifications linked to the specified space regardless of type specified. This does not include notifications for pages in the space.- Specified by:
findAllNotificationsBySpace
in interfaceNotificationDao
- Returns:
- a list of Notification objects.
-
findPageAndSpaceNotificationIdsFromSpace
Description copied from interface:NotificationDao
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.- Specified by:
findPageAndSpaceNotificationIdsFromSpace
in interfaceNotificationDao
- Parameters:
space
- a space to find the notifications for- Returns:
- ids of all the notifications in the space.
-
findNotificationsBySpaceAndType
Description copied from interface:NotificationDao
Find all notifications linked to the specified space for a certain type.- Specified by:
findNotificationsBySpaceAndType
in interfaceNotificationDao
- Returns:
- a list of Notification objects.
-
findNotificationsBySpacesAndType
public List<Notification> findNotificationsBySpacesAndType(List<Space> spaces, ContentTypeEnum type) Description copied from interface:NotificationDao
Find all notifications linked to the specified spaces for a certain type.- Specified by:
findNotificationsBySpacesAndType
in interfaceNotificationDao
- Returns:
- a list of Notification objects.
-
findNotificationByUserAndSpace
Description copied from interface:NotificationDao
Find any user notification linked to the specified space regardless of type.- Specified by:
findNotificationByUserAndSpace
in interfaceNotificationDao
-
findNotificationByUserAndContent
public Notification findNotificationByUserAndContent(com.atlassian.user.User user, ContentEntityObject content) Description copied from interface:NotificationDao
Find any user notification linked to the specified content.- Specified by:
findNotificationByUserAndContent
in interfaceNotificationDao
-
findNotificationsByContent
- Specified by:
findNotificationsByContent
in interfaceNotificationDao
-
findNotificationsByContentId
Description copied from interface:NotificationDao
Find all user notification linked to the specified content.- Specified by:
findNotificationsByContentId
in interfaceNotificationDao
- Returns:
- All the notifications active for that content
-
findNotificationsByContents
- Specified by:
findNotificationsByContents
in interfaceNotificationDao
-
findNotificationByUserAndLabel
Description copied from interface:NotificationDao
Find any user notification linked to the specified label.- Specified by:
findNotificationByUserAndLabel
in interfaceNotificationDao
-
findNotificationsByLabel
- Specified by:
findNotificationsByLabel
in interfaceNotificationDao
-
findNotificationByUserAndSpace
Description copied from interface:NotificationDao
Find any user notification linked to the specified space regardless of type.- Specified by:
findNotificationByUserAndSpace
in interfaceNotificationDao
-
findNotificationByUserAndSpaceAndType
public Notification findNotificationByUserAndSpaceAndType(com.atlassian.user.User user, Space space, ContentTypeEnum type) Description copied from interface:NotificationDao
Find the user notification linked to the specified space with a type specified - may be null if watching the whole space.- Specified by:
findNotificationByUserAndSpaceAndType
in interfaceNotificationDao
-
findDailyReportNotification
Description copied from interface:NotificationDao
Find the specified user's daily report notification.- Specified by:
findDailyReportNotification
in interfaceNotificationDao
- Returns:
- a notification object or null if no daily report notification exists for the specified user.
-
findAllDailyReportNotifications
Description copied from interface:NotificationDao
Find all daily report notifications. These notifications are not associated with a page OR a space.- Specified by:
findAllDailyReportNotifications
in interfaceNotificationDao
- Returns:
- a list of notifications.
-
findGlobalBlogWatchForUser
Find the global blog notification for this user if they have one.- Specified by:
findGlobalBlogWatchForUser
in interfaceNotificationDao
-
findNetworkNotificationByUser
Find the Network notification for this user if they have one.- Specified by:
findNetworkNotificationByUser
in interfaceNotificationDao
-
findSiteBlogNotifications
Description copied from interface:NotificationDao
Find the global blog notification for all users.- Specified by:
findSiteBlogNotifications
in interfaceNotificationDao
-
findNotificationsByFollowing
- Specified by:
findNotificationsByFollowing
in interfaceNotificationDao
-
findNotificationById
Description copied from interface:NotificationDao
Find a notification by its ID- Specified by:
findNotificationById
in interfaceNotificationDao
-
isWatchingContent
public boolean isWatchingContent(@NonNull ConfluenceUser user, @NonNull ContentEntityObject content) Description copied from interface:NotificationDao
Returns true if the given user is directly watching the given content.- Specified by:
isWatchingContent
in interfaceNotificationDao
- Parameters:
user
- user to checkcontent
- content to check- Returns:
- true if the given user is directly watching the given content
-
getPersistentClass
- Specified by:
getPersistentClass
in classHibernateObjectDao<Notification>
-
remove
Description copied from class:HibernateObjectDao
Remove an object from the database- Specified by:
remove
in interfaceNotificationDaoInternal
- Overrides:
remove
in classHibernateObjectDao<Notification>
- Parameters:
notification
- the object to remove
-