com.silverpeas.notification
Class SilverpeasNotification

java.lang.Object
  extended by com.silverpeas.notification.SilverpeasNotification
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AttachmentDeletionNotification, NodeDeletionNotification, PublicationDeletionNotification

public class SilverpeasNotification
extends Object
implements Serializable

A notification emitted within the Silverpeas system. A notification informs about an event or an action that has occured in a Silverpeas component instance and in what a given object or resource is involved. For example, the creation of a publication can be notified with the publication (or its unique identifier) as object of the announcement. This class can be extended in order to represent a specified type of notifications with which some publishers and subscribers work on.

See Also:
Serialized Form

Constructor Summary
SilverpeasNotification(NotificationSource source, Serializable object)
          Constructs a new notification involving the specified object and triggered by the specified source.
SilverpeasNotification(NotificationSource source, SilverpeasNotificationCause cause, Serializable object)
          Constructs a new notification involving the specified object and triggered by the specified source.
 
Method Summary
 void addParameter(String name, String value)
          Adds a new parameter to this notification.
 SilverpeasNotificationCause getCause()
          Gets the cause of this notification.
 Serializable getObject()
          Gets the object focusing by this notification.
 Set<String> getParameters()
          Gets the set of this notification's parameters.
 String getParameterValue(String name)
          Gets the value of the specified parameter.
 NotificationSource getSource()
          Gets the source of this notification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SilverpeasNotification

public SilverpeasNotification(NotificationSource source,
                              Serializable object)
Constructs a new notification involving the specified object and triggered by the specified source.

Parameters:
source - the source of the notification.
object - the object on which the notification is focusing.

SilverpeasNotification

public SilverpeasNotification(NotificationSource source,
                              SilverpeasNotificationCause cause,
                              Serializable object)
Constructs a new notification involving the specified object and triggered by the specified source.

Parameters:
source - the source of the notification.
cause - the cause of the notification.
object - the object on which the notification is focusing.
Method Detail

getObject

public Serializable getObject()
Gets the object focusing by this notification.

Returns:
the object involving in an event or an action this notification informs.

getSource

public NotificationSource getSource()
Gets the source of this notification.

Returns:
the notification source.

addParameter

public void addParameter(String name,
                         String value)
Adds a new parameter to this notification. Parameters in notification carries additional information and ahs to be simple.

Parameters:
name - the parameter name.
value - the parameter value.

getParameterValue

public String getParameterValue(String name)
Gets the value of the specified parameter. If the parameter isn't set in the notification, then null is returned.

Parameters:
name - the name of the parameter to get.
Returns:
the value of the parameter or null if no such parameter is set in this notification.

getParameters

public Set<String> getParameters()
Gets the set of this notification's parameters.

Returns:
an unmodifiable set of parameter names.

getCause

public SilverpeasNotificationCause getCause()
Gets the cause of this notification.

Returns:
a cause.


Copyright © 2016 Silverpeas. All Rights Reserved.