com.atlassian.confluence.mail.template
Class AbstractMailNotificationQueueItem

java.lang.Object
  extended bycom.atlassian.confluence.mail.template.AbstractMailNotificationQueueItem
All Implemented Interfaces:
MailQueueItem, Serializable, Task
Direct Known Subclasses:
MailNotificationQueueItem, NonUserMailNotificationQueueItem

public abstract class AbstractMailNotificationQueueItem
extends Object
implements MailQueueItem, Task

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

See Also:
Serialized Form

Field Summary
protected  String body
           
protected  Date dateQueued
           
static String MIME_TYPE_HTML
           
static String MIME_TYPE_TEXT
           
 
Constructor Summary
AbstractMailNotificationQueueItem(String templateContent)
           
AbstractMailNotificationQueueItem(String templateLocation, String templateFileName)
           
 
Method Summary
 void addVelocityContextParam(String name, Object value)
           
 void clearContext()
           
protected abstract  Email createMailObject()
           
 void execute()
           
 String getBody()
           
 Date getDateQueued()
           
 String getLastError()
           
 String getRenderedContent()
           
 String getRenderedContent(String content)
           
 int getSendCount()
           
 String getSubject()
           
 String getTemplateContent()
           
 String getTemplateFileName()
           
 String getTemplateLocation()
           
 Object getVelocityContextParam(String name)
           
 boolean hasError()
           
protected  void incrementSendCount()
           
protected static boolean isRecognisedMimeType(String mimePref)
           
 void preRenderBody(Map 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.
 Object removeVelocityContextParam(String name)
           
protected  SMTPMailServer retrieveMailServer()
           
 void send()
           
 void setBody(String body)
           
protected  void setLastError(String lastError)
           
 void setSubject(String subject)
           
 void setTemplateContent(String templateContent)
           
 void setTemplateFileName(String templateFileName)
           
 void setTemplateLocation(String templateLocation)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dateQueued

protected Date dateQueued

MIME_TYPE_HTML

public static final String MIME_TYPE_HTML
See Also:
Constant Field Values

MIME_TYPE_TEXT

public static final String MIME_TYPE_TEXT
See Also:
Constant Field Values

body

protected String body
Constructor Detail

AbstractMailNotificationQueueItem

public AbstractMailNotificationQueueItem(String templateContent)

AbstractMailNotificationQueueItem

public AbstractMailNotificationQueueItem(String templateLocation,
                                         String templateFileName)
Method Detail

getLastError

public String getLastError()

setLastError

protected void setLastError(String lastError)

getSubject

public String getSubject()
Specified by:
getSubject in interface MailQueueItem

getDateQueued

public Date getDateQueued()
Specified by:
getDateQueued in interface MailQueueItem

getSendCount

public int getSendCount()
Specified by:
getSendCount in interface MailQueueItem

setSubject

public void setSubject(String subject)

hasError

public boolean hasError()
Specified by:
hasError in interface MailQueueItem

execute

public void execute()
             throws Exception
Specified by:
execute in interface Task
Throws:
Exception

send

public void send()
          throws MailException
Specified by:
send in interface MailQueueItem
Throws:
MailException

createMailObject

protected abstract Email createMailObject()

retrieveMailServer

protected SMTPMailServer retrieveMailServer()
                                     throws MailException
Throws:
MailException

incrementSendCount

protected void incrementSendCount()

isRecognisedMimeType

protected static boolean isRecognisedMimeType(String mimePref)

addVelocityContextParam

public void addVelocityContextParam(String name,
                                    Object value)

removeVelocityContextParam

public Object removeVelocityContextParam(String name)

clearContext

public void clearContext()

getVelocityContextParam

public Object getVelocityContextParam(String name)

preRenderBody

public void preRenderBody(Map 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.

Parameters:
contextMap -

getRenderedContent

public String getRenderedContent(String content)

getRenderedContent

public String getRenderedContent()

getTemplateFileName

public String getTemplateFileName()

setTemplateFileName

public void setTemplateFileName(String templateFileName)

getTemplateContent

public String getTemplateContent()

setTemplateContent

public void setTemplateContent(String templateContent)

getTemplateLocation

public String getTemplateLocation()

setTemplateLocation

public void setTemplateLocation(String templateLocation)

getBody

public String getBody()

setBody

public void setBody(String body)


Confluence is developed by Atlassian.