com.silverpeas.notification.builder
Class AbstractResourceUserNotificationBuilder<T>

java.lang.Object
  extended by com.silverpeas.notification.builder.AbstractUserNotificationBuilder
      extended by com.silverpeas.notification.builder.AbstractResourceUserNotificationBuilder<T>
All Implemented Interfaces:
UserNotificationBuilder
Direct Known Subclasses:
AbstractPdcSubscriptionUserNotification, AbstractTemplateUserNotificationBuilder

public abstract class AbstractResourceUserNotificationBuilder<T>
extends AbstractUserNotificationBuilder

Author:
Yohann Chastagnier

Constructor Summary
AbstractResourceUserNotificationBuilder(T resource)
          Default constructor
AbstractResourceUserNotificationBuilder(T resource, String title, String content)
          Default constructor
 
Method Summary
protected  T getResource()
           
protected  String getResourceURL(T resource)
          Gets the URL of the resource
protected  void initialize()
          Performs common initializations from a given resource
protected  NotificationResourceData initializeNotificationResourceData()
          Initializes from notification meta data already filled the container of notification resource data
protected  boolean isSendImmediatly()
          Forces the sending immediatly if true
protected  void performBuild()
          Builds the notification data container
protected abstract  void performBuild(T resource)
          Builds the notification data container
protected  void performNotificationResource(T resource)
          Handling notification resource data (Used by delayed notifications for example)
protected abstract  void performNotificationResource(T resource, NotificationResourceData notificationResourceData)
          Builds the notification resource data container.
protected  void setResource(T resource)
           
 
Methods inherited from class com.silverpeas.notification.builder.AbstractUserNotificationBuilder
build, createNotification, getAction, getBundle, getBundle, getComponentInstanceId, getContent, getExternalAddressesToNotify, getGroupIdsToNotify, getMessageType, getMultilangPropertyFile, getNotificationMetaData, getSender, getTitle, getUserIdsToExcludeFromNotifying, getUserIdsToNotify, performUsersToBeNotified, stop, stopWhenNoUserToNotify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractResourceUserNotificationBuilder

public AbstractResourceUserNotificationBuilder(T resource,
                                               String title,
                                               String content)
Default constructor

Parameters:
resource -
title -
content -

AbstractResourceUserNotificationBuilder

public AbstractResourceUserNotificationBuilder(T resource)
Default constructor

Parameters:
resource -
Method Detail

initialize

protected void initialize()
Performs common initializations from a given resource

Overrides:
initialize in class AbstractUserNotificationBuilder

performBuild

protected final void performBuild()
Builds the notification data container

Specified by:
performBuild in class AbstractUserNotificationBuilder

performBuild

protected abstract void performBuild(T resource)
Builds the notification data container


performNotificationResource

protected void performNotificationResource(T resource)
Handling notification resource data (Used by delayed notifications for example)

Parameters:
resource -

initializeNotificationResourceData

protected NotificationResourceData initializeNotificationResourceData()
Initializes from notification meta data already filled the container of notification resource data

Returns:

performNotificationResource

protected abstract void performNotificationResource(T resource,
                                                    NotificationResourceData notificationResourceData)
Builds the notification resource data container. Don't forget to fill resourceId, resourceType, resourceName, resourceDescription (optional), resourceLocation (optional). If ResourceLocation is empty , it will be filled by the NotificationManager with the given componentInstanceId of NotificationMetaData.

Parameters:
resource -
notificationResourceData -

getResourceURL

protected String getResourceURL(T resource)
Gets the URL of the resource

Returns:

isSendImmediatly

protected boolean isSendImmediatly()
Description copied from class: AbstractUserNotificationBuilder
Forces the sending immediatly if true

Overrides:
isSendImmediatly in class AbstractUserNotificationBuilder
Returns:

getResource

protected final T getResource()

setResource

protected final void setResource(T resource)


Copyright © 2016 Silverpeas. All Rights Reserved.