|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.silverpeas.notification.DefaultNotificationSubscriber
com.silverpeas.comment.service.CommentActionListener
com.silverpeas.comment.service.notification.DefaultCommentUserNotificationService
@Named(value="commentUserNotificationService") public class DefaultCommentUserNotificationService
The default implementation of the user notification about events on the comments.
Field Summary | |
---|---|
protected static String |
DEFAULT_SUBJECT_COMMENT_ADDING
If no property with the subject of the notification message is defined in a Silverpeas component, then the below default property is taken. |
protected static String |
NOTIFICATION_COMMENT_ATTRIBUTE
The name of the attribute in a notification message that refers the comment responsable of the triggering of this service. |
protected static String |
NOTIFICATION_CONTENT_ATTRIBUTE
The name of the attribute in a notification message that refers the content commented by the comment responsable of the triggering of this service. |
Fields inherited from interface com.silverpeas.comment.service.CommentUserNotificationService |
---|
SUBJECT_COMMENT_ADDING |
Constructor Summary | |
---|---|
DefaultCommentUserNotificationService()
|
Method Summary | |
---|---|
void |
commentAdded(Comment newComment)
Sends a notification to the users that are concerned by the specified new comment on a given resource (publication, blog article, ...). |
void |
commentRemoved(Comment removedComment)
No notifications are sent to the users when a comment is removed. |
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 |
register(String component,
SilverpeasComponentService<? extends SilverpeasContent> service)
Registers a Silverpeas component as a source of notifications about the add, the update or the deletion of a comment. |
void |
unregister(String component)
Unregisters the specified component. |
Methods inherited from class com.silverpeas.comment.service.CommentActionListener |
---|
onNotification, subscribeOnTopics, unsubscribeOnTopics |
Methods inherited from class com.silverpeas.notification.DefaultNotificationSubscriber |
---|
getId, setId, subscribeForNotifications, unsubscribeForNotifications |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String DEFAULT_SUBJECT_COMMENT_ADDING
protected static final String NOTIFICATION_COMMENT_ATTRIBUTE
protected static final String NOTIFICATION_CONTENT_ATTRIBUTE
Constructor Detail |
---|
public DefaultCommentUserNotificationService()
Method Detail |
---|
public void register(String component, SilverpeasComponentService<? extends SilverpeasContent> service)
SilverpeasComponentService
object from which information about the commented
resource can be get. A Silverpeas component service must be passed so that for each received
event sent by an instance of the component, information about the commented resource can be get
in order to both check right accesses and send a well-formed notification to the users
interested by the event.
register
in interface CommentUserNotificationService
component
- the name of the Silverpeas component (it must be unique).service
- the Silverpeas component service from which information can be get for an
instance of the Silverpeas component.public void unregister(String component)
unregister
in interface CommentUserNotificationService
component
- the name of the Silverpeas component to unregister (it must be unique).public void commentAdded(Comment newComment)
commentAdded
in interface CommentUserNotificationService
commentAdded
in class CommentActionListener
newComment
- the new comment.public void commentRemoved(Comment removedComment)
commentRemoved
in interface CommentUserNotificationService
commentRemoved
in class CommentActionListener
removedComment
- the comment that is removed.protected void notifyUsers(NotificationMetaData notification) throws NotificationManagerException
notification
- the notification information.
NotificationManagerException
- if the notification of the recipients fail.protected NotificationSender getNotificationSender(String componentInstanceId)
protected CommentService getCommentService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |