Interface NotificationDao

    • 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 of EntityObject.
        Throws:
        IllegalArgumentException - If the given notification set is not an instance of EntityObject
      • 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 for
        recipients - 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.