Class NotificationData
- java.lang.Object
-
- 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
Constructors Constructor Description 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<javax.activation.DataSource> templateImageDataSources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllToContext(Map<String,Serializable> map)
void
addDoNotNotifyAgain(String userName)
void
addTemplateImage(javax.activation.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.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(String userName)
NotificationContext
getCommonContext()
com.atlassian.user.User
getModifier()
ConfluenceEntityObject
getPermissionEntity()
User must have VIEW permission on this entity in order to receive the notification.String
getSubject()
String
getTemplateName()
void
setSubject(String subject)
void
setTemplateName(String templateName)
String
toString()
-
-
-
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<javax.activation.DataSource> templateImageDataSources)
-
-
Method Detail
-
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.
-
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()
-
-