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
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.@Nullable NotificationSet
getNotificationSetForId
(long notificationSetId) Retrieve notification set belonging to a specific id.@NotNull List<NotificationSet>
Retrieve notification sets belonging to a specific type.@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 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.bamboo.persistence.BambooObjectDao
findById
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, refresh, remove, replicate, save, saveRaw
-
Constructor Details
-
NotificationHibernateDao
public NotificationHibernateDao()
-
-
Method Details
-
getPersistentClass
- Specified by:
getPersistentClass
in interfacebucket.core.persistence.ObjectDao
-
deleteNotification
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
Description copied from interface:NotificationDao
Save new/existing notification rule- Specified by:
saveNotificationRule
in interfaceNotificationDao
- Parameters:
newRule
- New or Existing NotificationRule Object
-
saveNotificationSet
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
-
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
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.
-