public class JiraMailQueue extends Object implements com.atlassian.mail.queue.MailQueue
MailQueue
that ensures the baseURL
for all e-mails is correct. When
sending e-mails the baseURL
should always use JIRA's configured URL.Constructor and Description |
---|
JiraMailQueue(BaseUrl baseUrl) |
Modifier and Type | Method and Description |
---|---|
void |
addErrorItem(com.atlassian.mail.queue.MailQueueItem item) |
void |
addItem(com.atlassian.mail.queue.MailQueueItem item) |
void |
emptyErrorQueue() |
int |
errorSize() |
Queue<com.atlassian.mail.queue.MailQueueItem> |
getErrorQueue() |
com.atlassian.mail.queue.MailQueueItem |
getItemBeingSent() |
Timestamp |
getLastSendingAttempt() |
Queue<com.atlassian.mail.queue.MailQueueItem> |
getQueue() |
Timestamp |
getSendingStarted() |
boolean |
isSending() |
void |
resendErrorQueue() |
void |
sendBuffer()
When sending e-mails the
baseURL should always use JIRA's configured URL. |
void |
sendBufferBlocking() |
int |
size() |
void |
unstickQueue() |
public JiraMailQueue(BaseUrl baseUrl)
public void sendBuffer()
baseURL
should always use JIRA's configured URL.
JIRA normally uses the incoming HTTP request to generate the baseURL
. JIRA's configured baseURL
is used
when no request exists (e.g. executing on a scheduled thread). This means that e-mails are normally rendered
using the configured static baseURL
as they are sent in a scheduled task. This is the correct public URL
for e-mails.
It is also possible send e-mails on a thread with a request (e.g. MailQueueAdmin.jspa "Send Now", or REST send now).
In this case we want the baseURL
to come from the configured baseURL
and not from the HTTP request
to keep things consistent with the scheduled e-mail runner.
sendBuffer
in interface com.atlassian.mail.queue.MailQueue
public void sendBufferBlocking()
sendBufferBlocking
in interface com.atlassian.mail.queue.MailQueue
public int size()
size
in interface com.atlassian.mail.queue.MailQueue
public int errorSize()
errorSize
in interface com.atlassian.mail.queue.MailQueue
public void addItem(com.atlassian.mail.queue.MailQueueItem item)
addItem
in interface com.atlassian.mail.queue.MailQueue
public void addErrorItem(com.atlassian.mail.queue.MailQueueItem item)
addErrorItem
in interface com.atlassian.mail.queue.MailQueue
public Queue<com.atlassian.mail.queue.MailQueueItem> getQueue()
getQueue
in interface com.atlassian.mail.queue.MailQueue
public Queue<com.atlassian.mail.queue.MailQueueItem> getErrorQueue()
getErrorQueue
in interface com.atlassian.mail.queue.MailQueue
public boolean isSending()
isSending
in interface com.atlassian.mail.queue.MailQueue
public Timestamp getSendingStarted()
getSendingStarted
in interface com.atlassian.mail.queue.MailQueue
public Timestamp getLastSendingAttempt()
getLastSendingAttempt
in interface com.atlassian.mail.queue.MailQueue
public void emptyErrorQueue()
emptyErrorQueue
in interface com.atlassian.mail.queue.MailQueue
public void resendErrorQueue()
resendErrorQueue
in interface com.atlassian.mail.queue.MailQueue
public com.atlassian.mail.queue.MailQueueItem getItemBeingSent()
getItemBeingSent
in interface com.atlassian.mail.queue.MailQueue
public void unstickQueue()
unstickQueue
in interface com.atlassian.mail.queue.MailQueue
Copyright © 2002-2021 Atlassian. All Rights Reserved.