com.silverpeas.notification
Class NotificationSource

java.lang.Object
  extended by com.silverpeas.notification.NotificationSource
All Implemented Interfaces:
Serializable

public class NotificationSource
extends Object
implements Serializable

The source from which a notification was generated. Usually, a notification is triggered by a user action and it informs the event concerning the resource involved in the action. For example, the creation of a new publication by a user in Silverpeas. So the notification is always generated within the scope of a Silverpeas component instance and may involve the action of a given user. This class can be extended to provide additional information about the context of the notification generation.

See Also:
Serialized Form

Constructor Summary
NotificationSource()
           
 
Method Summary
 String getComponentInstanceId()
          Gets the unique identifier of the Silverpeas component instance within which a notification was occured.
 String getUserId()
          Gets the unique identifier of the user performed the action that has triggered the notification.
 NotificationSource withComponentInstanceId(String componentId)
          Sets the unique identifier of the Silverpeas component instance within which the notification is occuring.
 NotificationSource withUserId(String userId)
          Sets the unique identifier of the user that is involved in the notification by performing an action on a Silverpeas managed resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationSource

public NotificationSource()
Method Detail

getComponentInstanceId

public String getComponentInstanceId()
Gets the unique identifier of the Silverpeas component instance within which a notification was occured.

Returns:
the component instance identifier.

withComponentInstanceId

public NotificationSource withComponentInstanceId(String componentId)
Sets the unique identifier of the Silverpeas component instance within which the notification is occuring.

Parameters:
componentId - the component instance identifier.
Returns:
itself.

getUserId

public String getUserId()
Gets the unique identifier of the user performed the action that has triggered the notification. If no users were involved in the notification, null is returned.

Returns:
the user identifier or null if no users were involved in the notification.

withUserId

public NotificationSource withUserId(String userId)
Sets the unique identifier of the user that is involved in the notification by performing an action on a Silverpeas managed resource.

Parameters:
userId - the user identifier.
Returns:
itself.


Copyright © 2016 Silverpeas. All Rights Reserved.