com.atlassian.jira.mail
Class JiraMailQueue

java.lang.Object
  extended by com.atlassian.jira.mail.JiraMailQueue
All Implemented Interfaces:
com.atlassian.mail.queue.MailQueue

public class JiraMailQueue
extends Object
implements com.atlassian.mail.queue.MailQueue

A MailQueue that ensures the baseURL for all e-mails is correct. When sending e-mails the baseURL should always use JIRA's configured URL.

Since:
v6.3.1

Constructor Summary
JiraMailQueue(BaseUrl baseUrl)
           
 
Method Summary
 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()
           
 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.
 int size()
           
 void unstickQueue()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiraMailQueue

public JiraMailQueue(BaseUrl baseUrl)
Method Detail

sendBuffer

public void sendBuffer()
When sending e-mails the 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.

Specified by:
sendBuffer in interface com.atlassian.mail.queue.MailQueue

size

public int size()
Specified by:
size in interface com.atlassian.mail.queue.MailQueue

errorSize

public int errorSize()
Specified by:
errorSize in interface com.atlassian.mail.queue.MailQueue

addItem

public void addItem(com.atlassian.mail.queue.MailQueueItem item)
Specified by:
addItem in interface com.atlassian.mail.queue.MailQueue

addErrorItem

public void addErrorItem(com.atlassian.mail.queue.MailQueueItem item)
Specified by:
addErrorItem in interface com.atlassian.mail.queue.MailQueue

getQueue

public Queue<com.atlassian.mail.queue.MailQueueItem> getQueue()
Specified by:
getQueue in interface com.atlassian.mail.queue.MailQueue

getErrorQueue

public Queue<com.atlassian.mail.queue.MailQueueItem> getErrorQueue()
Specified by:
getErrorQueue in interface com.atlassian.mail.queue.MailQueue

isSending

public boolean isSending()
Specified by:
isSending in interface com.atlassian.mail.queue.MailQueue

getSendingStarted

public Timestamp getSendingStarted()
Specified by:
getSendingStarted in interface com.atlassian.mail.queue.MailQueue

emptyErrorQueue

public void emptyErrorQueue()
Specified by:
emptyErrorQueue in interface com.atlassian.mail.queue.MailQueue

resendErrorQueue

public void resendErrorQueue()
Specified by:
resendErrorQueue in interface com.atlassian.mail.queue.MailQueue

getItemBeingSent

public com.atlassian.mail.queue.MailQueueItem getItemBeingSent()
Specified by:
getItemBeingSent in interface com.atlassian.mail.queue.MailQueue

unstickQueue

public void unstickQueue()
Specified by:
unstickQueue in interface com.atlassian.mail.queue.MailQueue


Copyright © 2002-2014 Atlassian. All Rights Reserved.