Interface AnnouncementService

    • Method Detail

      • markAnnouncementAsReadByUser

        AnnouncementUserJoin markAnnouncementAsReadByUser​(Announcement announcement,
                                                          User user)
        Mark an Announcement object as read by a User
        Parameters:
        announcement - The announcement to mark
        user - the user who's read the announcement
        Returns:
        An AnnouncementUserJoin object representing the relationship between the announcement and the user
      • markAnnouncementAsUnreadByUser

        void markAnnouncementAsUnreadByUser​(Announcement announcement,
                                            User user)
        Mark an Announcement as unread by a User
        Parameters:
        announcement - the announcement to mark
        user - the user to mark the announcement for
      • getReadUsersForAnnouncement

        java.util.List<AnnouncementUserJoin> getReadUsersForAnnouncement​(Announcement announcement)
        Get all of the Joins describing users that have comfirmed they've read a particular Announcement
        Parameters:
        announcement - The Announcement for which we want to load users that have read it
        Returns:
        List of Users that have read the announcement
      • getUnreadUsersForAnnouncement

        java.util.List<User> getUnreadUsersForAnnouncement​(Announcement announcement)
        Get a list of all of the Users that have not confirmed they've read the Announcement
        Parameters:
        announcement - The
        Returns:
        List of Users that haven't confirmed they've read the announcement
      • getReadAnnouncementsForUser

        java.util.List<AnnouncementUserJoin> getReadAnnouncementsForUser​(User user)
        Get a list of Announcements that have been read by User
        Parameters:
        user - User for whom we want to get unread announcements
        Returns:
        list of Join objects representing announcements marked as read by a user
      • getUnreadAnnouncementsForUser

        java.util.List<Announcement> getUnreadAnnouncementsForUser​(User user)
        Get a list of Announcements that have not been read by User
        Parameters:
        user - User for whom we want to get unread announcements
        Returns:
        List of Announcements that have not been read by the user
      • getAnnouncementsCreatedByUser

        java.util.List<Announcement> getAnnouncementsCreatedByUser​(User user)
        Get a list of Announcements created by specific admin User
        Parameters:
        user - The admin User who created the announcements
        Returns:
        List of announcements created by the admin, empty list if User is not an admin
      • countReadsForOneAnnouncement

        java.lang.Long countReadsForOneAnnouncement​(Announcement announcement)
        Get a count of the number of Users who have read Announcement
        Parameters:
        announcement - Announcement for which we want the number of users who have read it
        Returns:
        number of users who have read Announcement
      • countReadsForAllAnnouncements

        java.util.Map<Announcement,​java.lang.Long> countReadsForAllAnnouncements()
        Get a map where the keys are Announcements and the values are Integers representing the number of Users who have read that announcement.
        Returns:
        A Map of announcements and counts of users who have read that announcement