Class NotificationHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.persistence.BambooHibernateObjectDao
-
- com.atlassian.bamboo.notification.NotificationHibernateDao
-
- All Implemented Interfaces:
bucket.core.persistence.ObjectDao
,NotificationDao
,BambooObjectDao
,org.springframework.beans.factory.InitializingBean
public class NotificationHibernateDao extends BambooHibernateObjectDao implements NotificationDao
-
-
Constructor Summary
Constructors Constructor Description NotificationHibernateDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteNotification(NotificationRule rule)
Used to remove a notification from db.@NotNull List<UsersNotification>
getNotificationRulesForRecipients(@NotNull String recipientType, @NotNull Collection<String> recipients)
Retrieve all notification rules of a specific type matching the given list of recipient values.@NotNull List<UsersNotification>
getNotificationRulesForRecipientType(String recipientType)
Retrieve All notification rules with a specific recipient type (useful for retrieveing watchers and committers)@Nullable NotificationSet
getNotificationSetForId(long notificationSetId)
Retrieve notification set belonging to a specific id.@NotNull List<NotificationSet>
getNotificationSetsForType(NotificationSet.NotificationSetType type)
Retrieve notification sets belonging to a specific type.Class
getPersistentClass()
@NotNull List<UsersNotification>
getWatcherNotificationRulesForRecipientUsername(@NotNull String recipientUsername)
Retrieve all watcher recipient type notification rules for a given recipient username.void
saveNotificationRule(NotificationRule newRule)
Save new/existing notification rulevoid
saveNotificationSet(@NotNull NotificationSet notificationSet)
Save new/existing notification set.-
Methods inherited from class com.atlassian.bamboo.persistence.BambooHibernateObjectDao
findAll, findAllSorted, findById, findById, refresh, remove, replicate, save, saveRaw, updateModificationData
-
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.persistence.BambooObjectDao
findById
-
-
-
-
Method Detail
-
getPersistentClass
public Class getPersistentClass()
- Specified by:
getPersistentClass
in interfacebucket.core.persistence.ObjectDao
-
deleteNotification
public void deleteNotification(NotificationRule rule)
Description copied from interface:NotificationDao
Used to remove a notification from db. This should cascade to delete associated recipients- Specified by:
deleteNotification
in interfaceNotificationDao
- Parameters:
rule
- Complete NotificationRule Object
-
saveNotificationRule
public void saveNotificationRule(NotificationRule newRule)
Description copied from interface:NotificationDao
Save new/existing notification rule- Specified by:
saveNotificationRule
in interfaceNotificationDao
- Parameters:
newRule
- New or Existing NotificationRule Object
-
saveNotificationSet
public void saveNotificationSet(@NotNull @NotNull NotificationSet notificationSet)
Description copied from interface:NotificationDao
Save new/existing notification set.- Specified by:
saveNotificationSet
in interfaceNotificationDao
- Parameters:
notificationSet
- New or existing notification set. Must be an instance ofEntityObject
.
-
getNotificationRulesForRecipients
@NotNull public @NotNull List<UsersNotification> getNotificationRulesForRecipients(@NotNull @NotNull String recipientType, @NotNull @NotNull Collection<String> recipients)
Description copied from interface:NotificationDao
Retrieve all notification rules of a specific type matching the given list of recipient values.- Specified by:
getNotificationRulesForRecipients
in interfaceNotificationDao
- Parameters:
recipientType
- the key of the recipient type to search forrecipients
- a list of values to match (eg email addresses, usernames etc)- Returns:
- List of user notifications
-
getNotificationRulesForRecipientType
@NotNull public @NotNull List<UsersNotification> getNotificationRulesForRecipientType(String recipientType)
Description copied from interface:NotificationDao
Retrieve All notification rules with a specific recipient type (useful for retrieveing watchers and committers)- Specified by:
getNotificationRulesForRecipientType
in interfaceNotificationDao
- Returns:
- List of user notifications
-
getWatcherNotificationRulesForRecipientUsername
@NotNull public @NotNull List<UsersNotification> getWatcherNotificationRulesForRecipientUsername(@NotNull @NotNull String recipientUsername)
Description copied from interface:NotificationDao
Retrieve all watcher recipient type notification rules for a given recipient username.- Specified by:
getWatcherNotificationRulesForRecipientUsername
in interfaceNotificationDao
- Parameters:
recipientUsername
- Username value to match- Returns:
- List of user notifications
-
getNotificationSetsForType
@NotNull public @NotNull List<NotificationSet> getNotificationSetsForType(NotificationSet.NotificationSetType type)
Description copied from interface:NotificationDao
Retrieve notification sets belonging to a specific type.- Specified by:
getNotificationSetsForType
in interfaceNotificationDao
- Parameters:
type
- to be retrieved- Returns:
- List of notification sets.
-
getNotificationSetForId
@Nullable public @Nullable NotificationSet getNotificationSetForId(long notificationSetId)
Description copied from interface:NotificationDao
Retrieve notification set belonging to a specific id.- Specified by:
getNotificationSetForId
in interfaceNotificationDao
- Parameters:
notificationSetId
- of the searched entity- Returns:
- Found notificationSet.
-
-