Interface NotificationService

    • Method Detail

      • createNotification

        MLNotification createNotification​(org.acumos.cds.domain.MLPNotification body)
        Creates the notification in DB
        Parameters:
        body - MLPNotification
        Returns:
        MLNotification
      • getNotifications

        List<MLNotification> getNotifications()
        Fetch all the notifications from the DB
        Returns:
        List of paginated MLNotification
      • getUserNotifications

        List<org.acumos.cds.domain.MLPUserNotification> getUserNotifications​(String userId,
                                                                             org.acumos.cds.transport.RestPageRequest restPageRequest)
        Get the List of notifications for a user
        Parameters:
        userId -
        restPageRequest -
        Returns:
        List of notifications for user
      • addNotificationUser

        void addNotificationUser​(String notificationId,
                                 String userId)
        Add the generated notification to the user
        Parameters:
        notificationId -
        userId -
      • dropNotificationUser

        void dropNotificationUser​(String notificationId,
                                  String userId)
        Delete the notification for the user
        Parameters:
        notificationId -
        userId -
      • setNotificationUserViewed

        void setNotificationUserViewed​(String notificationId,
                                       String userId)
        Mark the notification as viewed for the user
        Parameters:
        notificationId -
        userId -
      • deleteNotification

        void deleteNotification​(String notificationId)
        Parameters:
        notificationId -
      • getNotificationCount

        int getNotificationCount()
        Get Count of all the notifications
        Returns:
        Number of notifications
      • generateNotification

        void generateNotification​(org.acumos.cds.domain.MLPNotification notification,
                                  String userId)
        Generate a notification for the user
        Parameters:
        notification -
        userId -
      • getUserNotifPrefByUserId

        List<MLUserNotifPref> getUserNotifPrefByUserId​(String userId)
        Get the notification preferences for the user
        Parameters:
        userId -
        Returns:
        List of notification preferences for the user
      • createUserNotificationPreference

        MLUserNotifPref createUserNotificationPreference​(MLUserNotifPref mlpUserNotifPref)
        Create a notification preference for the user
        Parameters:
        mlpUserNotifPref -
        Returns:
        Notification preference
      • updateUserNotificationPreference

        void updateUserNotificationPreference​(MLUserNotifPref mlpUserNotifPref)
        Update the notification preference
        Parameters:
        mlpUserNotifPref -
      • getUserUnreadNotificationCount

        int getUserUnreadNotificationCount​(String userId)
        Get Count of User unread notifications
        Returns:
        Number of notifications
      • getUserNotificationsPagination

        org.acumos.cds.transport.RestPageResponse<org.acumos.cds.domain.MLPUserNotification> getUserNotificationsPagination​(String userId,
                                                                                                                            org.acumos.cds.transport.RestPageRequest restPageRequest)
        Get the List of notifications for a user
        Parameters:
        userId -
        restPageRequest -
        Returns:
        List of notifications for user