Class CommentUserNotificationService
- java.lang.Object
-
- org.silverpeas.core.notification.system.CDIResourceEventListener<CommentEvent>
-
- org.silverpeas.core.comment.service.notification.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
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.notification.system.CDIResourceEventListener
logger
-
-
Constructor Summary
Constructors Constructor Description CommentUserNotificationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CommentService
getCommentService()
protected NotificationSender
getNotificationSender(String componentInstanceId)
protected void
notifyUsers(NotificationMetaData notification)
Notifies the specified users, identified by their identifier, with the specified notification information.void
onCreation(CommentEvent event)
An event on the creation of a resource has be listened.-
Methods inherited from class org.silverpeas.core.notification.system.CDIResourceEventListener
onEvent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.notification.system.ResourceEventListener
dispatchEvent, isEnabled, onDeletion, onMove, onRecovery, onRemoving, onUnlock, onUpdate
-
-
-
-
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.
-
getNotificationSender
protected NotificationSender getNotificationSender(String componentInstanceId)
-
getCommentService
protected CommentService getCommentService()
-
-