com.atlassian.confluence.mail.template
Class AbstractMailNotificationQueueItem
java.lang.Object
com.atlassian.confluence.mail.template.AbstractMailNotificationQueueItem
- All Implemented Interfaces:
- com.atlassian.core.task.Task, com.atlassian.mail.queue.MailQueueItem, java.io.Serializable, java.lang.Comparable<com.atlassian.mail.queue.MailQueueItem>
- 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
AbstractMailNotificationQueueItem
public AbstractMailNotificationQueueItem(java.lang.String templateContent)
AbstractMailNotificationQueueItem
public AbstractMailNotificationQueueItem(java.lang.String templateLocation,
java.lang.String templateFileName)
compareTo
public int compareTo(com.atlassian.mail.queue.MailQueueItem that)
- Specified by:
compareTo
in interface java.lang.Comparable<com.atlassian.mail.queue.MailQueueItem>
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)
transformForEmail
protected java.lang.String transformForEmail(java.lang.String input)
renderTemplate
protected java.lang.String renderTemplate(java.lang.String templateLocation,
java.lang.String templateName,
java.util.Map<java.lang.String,java.lang.Object> contextMap)
Copyright © 2003-2013 Atlassian. All Rights Reserved.