com.uwyn.rife.mail
Interface MailQueueManager

All Known Implementing Classes:
DatabaseMailQueue

public interface MailQueueManager

This interface defines the methods that classes with MailQueueManager functionalities have to implement.

A MailQueueManager provides methods that allow you to store email messages in a queue. That queue is intended to be processed at regular intervals by a MailQueueExecutor.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)
See Also:
MailQueueExecutor

Method Summary
 boolean queue(Email email)
          Adds the provided email to the queue.
 boolean queue(MimeMessage email)
          Adds a fully setup JavaMail email to the queue.
 

Method Detail

queue

boolean queue(Email email)
              throws MailQueueManagerException
Adds the provided email to the queue. If an identical mail is already present or any other validation for the Email instance fails, the data will not be added to the queue.

Details about the failure can be obtained throught the ValidationErrors of the Email instance.

Parameters:
email - The Email instance that needs to be queued.
Returns:
true if the email was successfully queued; or

false if an email validation failed (for instance a duplicate entry)

Throws:
MailQueueManagerException - If an error occurred while adding the email to the queue
Since:
1.0
See Also:
queue(MimeMessage)

queue

boolean queue(MimeMessage email)
              throws MailQueueManagerException
Adds a fully setup JavaMail email to the queue. The presence of identical mails can not be detected due to the fact that each message already contains a unique message ID. Duplicates with thus be sent as many times as they are added.

This complements the quick way of adding Email instances by providing a way to queue even HTML emails, mails with attachments, etc ...

Parameters:
email - The MimeMessage instance that needs to be queued.
Returns:
true if the email was successfully queued; or

false otherwise

Throws:
MailQueueManagerException - If an error occurred while adding the email to the queue
Since:
1.0
See Also:
queue(Email)


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.