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

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

public class NotificationData
extends java.lang.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, java.lang.String subject, java.lang.String templateName, java.util.Collection<javax.activation.DataSource> templateImageDataSources)
           
 
Method Summary
 void addAllToContext(java.util.Map<java.lang.String,java.io.Serializable> map)
           
 void addDoNotNotifyAgain(java.lang.String userName)
           
 void addTemplateImage(javax.activation.DataSource dataSource)
          Adds a datasource to the current set of datasources for all emails.
 void addToContext(java.lang.String key, java.io.Serializable value)
           
 NotificationContext cloneContext()
          Returns a copy of the common context for this Notification that can be used to populate a single email.
 NotificationContext cloneContextForRecipient(ConfluenceUser recipient)
          Returns a copy of the common context for this Notification that can be used to populate a single email for the specified recipient.
 boolean doNotNotifyAgain(java.lang.String userName)
           
 NotificationContext getCommonContext()
           
 java.util.Map<java.lang.String,java.lang.Object> getContext()
          Deprecated. since 4.3 Use getCommonContext()
 com.atlassian.user.User getModifier()
           
 ConfluenceEntityObject getPermissionEntity()
          User must have VIEW permission on this entity in order to receive the notification.
 java.lang.String getSubject()
           
 java.util.ArrayList<javax.activation.DataSource> getTemplateImageDataSources()
          Deprecated. since 4.3 Use NotificationContext.getTemplateImageDataSources()
 java.lang.String getTemplateName()
           
 void setSubject(java.lang.String subject)
           
 void setTemplateName(java.lang.String templateName)
           
 java.lang.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,
                        java.lang.String subject,
                        java.lang.String templateName,
                        java.util.Collection<javax.activation.DataSource> templateImageDataSources)
Method Detail

getContext

@Deprecated
public java.util.Map<java.lang.String,java.lang.Object> getContext()
Deprecated. since 4.3 Use getCommonContext()

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

Returns:
the common context map

addToContext

public void addToContext(java.lang.String key,
                         java.io.Serializable value)

addAllToContext

public void addAllToContext(java.util.Map<java.lang.String,java.io.Serializable> map)

getTemplateName

public java.lang.String getTemplateName()

getSubject

public java.lang.String getSubject()

getModifier

public com.atlassian.user.User getModifier()

setSubject

public void setSubject(java.lang.String subject)

setTemplateName

public void setTemplateName(java.lang.String templateName)

doNotNotifyAgain

public boolean doNotNotifyAgain(java.lang.String userName)

addDoNotNotifyAgain

public void addDoNotNotifyAgain(java.lang.String userName)

getPermissionEntity

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


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addTemplateImage

public void addTemplateImage(javax.activation.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. Use cloneContextForRecipient(ConfluenceUser) if possible.


cloneContextForRecipient

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


getCommonContext

public NotificationContext getCommonContext()

getTemplateImageDataSources

@Deprecated
public java.util.ArrayList<javax.activation.DataSource> getTemplateImageDataSources()
Deprecated. since 4.3 Use NotificationContext.getTemplateImageDataSources()

Returns the datasources for images for all e-mails.

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


Copyright © 2003-2014 Atlassian. All Rights Reserved.