Interface NotificationDao
-
- All Superinterfaces:
BambooObjectDao,bucket.core.persistence.ObjectDao
- All Known Implementing Classes:
NotificationHibernateDao
public interface NotificationDao extends BambooObjectDao
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voiddeleteNotification(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)Deprecated.since 8.1: The method is not applicable anymore.@Nullable NotificationSetgetNotificationSetForId(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.@NotNull List<UsersNotification>getWatcherNotificationRulesForRecipientUsername(@NotNull String recipientUsername)Retrieve all watcher recipient type notification rules for a given recipient username.voidsaveNotificationRule(NotificationRule newRule)Save new/existing notification rulevoidsaveNotificationSet(@NotNull NotificationSet notificationSet)Save new/existing notification set.-
Methods inherited from interface com.atlassian.bamboo.persistence.BambooObjectDao
findById
-
-
-
-
Method Detail
-
deleteNotification
void deleteNotification(NotificationRule rule)
Used to remove a notification from db. This should cascade to delete associated recipients- Parameters:
rule- Complete NotificationRule Object
-
saveNotificationRule
void saveNotificationRule(NotificationRule newRule)
Save new/existing notification rule- Parameters:
newRule- New or Existing NotificationRule Object
-
saveNotificationSet
void saveNotificationSet(@NotNull @NotNull NotificationSet notificationSet)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
-
getNotificationRulesForRecipientType
@Deprecated @NotNull @NotNull List<UsersNotification> getNotificationRulesForRecipientType(String recipientType)
Deprecated.since 8.1: The method is not applicable anymore. The previous use cases were replaced with more specific queries (look at getWatcherNotificationRulesForRecipientUsername).Retrieve All notification rules with a specific recipient type (useful for retrieveing watchers and committers)- Parameters:
recipientType-- 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
@Nullable @Nullable NotificationSet getNotificationSetForId(long notificationSetId)
Retrieve notification set belonging to a specific id.- Parameters:
notificationSetId- of the searched entity- Returns:
- Found notificationSet.
-
-