Class CommentUserNotificationService

  • All Implemented Interfaces:
    ResourceEventListener<CommentEvent>

    @Service
    public class CommentUserNotificationService
    extends CDIResourceEventListener<CommentEvent>
    A service dedicated to notify users about the adding of a comment to a contribution in Silverpeas.

    This service listens for creation events on comments to perform its task. For each new comment a notification is sent to all users concerned by the comment. A user is concerned if he has participated in the comment flow of the related contribution or if he's an author of the contribution.

    Author:
    mmoquillon
    • Constructor Detail

      • CommentUserNotificationService

        public CommentUserNotificationService()
    • Method Detail

      • onCreation

        public void onCreation​(CommentEvent event)
                        throws Exception
        Description copied from interface: ResourceEventListener
        An event on the creation of a resource has be listened. By default, this method does nothing.
        Parameters:
        event - the event on the creation of a resource.
        Throws:
        Exception - if an error occurs while treating the event.
      • notifyUsers

        protected void notifyUsers​(NotificationMetaData notification)
                            throws NotificationException
        Notifies the specified users, identified by their identifier, with the specified notification information.
        Parameters:
        notification - the notification information.
        Throws:
        NotificationException - if the notification of the recipients fail.