com.silverpeas.notification.delayed.delegate
Class DelayedNotificationDelegate

java.lang.Object
  extended by com.stratelia.silverpeas.notificationManager.AbstractNotification
      extended by com.silverpeas.notification.delayed.delegate.DelayedNotificationDelegate

public class DelayedNotificationDelegate
extends AbstractNotification

Author:
Yohann Chastagnier

Constructor Summary
protected DelayedNotificationDelegate()
          Default constructor
 
Method Summary
static void executeDelayedNotificationsSending(Date date)
          Easy call of delayed notifications process
static void executeForceDelayedNotificationsSending()
          Easy call of delayed notifications process.
static void executeForceDelayedNotificationsSending(int userId, Set<NotifChannel> channels)
          Easy call of delayed notifications process.
static void executeForceDelayedNotificationsSending(List<Integer> userIds, Set<NotifChannel> channels)
          Easy call of delayed notifications process.
static void executeNewNotification(DelayedNotificationData delayedNotificationData)
          Easy call of new notification process
static void executeUserDeleting(int userId)
          Deleting all delayed notification data of a user
static DelayedNotificationUserSetting executeUserSettingsUpdating(int userId, NotifChannel channel, DelayedNotificationFrequency frequency)
          When user settings change, if the new frequency is NONE then the delayed notifications saved have to be sent
protected  void forceDelayedNotificationsSending()
          Forces the sending of all the delayed notifications saved for all users
protected  void forceDelayedNotificationsSending(List<Integer> userIds, Set<NotifChannel> channels)
          Forces the sending of all the delayed notifications saved for given users and channels
protected  UserDetail getUserDetail(Integer userId)
          Centralizes the searches of user details with cache feature
protected  void performDelayedNotificationsSending(Date date, Set<NotifChannel> channels)
          Handling the saved delayed notifications from a given date and given channels
protected  void performNewNotificationSending(DelayedNotificationData delayedNotificationData)
          Handling a new notification
protected  void sendNotification(NotificationData notificationData)
          Centralizes notification sending
 
Methods inherited from class com.stratelia.silverpeas.notificationManager.AbstractNotification
computeURL, computeURL, getApplicationURL, getUserAutoRedirectSilverpeasServerURL, getUserAutoRedirectURL, getUserAutoRedirectURL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayedNotificationDelegate

protected DelayedNotificationDelegate()
Default constructor

Method Detail

executeUserDeleting

public static void executeUserDeleting(int userId)
                                throws Exception
Deleting all delayed notification data of a user

Parameters:
userId -
Throws:
Exception

executeUserSettingsUpdating

public static DelayedNotificationUserSetting executeUserSettingsUpdating(int userId,
                                                                         NotifChannel channel,
                                                                         DelayedNotificationFrequency frequency)
                                                                  throws Exception
When user settings change, if the new frequency is NONE then the delayed notifications saved have to be sent

Parameters:
userId -
channel -
frequency -
Throws:
Exception

executeNewNotification

public static void executeNewNotification(DelayedNotificationData delayedNotificationData)
                                   throws Exception
Easy call of new notification process

Parameters:
delayedNotificationData -
Throws:
Exception

performNewNotificationSending

protected void performNewNotificationSending(DelayedNotificationData delayedNotificationData)
                                      throws Exception
Handling a new notification

Parameters:
delayedNotificationData -
Throws:
Exception

executeDelayedNotificationsSending

public static void executeDelayedNotificationsSending(Date date)
                                               throws Exception
Easy call of delayed notifications process

Parameters:
date -
Throws:
Exception

executeForceDelayedNotificationsSending

public static void executeForceDelayedNotificationsSending()
                                                    throws Exception
Easy call of delayed notifications process. Forces the sending of all the delayed notifications saved for all users

Throws:
Exception

executeForceDelayedNotificationsSending

public static void executeForceDelayedNotificationsSending(int userId,
                                                           Set<NotifChannel> channels)
                                                    throws Exception
Easy call of delayed notifications process. Forces the sending of all the delayed notifications saved for a given user

Parameters:
userId -
channels -
Throws:
Exception

executeForceDelayedNotificationsSending

public static void executeForceDelayedNotificationsSending(List<Integer> userIds,
                                                           Set<NotifChannel> channels)
                                                    throws Exception
Easy call of delayed notifications process. Forces the sending of all the delayed notifications saved for given users and channels

Parameters:
userIds -
channels -
Throws:
Exception

forceDelayedNotificationsSending

protected void forceDelayedNotificationsSending()
                                         throws Exception
Forces the sending of all the delayed notifications saved for all users

Throws:
Exception

forceDelayedNotificationsSending

protected void forceDelayedNotificationsSending(List<Integer> userIds,
                                                Set<NotifChannel> channels)
                                         throws Exception
Forces the sending of all the delayed notifications saved for given users and channels

Parameters:
userIds -
channels -
Throws:
Exception

performDelayedNotificationsSending

protected void performDelayedNotificationsSending(Date date,
                                                  Set<NotifChannel> channels)
                                           throws Exception
Handling the saved delayed notifications from a given date and given channels

Parameters:
date -
channels -
Throws:
Exception

getUserDetail

protected UserDetail getUserDetail(Integer userId)
                            throws Exception
Centralizes the searches of user details with cache feature

Parameters:
userId -
Returns:
Throws:
Exception

sendNotification

protected void sendNotification(NotificationData notificationData)
                         throws NotificationServerException
Centralizes notification sending

Parameters:
notificationData -
Throws:
NotificationServerException


Copyright © 2016 Silverpeas. All Rights Reserved.