com.atlassian.confluence.mail.notification.listeners
Class NotificationData

java.lang.Object
  extended by com.atlassian.confluence.mail.notification.listeners.NotificationData

public class NotificationData
extends Object

Data that is related to a set of notifications about a change in the system. This is a like a template for all the notifications that are sent for a single event.

See Also:
NotificationContext

Constructor Summary
NotificationData(com.atlassian.user.User modifier, boolean shouldNotifyOnOwnActions, ConfluenceEntityObject permissionEntity)
           
NotificationData(com.atlassian.user.User modifier, boolean shouldNotifyOnOwnActions, ConfluenceEntityObject permissionEntity, String subject, String templateName, Collection<DataSource> templateImageDataSources)
           
 
Method Summary
 void addAllToContext(Map<String,Serializable> map)
           
 void addDoNotNotifyAgain(String userName)
           
 void addTemplateImage(DataSource dataSource)
          Adds a datasource to the current set of datasources for all emails.
 void addToContext(String key, Serializable value)
           
 NotificationContext cloneContext()
          Returns a copy of the common context for this Notification that can be used to populate a single email.
 boolean doNotNotifyAgain(String userName)
           
 NotificationContext getCommonContext()
           
 Map<String,Object> getContext()
          Deprecated. Use getCommonContext().getMap() instead
 com.atlassian.user.User getModifier()
           
 ConfluenceEntityObject getPermissionEntity()
          User must have VIEW permission on this entity in order to receive the notification.
 String getSubject()
           
 ArrayList<DataSource> getTemplateImageDataSources()
          Deprecated. Single emails may add datasources, therefore this method mustn't be used anymore. Use NotificationContext.getTemplateImageDataSources() instead.
 String getTemplateName()
           
 void setSubject(String subject)
           
 void setTemplateName(String templateName)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotificationData

public NotificationData(com.atlassian.user.User modifier,
                        boolean shouldNotifyOnOwnActions,
                        ConfluenceEntityObject permissionEntity)
Parameters:
modifier - user who triggered the event that led to creating a notification.

NotificationData

public NotificationData(com.atlassian.user.User modifier,
                        boolean shouldNotifyOnOwnActions,
                        ConfluenceEntityObject permissionEntity,
                        String subject,
                        String templateName,
                        Collection<DataSource> templateImageDataSources)
Method Detail

getContext

public Map<String,Object> getContext()
Deprecated. Use getCommonContext().getMap() instead

Returns the common context. Do not use to update the values.

Returns:
the common context map

addToContext

public void addToContext(String key,
                         Serializable value)

addAllToContext

public void addAllToContext(Map<String,Serializable> map)

getTemplateName

public String getTemplateName()

getSubject

public String getSubject()

getModifier

public com.atlassian.user.User getModifier()

setSubject

public void setSubject(String subject)

setTemplateName

public void setTemplateName(String templateName)

doNotNotifyAgain

public boolean doNotNotifyAgain(String userName)

addDoNotNotifyAgain

public void addDoNotNotifyAgain(String userName)

getPermissionEntity

public ConfluenceEntityObject getPermissionEntity()
User must have VIEW permission on this entity in order to receive the notification.


toString

public String toString()
Overrides:
toString in class Object

addTemplateImage

public void addTemplateImage(DataSource dataSource)
Adds a datasource to the current set of datasources for all emails.

Parameters:
dataSource - the datasource
See Also:
if you intend to add the image for one notification only.

cloneContext

public NotificationContext cloneContext()
Returns a copy of the common context for this Notification that can be used to populate a single email.


getCommonContext

public NotificationContext getCommonContext()

getTemplateImageDataSources

public ArrayList<DataSource> getTemplateImageDataSources()
Deprecated. Single emails may add datasources, therefore this method mustn't be used anymore. Use NotificationContext.getTemplateImageDataSources() instead.

Returns the datasources for images for all e-mails.

Returns:
a list of unique DataSources, in a non-deterministic order


Copyright © 2003-2013 Atlassian. All Rights Reserved.