|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISendMailDao
The DAO for sendmail persistence information.
Method Summary | |
---|---|
void |
addMailToSendQueue(IMultipleMail mail,
String queueId,
ITransaction transaction)
Adds an mail to the send queue. |
void |
addMailToSendQueue(ISingleMail mail,
String queueId,
ITransaction transaction)
Adds an mail to the send queue. |
IMailAttachment |
createMailAttachment()
Factory method for creating a new mail attachment instance. |
IMailDestination |
createMailDestination()
Factory method for creating a new mail destination instance. |
IMultipleMail |
createMultipleMail()
Factory method for creating a new blank mail instance. |
ISingleMail |
createSingleMail()
Factory method for creating a new blank mail instance. |
ISingleMail |
createSingleMail(IMultipleMail mail,
IMailDestination destination)
Returns a ISingleMail instance as the given mail addressed to the given destination. |
void |
deleteMail(String mailId,
ITransaction transaction)
Deletes the whole mail structure, including the body, attachments, destinations. |
void |
deleteMailBody(String mailId,
ITransaction transaction)
Deletes the whole mail's body, including the body message and the attachments. |
IMailDestination |
fetchNextPendingDestination(IMultipleMail multipleMail)
Returns for the next destination pending for sending for the given mail, and marks its status as sending. |
IBaseMail |
fetchNextQueuedMail(String queueId)
Returns the next queued mail pending for sending, and marks its status as sending. |
String |
generateNewQueueId()
Returns a new generated queue id. |
IMailConfig |
getMailConfig(ITransaction transaction)
Returns the IMailConfig containing the configurations for sending e-mails. |
String |
lockNextQueue()
Locks the next queue mail available and returns its id. |
void |
setMailConfig(IMailConfig mailConfig,
ITransaction transaction)
Sets the IMailConfig containing the configurations for sending e-mails. |
void |
unfetchMail(String mailId)
Puts a mail back on its place in the queue to be available to another queue processing. |
void |
unlockQueue(String queueId)
Unlocks a mail queue. |
void |
updateMailSendStatus(IMailSendStatus mailSendStatus)
Updates the mail send status as set in the given instance. |
Method Detail |
---|
ISingleMail createSingleMail() throws PortalException
ISingleMail
,
to fill it with the required data and use it in the
other methods in this interface.
PortalException
createMultipleMail()
,
createMailAttachment()
ISingleMail createSingleMail(IMultipleMail mail, IMailDestination destination)
ISingleMail
instance as the given mail addressed to the given destination.
mail
- the mail.destination
- the destination.
ISingleMail
instance.IMultipleMail createMultipleMail() throws PortalException
IMultipleMail
,
to fill it with the required data and use it in the
other methods in this interface.
PortalException
createSingleMail()
,
createMailAttachment()
,
createMailDestination()
IMailDestination createMailDestination()
IMailDestination
,
to fill it with the required data and use it in the
other methods in this interface.
createMultipleMail()
,
IMultipleMail.getDestinations()
IMailAttachment createMailAttachment()
IMailAttachment
,
to fill it with the required data and use it in the
other methods in this interface.
createSingleMail()
,
createMultipleMail()
,
IMailBody.getAttachments()
IMailConfig getMailConfig(ITransaction transaction) throws DaoException
transaction
- the transaction for persistence access.
DaoException
- if it was not possible to obtain the IMailConfig.setMailConfig(IMailConfig, ITransaction)
void setMailConfig(IMailConfig mailConfig, ITransaction transaction) throws DaoException
mailConfig
- the IMailConfig.transaction
- the transaction for persistence access.
DaoException
- if it was not possible to set the IMailConfig.getMailConfig(ITransaction)
void addMailToSendQueue(ISingleMail mail, String queueId, ITransaction transaction) throws DaoException
mail
- the mail. This instance must have been created by createSingleMail()
.queueId
- the id of the queue where the mail will be added to. If null a new
queue will be generated.transaction
- the transaction for persistence access.
DaoException
- if it was not possible to add the mail to the send queue.addMailToSendQueue(IMultipleMail, String, ITransaction)
,
#createMail()
,
createMailAttachment()
void addMailToSendQueue(IMultipleMail mail, String queueId, ITransaction transaction) throws DaoException
mail
- the mail. This instance must have been created by createMultipleMail()
.queueId
- the id of the queue where the mail will be added to. If null a new
queue will be generated.transaction
- the transaction for persistence access.
DaoException
- if it was not possible to add the mail to the send queue.addMailToSendQueue(ISingleMail, String, ITransaction)
,
#createMail()
,
createMailAttachment()
,
createMailDestination()
void updateMailSendStatus(IMailSendStatus mailSendStatus) throws DaoException
mailSendStatus
- the mail send status information.
DaoException
IBaseMail fetchNextQueuedMail(String queueId) throws DaoException
This operation must be atomic and garantee that the same mail will not be returned many times, even if this method is called simultaneously by many threads in many servers in the cluster.
queueId
- the id of the queue from where the mail will be taken.
DaoException
void unfetchMail(String mailId) throws DaoException
IMailSendStatus.STATUS_SEND_PENDING
.
mailId
- the mail id.
DaoException
IMailDestination fetchNextPendingDestination(IMultipleMail multipleMail) throws DaoException
This operation must be atomic and garantee that the same destination will not be returned many times, even if this method is called simultaneously by many threads in many servers in the cluster.
multipleMail
- the mail.
DaoException
String lockNextQueue() throws DaoException
This operation must be atomic and garantee that a locked queue will not be returned, even if this method is called simultaneously by many threads in many servers in the cluster.
DaoException
String generateNewQueueId() throws DaoException
DaoException
- if the queue id could not be generated.void unlockQueue(String queueId) throws DaoException
queueId
- the queue's id.
DaoException
void deleteMail(String mailId, ITransaction transaction) throws DaoException
mailId
- the id of the mail to be deleted.transaction
- the transaction for persistence access.
DaoException
- if it was not possible to delete the mail.void deleteMailBody(String mailId, ITransaction transaction) throws DaoException
mailId
- the id of the mail whose body is to be deleted.transaction
- the transaction for persistence access.
DaoException
- if it was not possible to delete the mail.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |