Class AbstractMailNotificationQueueItem
java.lang.Object
com.atlassian.confluence.mail.template.AbstractMailNotificationQueueItem
- All Implemented Interfaces:
com.atlassian.core.task.Task,com.atlassian.mail.queue.MailQueueItem,Serializable,Comparable<com.atlassian.mail.queue.MailQueueItem>
- Direct Known Subclasses:
MailNotificationQueueItem,NonUserMailNotificationQueueItem
public abstract class AbstractMailNotificationQueueItem
extends 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:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMailNotificationQueueItem(String templateContent) AbstractMailNotificationQueueItem(String templateLocation, String templateFileName) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddUtilsToContext(Map<String, Object> contextParams) voidaddVelocityContextParam(String name, Object value) voidintcompareTo(com.atlassian.mail.queue.MailQueueItem that) protected abstract com.atlassian.mail.Emailvoidexecute()getBody()getRenderedContent(String content) intbooleanhasError()protected voidprotected static booleanisRecognisedMimeType(String mimePref) voidpreRenderBody(Map<String, 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.protected Stringprotected com.atlassian.mail.server.SMTPMailServervoidsend()voidprotected voidsetLastError(String lastError) voidsetSubject(String subject) voidsetTemplateContent(String templateContent) voidsetTemplateFileName(String templateFileName) voidsetTemplateLocation(String templateLocation) protected StringtransformForEmail(String input)
-
Field Details
-
dateQueued
-
MIME_TYPE_HTML
- See Also:
-
MIME_TYPE_TEXT
- See Also:
-
body
-
-
Constructor Details
-
AbstractMailNotificationQueueItem
-
AbstractMailNotificationQueueItem
-
-
Method Details
-
compareTo
public int compareTo(com.atlassian.mail.queue.MailQueueItem that) - Specified by:
compareToin interfaceComparable<com.atlassian.mail.queue.MailQueueItem>
-
getLastError
-
setLastError
-
getSubject
- Specified by:
getSubjectin interfacecom.atlassian.mail.queue.MailQueueItem
-
getDateQueued
- Specified by:
getDateQueuedin interfacecom.atlassian.mail.queue.MailQueueItem
-
getSendCount
public int getSendCount()- Specified by:
getSendCountin interfacecom.atlassian.mail.queue.MailQueueItem
-
setSubject
-
hasError
public boolean hasError()- Specified by:
hasErrorin interfacecom.atlassian.mail.queue.MailQueueItem
-
execute
- Specified by:
executein interfacecom.atlassian.core.task.Task- Throws:
Exception
-
send
public void send() throws com.atlassian.mail.MailException- Specified by:
sendin interfacecom.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
-
addVelocityContextParam
-
removeVelocityContextParam
-
clearContext
public void clearContext() -
getVelocityContextParam
-
preRenderBody
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
-
getRenderedContent
-
addUtilsToContext
-
getTemplateFileName
-
setTemplateFileName
-
getTemplateContent
-
setTemplateContent
-
getTemplateLocation
-
setTemplateLocation
-
getBody
-
setBody
-
transformForEmail
-
renderTemplate
-