com.silverpeas.notification
Interface NotificationSubscriber

All Superinterfaces:
EventListener
All Known Implementing Classes:
AttachmentSharingListener, CommentActionListener, DefaultCommentUserNotificationService, DefaultNotificationSubscriber, NodeSharingListener, PdcNotificationListener, PersonalizationNotificationListener, PublicationSharingListener

public interface NotificationSubscriber
extends EventListener

A subscriber of notifications published on a given topic in Silverpeas. The subscriber will be notified of the events or actions occuring in Silverpeas and about the subscribed topic. At subscription, the subscriber indicates the topic of the notifications it is interested on. It will be then informed of such notifications through the onNotification() callback; so that the subscriber is also a notification listener. The subscriber can subscribe several topics.


Method Summary
 String getId()
          Gets the unique identifier of this subscriber in the MOM system.
 void onNotification(SilverpeasNotification notification, NotificationTopic onTopic)
          Callback called at the reception of a notification on the topic on which it is listening.
 void setId(String id)
          Sets the unique identifier for this subscriber.
 void subscribeForNotifications(NotificationTopic onTopic)
          Subscribes to notifications received on the specified topic.
 void unsubscribeForNotifications(NotificationTopic onTopic)
          Unsubscribes from the notifications sent on the specified topic.
 

Method Detail

getId

String getId()
Gets the unique identifier of this subscriber in the MOM system. The identifier is computed during the subscription into a MOM system.

Returns:
the unique identifier of this subscriber.

setId

void setId(String id)
Sets the unique identifier for this subscriber. The identifier is set by the MOM system at subscription.

Parameters:
id - the unique identifier to set.

subscribeForNotifications

void subscribeForNotifications(NotificationTopic onTopic)
Subscribes to notifications received on the specified topic. If the topic doesn't exist, a SubscriptionException is thrown. If the subscriber is already subscribed to the specified topic, nothing is done.

Parameters:
onTopic - the topic on which this listener listens.

unsubscribeForNotifications

void unsubscribeForNotifications(NotificationTopic onTopic)
Unsubscribes from the notifications sent on the specified topic. If the subscriber isn't subscribed to the specified topic, then nothing is done.

Parameters:
onTopic - the topic to unsubscribe.

onNotification

void onNotification(SilverpeasNotification notification,
                    NotificationTopic onTopic)
Callback called at the reception of a notification on the topic on which it is listening.

Parameters:
notification - the received notification .
onTopic - the topic for which the notification was emitted.


Copyright © 2016 Silverpeas. All Rights Reserved.