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

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


size

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

errorSize

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

addItem

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

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

addErrorItem

void addErrorItem(MailQueueItem item)
Add an error item

Parameters:
item -

getQueue

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

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

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

getSendingStarted

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

emptyErrorQueue

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


resendErrorQueue

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


getItemBeingSent

MailQueueItem getItemBeingSent()
Retrieve the item currently being sent.


unstickQueue

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 Software Systems Pty Ltd. All Rights Reserved.