com.atlassian.confluence.mail.notification.listeners
Class AbstractNotificationsListener<T extends com.atlassian.event.Event>

java.lang.Object
  extended by com.atlassian.confluence.mail.notification.listeners.AbstractNotificationsListener<T>
All Implemented Interfaces:
com.atlassian.event.EventListener
Direct Known Subclasses:
AttachmentNotificationsListener, BlogPostNotificationsListener, CommentNotificationsListener, FollowNotificationListener, UserSignUpNotificationsListener, UserStatusNotificationsListener

public abstract class AbstractNotificationsListener<T extends com.atlassian.event.Event>
extends java.lang.Object
implements com.atlassian.event.EventListener


Field Summary
protected  DataSourceFactory dataSourceFactory
           
protected  NotificationManager notificationManager
           
protected  NotificationsSender notificationsSender
           
protected  com.atlassian.core.task.MultiQueueTaskManager taskManager
           
protected  UserAccessor userAccessor
           
protected  Renderer viewRenderer
           
 
Constructor Summary
AbstractNotificationsListener()
           
 
Method Summary
protected  void attachAvatar(NotificationData notificationData)
           
protected abstract  ContentEntityObject getContentEntityObject(java.util.Map contextMap)
          Returns the content entity used for the render context.
protected  ConversionContext getConversionContext(NotificationData notificationData)
           
protected  NotificationData getNotificationDataForEvent(com.atlassian.event.Event event, ConfluenceEntityObject entity)
           
 void handleEvent(com.atlassian.event.Event event)
           
protected abstract  void processNotifications(T event)
          Generates the notifications associated with an event.
protected  void sendNotification(Notification notification, NotificationData notificationData)
          Sends content-based notifications.
protected  void sendNotification(java.lang.String recipient, NotificationContext context, NotificationData notificationData)
          Sends a notification.
protected  void sendNotifications(java.util.List<Notification> notifications, NotificationData notificationData)
          Sends the notificationData to each user listed in notifications, as long as they are permitted to see it.
 void setDataSourceFactory(DataSourceFactory dataSourceFactory)
           
 void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
          Deprecated. since 5.2. No longer required.
 void setHtmlDiffer(Differ differ)
          Deprecated. since 5.2. No longer required.
 void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
          Deprecated. since 5.2. No longer required.
 void setLocaleManager(LocaleManager localeManager)
          Deprecated. since 5.2. No longer required.
 void setNotificationManager(NotificationManager notificationManager)
           
 void setNotificationRenderManager(NotificationRenderManager notificationRenderManager)
          Deprecated. since 5.2. No longer required.
 void setNotificationsSender(NotificationsSender notificationsSender)
           
 void setPermissionManagerTarget(DefaultPermissionManager permissionManager)
          Deprecated. since 5.2. No longer required.
 void setTaskManager(com.atlassian.core.task.MultiQueueTaskManager taskManager)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 void setViewRenderer(Renderer renderer)
           
 void setWebResourceManager(com.atlassian.plugin.webresource.WebResourceManager webResourceManager)
          Deprecated. since 5.2. No longer required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.event.EventListener
getHandledEventClasses
 

Field Detail

userAccessor

protected UserAccessor userAccessor

taskManager

protected com.atlassian.core.task.MultiQueueTaskManager taskManager

notificationManager

protected NotificationManager notificationManager

viewRenderer

protected Renderer viewRenderer

dataSourceFactory

protected DataSourceFactory dataSourceFactory

notificationsSender

protected NotificationsSender notificationsSender
Constructor Detail

AbstractNotificationsListener

public AbstractNotificationsListener()
Method Detail

handleEvent

public void handleEvent(com.atlassian.event.Event event)
Specified by:
handleEvent in interface com.atlassian.event.EventListener

processNotifications

protected abstract void processNotifications(T event)
Generates the notifications associated with an event. This method should never be run if the Event is a ContentEvent with suppressNotifications set to true.


sendNotification

protected final void sendNotification(Notification notification,
                                      NotificationData notificationData)
Sends content-based notifications. Generates link to stop watching a notification and adds a link to manage content notification settings

Parameters:
notification - the watch that triggered the notification being sent
notificationData - data for rendering the email

sendNotification

protected final void sendNotification(java.lang.String recipient,
                                      NotificationContext context,
                                      NotificationData notificationData)
Sends a notification. Checks the permissions before sending.

Parameters:
notificationData - the data template for all emails. Should not be modified.

attachAvatar

protected void attachAvatar(NotificationData notificationData)

getContentEntityObject

protected abstract ContentEntityObject getContentEntityObject(java.util.Map contextMap)
Returns the content entity used for the render context.


sendNotifications

protected void sendNotifications(java.util.List<Notification> notifications,
                                 NotificationData notificationData)
Sends the notificationData to each user listed in notifications, as long as they are permitted to see it.


getNotificationDataForEvent

protected final NotificationData getNotificationDataForEvent(com.atlassian.event.Event event,
                                                             ConfluenceEntityObject entity)

getConversionContext

protected ConversionContext getConversionContext(NotificationData notificationData)

setNotificationManager

public void setNotificationManager(NotificationManager notificationManager)

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

setTaskManager

public void setTaskManager(com.atlassian.core.task.MultiQueueTaskManager taskManager)

setViewRenderer

public void setViewRenderer(Renderer renderer)

setDataSourceFactory

public void setDataSourceFactory(DataSourceFactory dataSourceFactory)

setNotificationsSender

public void setNotificationsSender(NotificationsSender notificationsSender)

setPermissionManagerTarget

@Deprecated
public void setPermissionManagerTarget(DefaultPermissionManager permissionManager)
Deprecated. since 5.2. No longer required.


setNotificationRenderManager

@Deprecated
public void setNotificationRenderManager(NotificationRenderManager notificationRenderManager)
Deprecated. since 5.2. No longer required.


setFormatSettingsManager

@Deprecated
public void setFormatSettingsManager(FormatSettingsManager formatSettingsManager)
Deprecated. since 5.2. No longer required.


setWebResourceManager

@Deprecated
public void setWebResourceManager(com.atlassian.plugin.webresource.WebResourceManager webResourceManager)
Deprecated. since 5.2. No longer required.


setI18NBeanFactory

@Deprecated
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
Deprecated. since 5.2. No longer required.


setLocaleManager

@Deprecated
public void setLocaleManager(LocaleManager localeManager)
Deprecated. since 5.2. No longer required.


setHtmlDiffer

@Deprecated
public void setHtmlDiffer(Differ differ)
Deprecated. since 5.2. No longer required.



Copyright © 2003-2014 Atlassian. All Rights Reserved.