com.atlassian.confluence.mail.template
Class AbstractMailNotificationQueueItem

java.lang.Object
  extended by com.atlassian.confluence.mail.template.AbstractMailNotificationQueueItem
All Implemented Interfaces:
com.atlassian.core.task.Task, com.atlassian.mail.queue.MailQueueItem, java.io.Serializable
Direct Known Subclasses:
MailNotificationQueueItem, NonUserMailNotificationQueueItem

public abstract class AbstractMailNotificationQueueItem
extends java.lang.Object
implements com.atlassian.mail.queue.MailQueueItem, com.atlassian.core.task.Task

An abstract mail notification queue item that provides default implementations of most methods.

See Also:
Serialized Form

Field Summary
protected  java.lang.String body
           
protected  java.util.Date dateQueued
           
static java.lang.String MIME_TYPE_HTML
           
static java.lang.String MIME_TYPE_TEXT
           
 
Constructor Summary
AbstractMailNotificationQueueItem(java.lang.String templateContent)
           
AbstractMailNotificationQueueItem(java.lang.String templateLocation, java.lang.String templateFileName)
           
 
Method Summary
 void addVelocityContextParam(java.lang.String name, java.lang.Object value)
           
 void clearContext()
           
protected abstract  com.atlassian.mail.Email createMailObject()
           
 void execute()
           
 java.lang.String getBody()
           
 java.util.Date getDateQueued()
           
 java.lang.String getLastError()
           
 java.lang.String getRenderedContent()
           
 java.lang.String getRenderedContent(java.lang.String content)
           
 int getSendCount()
           
 java.lang.String getSubject()
           
 java.lang.String getTemplateContent()
           
 java.lang.String getTemplateFileName()
           
 java.lang.String getTemplateLocation()
           
 java.lang.Object getVelocityContextParam(java.lang.String name)
           
 boolean hasError()
           
protected  void incrementSendCount()
           
protected static boolean isRecognisedMimeType(java.lang.String mimePref)
           
 void preRenderBody(java.util.Map<java.lang.String,java.lang.Object> contextMap)
          This method will not retain a local copy of the contextMap - making it advantageous for pre-rendering templates with contexts comprising of transient or session-based data.
 java.lang.Object removeVelocityContextParam(java.lang.String name)
           
protected  com.atlassian.mail.server.SMTPMailServer retrieveMailServer()
           
 void send()
           
 void setBody(java.lang.String body)
           
protected  void setLastError(java.lang.String lastError)
           
 void setSubject(java.lang.String subject)
           
 void setTemplateContent(java.lang.String templateContent)
           
 void setTemplateFileName(java.lang.String templateFileName)
           
 void setTemplateLocation(java.lang.String templateLocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateQueued

protected java.util.Date dateQueued

MIME_TYPE_HTML

public static final java.lang.String MIME_TYPE_HTML
See Also:
Constant Field Values

MIME_TYPE_TEXT

public static final java.lang.String MIME_TYPE_TEXT
See Also:
Constant Field Values

body

protected java.lang.String body
Constructor Detail

AbstractMailNotificationQueueItem

public AbstractMailNotificationQueueItem(java.lang.String templateContent)

AbstractMailNotificationQueueItem

public AbstractMailNotificationQueueItem(java.lang.String templateLocation,
                                         java.lang.String templateFileName)
Method Detail

getLastError

public java.lang.String getLastError()

setLastError

protected void setLastError(java.lang.String lastError)

getSubject

public java.lang.String getSubject()
Specified by:
getSubject in interface com.atlassian.mail.queue.MailQueueItem

getDateQueued

public java.util.Date getDateQueued()
Specified by:
getDateQueued in interface com.atlassian.mail.queue.MailQueueItem

getSendCount

public int getSendCount()
Specified by:
getSendCount in interface com.atlassian.mail.queue.MailQueueItem

setSubject

public void setSubject(java.lang.String subject)

hasError

public boolean hasError()
Specified by:
hasError in interface com.atlassian.mail.queue.MailQueueItem

execute

public void execute()
             throws java.lang.Exception
Specified by:
execute in interface com.atlassian.core.task.Task
Throws:
java.lang.Exception

send

public void send()
          throws com.atlassian.mail.MailException
Specified by:
send in interface com.atlassian.mail.queue.MailQueueItem
Throws:
com.atlassian.mail.MailException

createMailObject

protected abstract com.atlassian.mail.Email createMailObject()

retrieveMailServer

protected com.atlassian.mail.server.SMTPMailServer retrieveMailServer()
                                                               throws com.atlassian.mail.MailException
Throws:
com.atlassian.mail.MailException

incrementSendCount

protected void incrementSendCount()

isRecognisedMimeType

protected static boolean isRecognisedMimeType(java.lang.String mimePref)

addVelocityContextParam

public void addVelocityContextParam(java.lang.String name,
                                    java.lang.Object value)

removeVelocityContextParam

public java.lang.Object removeVelocityContextParam(java.lang.String name)

clearContext

public void clearContext()

getVelocityContextParam

public java.lang.Object getVelocityContextParam(java.lang.String name)

preRenderBody

public void preRenderBody(java.util.Map<java.lang.String,java.lang.Object> contextMap)
This method will not retain a local copy of the contextMap - making it advantageous for pre-rendering templates with contexts comprising of transient or session-based data.


getRenderedContent

public java.lang.String getRenderedContent(java.lang.String content)

getRenderedContent

public java.lang.String getRenderedContent()

getTemplateFileName

public java.lang.String getTemplateFileName()

setTemplateFileName

public void setTemplateFileName(java.lang.String templateFileName)

getTemplateContent

public java.lang.String getTemplateContent()

setTemplateContent

public void setTemplateContent(java.lang.String templateContent)

getTemplateLocation

public java.lang.String getTemplateLocation()

setTemplateLocation

public void setTemplateLocation(java.lang.String templateLocation)

getBody

public java.lang.String getBody()

setBody

public void setBody(java.lang.String body)


Copyright © 2003-2009 Atlassian Pty Ltd. All Rights Reserved.