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 void
addUtilsToContext
(Map<String, Object> contextParams) void
addVelocityContextParam
(String name, Object value) void
int
compareTo
(com.atlassian.mail.queue.MailQueueItem that) protected abstract com.atlassian.mail.Email
void
execute()
getBody()
getRenderedContent
(String content) int
boolean
hasError()
protected void
protected static boolean
isRecognisedMimeType
(String mimePref) void
preRenderBody
(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 String
protected com.atlassian.mail.server.SMTPMailServer
void
send()
void
protected void
setLastError
(String lastError) void
setSubject
(String subject) void
setTemplateContent
(String templateContent) void
setTemplateFileName
(String templateFileName) void
setTemplateLocation
(String templateLocation) protected String
transformForEmail
(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:
compareTo
in interfaceComparable<com.atlassian.mail.queue.MailQueueItem>
-
getLastError
-
setLastError
-
getSubject
- Specified by:
getSubject
in interfacecom.atlassian.mail.queue.MailQueueItem
-
getDateQueued
- Specified by:
getDateQueued
in interfacecom.atlassian.mail.queue.MailQueueItem
-
getSendCount
public int getSendCount()- Specified by:
getSendCount
in interfacecom.atlassian.mail.queue.MailQueueItem
-
setSubject
-
hasError
public boolean hasError()- Specified by:
hasError
in interfacecom.atlassian.mail.queue.MailQueueItem
-
execute
- Specified by:
execute
in interfacecom.atlassian.core.task.Task
- Throws:
Exception
-
send
public void send() throws com.atlassian.mail.MailException- Specified by:
send
in 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
-