org.alfresco.service.cmr.notification
Class NotificationContext

java.lang.Object
  extended by org.alfresco.service.cmr.notification.NotificationContext

public class NotificationContext
extends java.lang.Object

Notification context. Provides the contextual information about a notification.

Since:
4.0

Constructor Summary
NotificationContext()
          Default constructor
 
Method Summary
 void addTo(java.lang.String to)
           
 java.lang.String getBody()
           
 org.alfresco.service.cmr.repository.NodeRef getBodyTemplate()
           
 org.alfresco.service.cmr.repository.NodeRef getDocument()
           
 java.lang.String getFrom()
           
 java.lang.String getSubject()
           
 java.util.Map getTemplateArgs()
           
 java.util.List getTo()
           
 boolean isAsyncNotification()
           
 boolean isIgnoreNotificationFailure()
           
 void setAsyncNotification(boolean asyncNotification)
          Indicates whether the notification will be sent asynchronously or not.
 void setBody(java.lang.String body)
          Note: this takes presendence over the body template if both are set
 void setBodyTemplate(org.alfresco.service.cmr.repository.NodeRef bodyTemplate)
          The body template is a node reference to a template that can be executed with the given template arguments to produce the body of the notification.
 void setDocument(org.alfresco.service.cmr.repository.NodeRef document)
          Document that the notification relates to.
 void setFrom(java.lang.String from)
           
 void setIgnoreNotificationFailure(boolean ignoreNotificationFailure)
          Indicates whether to ignore a notification failure or not.
 void setSubject(java.lang.String subject)
           
 void setTemplateArgs(java.util.Map templateArgs)
          The template arguments are used as context for the body template when it is executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationContext

public NotificationContext()
Default constructor

Method Detail

setFrom

public void setFrom(java.lang.String from)
Parameters:
from - from authority

getFrom

public java.lang.String getFrom()
Returns:
String from authority

addTo

public void addTo(java.lang.String to)
Parameters:
to - to authorities

getTo

public java.util.List getTo()
Returns:
List<String> to authorities

setSubject

public void setSubject(java.lang.String subject)
Parameters:
subject - subject of notification

getSubject

public java.lang.String getSubject()
Returns:
subject of notification

setBody

public void setBody(java.lang.String body)
Note: this takes presendence over the body template if both are set

Parameters:
body - body of notification.

getBody

public java.lang.String getBody()
Returns:
String body of notification

setBodyTemplate

public void setBodyTemplate(org.alfresco.service.cmr.repository.NodeRef bodyTemplate)
The body template is a node reference to a template that can be executed with the given template arguments to produce the body of the notification.

Parameters:
bodyTemplate - body template

getBodyTemplate

public org.alfresco.service.cmr.repository.NodeRef getBodyTemplate()
Returns:
NodeRef body template

setTemplateArgs

public void setTemplateArgs(java.util.Map templateArgs)
The template arguments are used as context for the body template when it is executed. Any values placed in this map will be available in the template from the root object 'args'. For example '${args.workflowDescription}'.

Parameters:
templateArgs - template arguments

getTemplateArgs

public java.util.Map getTemplateArgs()
Returns:
Map<String, Serializable> template arguments

setDocument

public void setDocument(org.alfresco.service.cmr.repository.NodeRef document)
Document that the notification relates to. This does not have to be set. Will be used to populate the 'document' root object accessable within the body template if set.

Parameters:
document - related document

getDocument

public org.alfresco.service.cmr.repository.NodeRef getDocument()
Returns:
NodeRef related document

setIgnoreNotificationFailure

public void setIgnoreNotificationFailure(boolean ignoreNotificationFailure)
Indicates whether to ignore a notification failure or not.

Parameters:
ignoreNotificationFailure - true if ignore notification failure, false otherwise

isIgnoreNotificationFailure

public boolean isIgnoreNotificationFailure()
Returns:
boolean true if ignore notification failure, false otherwise

setAsyncNotification

public void setAsyncNotification(boolean asyncNotification)
Indicates whether the notification will be sent asynchronously or not.

Parameters:
asyncNotification - true if notification sent asynchronously, false otherwise

isAsyncNotification

public boolean isAsyncNotification()
Returns:
boolean true if notification send asynchronously, false otherwise


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.