com.atlassian.mail.queue
Class MailQueueImpl

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

public class MailQueueImpl
extends Object
implements MailQueue

This is a volatile queue of the outgoing emails from JIRA.

Note - this class may lose emails if the server shuts down.


Constructor Summary
MailQueueImpl()
           
 
Method Summary
 void addErrorItem(MailQueueItem item)
          Add an error item
 void addItem(MailQueueItem item)
          Add a new item to the mail queue.
 void emptyErrorQueue()
          Empty the error queue (discard these messages)
 int errorSize()
           
 org.apache.commons.collections.Buffer getErrorQueue()
          Get access to the messages in the error queue.
 MailQueueItem getItemBeingSent()
          Retrieve the item currently being sent.
 org.apache.commons.collections.Buffer getQueue()
          Get access to the messages in the mail queue.
 Timestamp getSendingStarted()
           
 boolean isSending()
           
 void resendErrorQueue()
          Send all messages in the error queue.
 void sendBuffer()
          Send all the messages in the queue.
 void sendingStarted()
           
 void sendingStopped()
           
 int size()
           
 void unstickQueue()
          If the queue is sending and has 'stuck' on an item, this lets the queue proceed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailQueueImpl

public MailQueueImpl()
Method Detail

sendBuffer

public void sendBuffer()
Description copied from interface: MailQueue
Send all the messages in the queue.

Specified by:
sendBuffer in interface MailQueue

size

public int size()
Specified by:
size in interface MailQueue
Returns:
The number of messages in the queue.

errorSize

public int errorSize()
Specified by:
errorSize in interface MailQueue
Returns:
The number of erroring messages in the queue.

addItem

public void addItem(MailQueueItem item)
Description copied from interface: MailQueue
Add a new item to the mail queue.

Specified by:
addItem in interface MailQueue
Parameters:
item - The item to be added to the queue.

addErrorItem

public void addErrorItem(MailQueueItem item)
Description copied from interface: MailQueue
Add an error item

Specified by:
addErrorItem in interface MailQueue

getQueue

public org.apache.commons.collections.Buffer getQueue()
Description copied from interface: MailQueue
Get access to the messages in the mail queue.

Note: you should synchronize on access to this queue.

Specified by:
getQueue in interface MailQueue

getErrorQueue

public org.apache.commons.collections.Buffer getErrorQueue()
Description copied from interface: MailQueue
Get access to the messages in the error queue.

Note: you should synchronize on access to this queue.

Specified by:
getErrorQueue in interface MailQueue

isSending

public boolean isSending()
Specified by:
isSending in interface MailQueue
Returns:
Whether or not the queue is currently sending.

getSendingStarted

public Timestamp getSendingStarted()
Specified by:
getSendingStarted in interface MailQueue
Returns:
The date/time the queue started sending, null if the queue is not sending

getItemBeingSent

public MailQueueItem getItemBeingSent()
Description copied from interface: MailQueue
Retrieve the item currently being sent.

Specified by:
getItemBeingSent in interface MailQueue

unstickQueue

public void unstickQueue()
Description copied from interface: MailQueue
If the queue is sending and has 'stuck' on an item, this lets the queue proceed. Only relevant for synchronous queues.

Specified by:
unstickQueue in interface MailQueue

emptyErrorQueue

public void emptyErrorQueue()
Description copied from interface: MailQueue
Empty the error queue (discard these messages)

Specified by:
emptyErrorQueue in interface MailQueue

resendErrorQueue

public void resendErrorQueue()
Description copied from interface: MailQueue
Send all messages in the error queue.

Specified by:
resendErrorQueue in interface MailQueue

sendingStarted

public void sendingStarted()

sendingStopped

public void sendingStopped()


Atlassian Mail is developed by Atlassian Software Systems.