com.atlassian.confluence.mail.notification.persistence.dao.hibernate
Class HibernateNotificationDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
                  extended by com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao
                      extended by com.atlassian.confluence.mail.notification.persistence.dao.hibernate.HibernateNotificationDao
All Implemented Interfaces:
ObjectDao, VersionedObjectDao, NotificationDao, org.springframework.beans.factory.InitializingBean

public class HibernateNotificationDao
extends ConfluenceHibernateObjectDao
implements NotificationDao


Field Summary
 
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateNotificationDao()
           
 
Method Summary
 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 findNotificationByUserAndPage(com.atlassian.user.User user, AbstractPage page)
           
 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> findNotificationsByFollowing(com.atlassian.user.User user)
           
 List<Notification> findNotificationsByPage(AbstractPage page)
          Find the notifications linked to the specified content.
 List<Notification> findNotificationsBySpace(Space space)
          Find the notifications linked to the specified space regardless of type specified.
 List<Notification> findNotificationsBySpaceAndType(Space space, ContentTypeEnum type)
          Find all notifications linked to the specified space 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.
 Class getPersistentClass()
           
 void removeAllNotificationsForUser(com.atlassian.user.User user)
          Remove all the notifications for a particular user.
 void removeDailyReportNotificationForUser(String username)
           
 
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsIterator, save, setCacheFactory, updateModificationData
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
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 bucket.core.persistence.ObjectDao
findAll, findAllSorted, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

HibernateNotificationDao

public HibernateNotificationDao()
Method Detail

findNotificationsByUser

public List<Notification> findNotificationsByUser(com.atlassian.user.User user)
Description copied from interface: NotificationDao
Find the space and page notifications owned by the specified user.

Specified by:
findNotificationsByUser in interface NotificationDao
Returns:
a list of Notification objects.

findAllNotificationsByUser

public List<Notification> findAllNotificationsByUser(com.atlassian.user.User user)
Description copied from interface: NotificationDao
Find all notifications owned by the specified user, including digest etc.

Specified by:
findAllNotificationsByUser in interface NotificationDao
Returns:
a list of Notification objects.

findNotificationsByPage

public List<Notification> findNotificationsByPage(AbstractPage page)
Description copied from interface: NotificationDao
Find the notifications linked to the specified content.

Specified by:
findNotificationsByPage in interface NotificationDao
Returns:
a list of Notification objects.

findNotificationsBySpace

public List<Notification> findNotificationsBySpace(Space space)
Description copied from interface: NotificationDao
Find the notifications linked to the specified space regardless of type specified.

Specified by:
findNotificationsBySpace in interface NotificationDao
Returns:
a list of Notification objects.

findAllNotificationsBySpace

public List<Notification> findAllNotificationsBySpace(Space space)
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 interface NotificationDao
Returns:
a list of Notification objects.

findPageAndSpaceNotificationIdsFromSpace

public Iterable<Long> findPageAndSpaceNotificationIdsFromSpace(Space space)
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 interface NotificationDao
Parameters:
space - a space to find the notifications for
Returns:
ids of all the notifications in the space.

findNotificationsBySpaceAndType

public List<Notification> findNotificationsBySpaceAndType(Space space,
                                                          ContentTypeEnum type)
Description copied from interface: NotificationDao
Find all notifications linked to the specified space for a certain type.

Specified by:
findNotificationsBySpaceAndType in interface NotificationDao
Returns:
a list of Notification objects.

findNotificationByUserAndPage

public Notification findNotificationByUserAndPage(com.atlassian.user.User user,
                                                  AbstractPage page)
Specified by:
findNotificationByUserAndPage in interface NotificationDao

findNotificationByUserAndSpace

public Notification findNotificationByUserAndSpace(com.atlassian.user.User user,
                                                   Space space)
Description copied from interface: NotificationDao
Find any user notification linked to the specified space regardless of type.

Specified by:
findNotificationByUserAndSpace in interface NotificationDao

findNotificationByUserAndSpace

public Notification findNotificationByUserAndSpace(com.atlassian.user.User user,
                                                   String spaceKey)
Description copied from interface: NotificationDao
Find any user notification linked to the specified space regardless of type.

Specified by:
findNotificationByUserAndSpace in interface NotificationDao

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 interface NotificationDao

removeAllNotificationsForUser

public void removeAllNotificationsForUser(com.atlassian.user.User user)
Description copied from interface: NotificationDao
Remove all the notifications for a particular user. This will not include the daily report notifications

Specified by:
removeAllNotificationsForUser in interface NotificationDao
Parameters:
user - the user to remove all notifications for

removeDailyReportNotificationForUser

public void removeDailyReportNotificationForUser(String username)
Specified by:
removeDailyReportNotificationForUser in interface NotificationDao

findDailyReportNotification

public Notification findDailyReportNotification(String username)
Description copied from interface: NotificationDao
Find the specified user's daily report notification.

Specified by:
findDailyReportNotification in interface NotificationDao
Returns:
a notification object or null if no daily report notification exists for the specified user.

findAllDailyReportNotifications

public List<Notification> 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 interface NotificationDao
Returns:
a list of notifications.

findGlobalBlogWatchForUser

public Notification findGlobalBlogWatchForUser(com.atlassian.user.User user)
Find the global blog notification for this user if they have one.

Specified by:
findGlobalBlogWatchForUser in interface NotificationDao

findNetworkNotificationByUser

public Notification findNetworkNotificationByUser(com.atlassian.user.User user)
Find the Network notification for this user if they have one.

Specified by:
findNetworkNotificationByUser in interface NotificationDao

findSiteBlogNotifications

public List<Notification> findSiteBlogNotifications()
Description copied from interface: NotificationDao
Find the global blog notification for all users.

Specified by:
findSiteBlogNotifications in interface NotificationDao

findNotificationsByFollowing

public List<Notification> findNotificationsByFollowing(com.atlassian.user.User user)
Specified by:
findNotificationsByFollowing in interface NotificationDao

getPersistentClass

public Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao


Copyright © 2003-2012 Atlassian. All Rights Reserved.