Class NotificationContext

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

public class NotificationContext extends Object
Notification context. Provides the contextual information about a notification.
Since:
4.0
Author:
Roy Wetherall
  • Constructor Details

    • NotificationContext

      public NotificationContext()
      Default constructor
  • Method Details

    • setFrom

      public void setFrom(String from)
      Parameters:
      from - from authority
    • getFrom

      public String getFrom()
      Returns:
      String from authority
    • addTo

      public void addTo(String to)
      Parameters:
      to - to authorities
    • getTo

      public List<String> getTo()
      Returns:
      List<String> to authorities
    • setSubject

      public void setSubject(String subject)
      Parameters:
      subject - subject of notification
    • getSubject

      public String getSubject()
      Returns:
      subject of notification
    • setBody

      public void setBody(String body)
      Note: this takes presendence over the body template if both are set
      Parameters:
      body - body of notification.
    • getBody

      public String getBody()
      Returns:
      String body of notification
    • setBodyTemplate

      public void setBodyTemplate(String bodyTemplate)
      The body template is a node re or classpath ref 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 String getBodyTemplate()
      Returns:
      NodeRef body template
    • setTemplateArgs

      public void setTemplateArgs(Map<String,Serializable> 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 Map<String,Serializable> getTemplateArgs()
      Returns:
      Map<String, Serializable> template arguments
    • setDocument

      public void setDocument(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 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