com.atlassian.mail.queue
Interface MailQueue

All Known Implementing Classes:
MailQueueImpl

public interface MailQueue

The MailQueue is used to asynchronously send mail from within applications.

It is populated with MailQueueItem objects, which know how to send themselves.

The queue also keeps track of which messages have attempted to be send, and were erroring.


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.
 java.sql.Timestamp getSendingStarted()
           
 boolean isSending()
           
 void resendErrorQueue()
          Send all messages in the error queue.
 void sendBuffer()
          Send all the messages in the queue.
 int size()
           
 void unstickQueue()
          If the queue is sending and has 'stuck' on an item, this lets the queue proceed.
 

Method Detail

sendBuffer

public void sendBuffer()
Send all the messages in the queue.


size

public int size()
Returns:
The number of messages in the queue.

errorSize

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

addItem

public void addItem(MailQueueItem item)
Add a new item to the mail queue.

Parameters:
item - The item to be added to the queue.

addErrorItem

public void addErrorItem(MailQueueItem item)
Add an error item

Parameters:
item -

getQueue

public org.apache.commons.collections.Buffer getQueue()
Get access to the messages in the mail queue.

Note: you should synchronize on access to this queue.


getErrorQueue

public org.apache.commons.collections.Buffer getErrorQueue()
Get access to the messages in the error queue.

Note: you should synchronize on access to this queue.


isSending

public boolean isSending()
Returns:
Whether or not the queue is currently sending.

getSendingStarted

public java.sql.Timestamp getSendingStarted()
Returns:
The date/time the queue started sending, null if the queue is not sending

emptyErrorQueue

public void emptyErrorQueue()
Empty the error queue (discard these messages)


resendErrorQueue

public void resendErrorQueue()
Send all messages in the error queue.


getItemBeingSent

public MailQueueItem getItemBeingSent()
Retrieve the item currently being sent.


unstickQueue

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



Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.