com.uwyn.rife.mail.dam
Class DatabaseMailQueue

java.lang.Object
  extended by com.uwyn.rife.database.DbQueryManager
      extended by com.uwyn.rife.mail.dam.DatabaseMailQueue
All Implemented Interfaces:
MailQueueManager, Cloneable

public class DatabaseMailQueue
extends DbQueryManager
implements MailQueueManager


Field Summary
protected  GenericQueryManager<Email> mManager
           
 
Constructor Summary
protected DatabaseMailQueue(Datasource datasource)
           
 
Method Summary
 boolean install()
           
 boolean queue(Email email)
          Adds the provided email to the queue.
 boolean queue(MimeMessage email)
          Adds a fully setup JavaMail email to the queue.
 boolean remove()
           
 
Methods inherited from class com.uwyn.rife.database.DbQueryManager
clone, executeFetchAll, executeFetchAll, executeFetchAllBeans, executeFetchAllBeans, executeFetchFirst, executeFetchFirst, executeFetchFirstBean, executeFetchFirstBean, executeGetFirstBoolean, executeGetFirstBoolean, executeGetFirstByte, executeGetFirstByte, executeGetFirstBytes, executeGetFirstBytes, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDate, executeGetFirstDouble, executeGetFirstDouble, executeGetFirstFloat, executeGetFirstFloat, executeGetFirstInt, executeGetFirstInt, executeGetFirstLong, executeGetFirstLong, executeGetFirstShort, executeGetFirstShort, executeGetFirstString, executeGetFirstString, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTime, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeGetFirstTimestamp, executeHasResultRows, executeHasResultRows, executeQuery, executeQuery, executeQuery, executeUpdate, executeUpdate, executeUpdate, executeUseFirstAsciiStream, executeUseFirstAsciiStream, executeUseFirstBinaryStream, executeUseFirstBinaryStream, executeUseFirstCharacterStream, executeUseFirstCharacterStream, fetch, fetch, fetchAll, getConnection, getDatasource, inTransaction, reserveConnection
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mManager

protected GenericQueryManager<Email> mManager
Constructor Detail

DatabaseMailQueue

protected DatabaseMailQueue(Datasource datasource)
Method Detail

install

public boolean install()
                throws MailQueueManagerException
Throws:
MailQueueManagerException

remove

public boolean remove()
               throws MailQueueManagerException
Throws:
MailQueueManagerException

queue

public boolean queue(Email email)
              throws MailQueueManagerException
Description copied from interface: MailQueueManager
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.

Specified by:
queue in interface MailQueueManager
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
See Also:
MailQueueManager.queue(MimeMessage)

queue

public boolean queue(MimeMessage email)
              throws MailQueueManagerException
Description copied from interface: MailQueueManager
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 ...

Specified by:
queue in interface MailQueueManager
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
See Also:
MailQueueManager.queue(Email)


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