Interface NotificationDao
- All Superinterfaces:
BambooObjectDao
,bucket.core.persistence.ObjectDao
- All Known Implementing Classes:
NotificationHibernateDao
-
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 interface com.atlassian.bamboo.persistence.BambooObjectDao
findById
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, getPersistentClass, refresh, remove, replicate, save, saveRaw
-
Method Details
-
deleteNotification
Used to remove a notification from db. This should cascade to delete associated recipients- Parameters:
rule
- Complete NotificationRule Object
-
saveNotificationRule
Save new/existing notification rule- Parameters:
newRule
- New or Existing NotificationRule Object
-
saveNotificationSet
Save new/existing notification set.- Parameters:
notificationSet
- New or existing notification set. Must be an instance ofEntityObject
.- Throws:
IllegalArgumentException
- If the given notification set is not an instance ofEntityObject
-
getNotificationRulesForRecipients
@NotNull @NotNull List<UsersNotification> getNotificationRulesForRecipients(@NotNull @NotNull String recipientType, @NotNull @NotNull Collection<String> recipients) Retrieve all notification rules of a specific type matching the given list of recipient values.- 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 @NotNull List<UsersNotification> getWatcherNotificationRulesForRecipientUsername(@NotNull @NotNull String recipientUsername) Retrieve all watcher recipient type notification rules for a given recipient username.- Parameters:
recipientUsername
- Username value to match- Returns:
- List of user notifications
-
getNotificationSetsForType
@NotNull @NotNull List<NotificationSet> getNotificationSetsForType(NotificationSet.NotificationSetType type) Retrieve notification sets belonging to a specific type.- Parameters:
type
- to be retrieved- Returns:
- List of notification sets.
-
getNotificationSetForId
Retrieve notification set belonging to a specific id.- Parameters:
notificationSetId
- of the searched entity- Returns:
- Found notificationSet.
-