Package lumis.portal.sendmail
Interface ISendMailManager
-
- All Known Implementing Classes:
SendMailManager
@StableMinor(version="16.0", sinceVersion="4.0") public interface ISendMailManager
Manager that offers send mail service. It also offers capability of sending e-mails asynchronously, by queueing them.- Since:
- 4.0.4
- Version:
- $Revision: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMailToSendQueue(SessionConfig sessionConfig, IMultipleMail mail, java.lang.String queueId, ITransaction transaction)
Adds an e-mail to the send queue.void
addMailToSendQueue(SessionConfig sessionConfig, ISingleMail mail, java.lang.String queueId, ITransaction transaction)
Adds an e-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.void
deleteMail(SessionConfig sessionConfig, java.lang.String mailId, ITransaction transaction)
Deletes a mail and all its internal components (body, attachments, destinations).void
deleteMailDestination(SessionConfig sessionConfig, java.lang.String mailDestinationId, ITransaction transaction)
Deletes a mail destination.java.lang.String
generateNewQueueId()
Returns a new generated queue id.IMailConfig
getMailConfig(SessionConfig sessionConfig, ITransaction transaction)
Returns the IMailConfig containing the configurations for sending e-mails.void
pollMailQueueProcessing()
Verifies the need to create another mail queue process thread, and create it if necessary.void
sendMail(SessionConfig sessionConfig, ISingleMail mail, ITransaction transaction)
Sends an e-mail immediately.void
setMailConfig(SessionConfig sessionConfig, IMailConfig mailConfig, ITransaction transaction)
Sets the IMailConfig containing the configurations for sending e-mails.
-
-
-
Method Detail
-
createSingleMail
ISingleMail createSingleMail() throws PortalException
Factory method for creating a new blank mail instance. Use this method to obtain an instance ofISingleMail
, to fill it with the required data and use it in the other methods in this manager.- Returns:
- a new blank mail instance.
- Throws:
PortalException
- Since:
- 4.0.4
- See Also:
createMultipleMail()
,createMailAttachment()
-
createMultipleMail
IMultipleMail createMultipleMail() throws PortalException
Factory method for creating a new blank mail instance. Use this method to obtain an instance ofIMultipleMail
, to fill it with the required data and use it in the other methods in this manager.- Returns:
- a new blank mail instance.
- Throws:
PortalException
- Since:
- 4.0.4
- See Also:
createSingleMail()
,createMailAttachment()
,createMailDestination()
-
createMailDestination
IMailDestination createMailDestination() throws PortalException
Factory method for creating a new mail destination instance. Use this method to obtain an instance ofIMailDestination
, to fill it with the required data and use it in the other methods in this manager.- Returns:
- a new mail destination instance.
- Throws:
PortalException
- Since:
- 4.0.4
- See Also:
createMultipleMail()
,IMultipleMail.getDestinations()
-
createMailAttachment
IMailAttachment createMailAttachment() throws PortalException
Factory method for creating a new mail attachment instance. Use this method to obtain an instance ofIMailAttachment
, to fill it with the required data and use it in the other methods in this manager.- Returns:
- a new mail attachment instance.
- Throws:
PortalException
- Since:
- 4.0.4
- See Also:
createSingleMail()
,createMultipleMail()
,IMailBody.getAttachments()
-
getMailConfig
IMailConfig getMailConfig(SessionConfig sessionConfig, ITransaction transaction) throws PortalException
Returns the IMailConfig containing the configurations for sending e-mails.- Parameters:
sessionConfig
- the user session information.transaction
- the transaction for persistence access.- Returns:
- the IMailConfig, never null.
- Throws:
PortalException
- if it was not possible to obtain the IMailConfig.- Since:
- 4.0.4
-
setMailConfig
void setMailConfig(SessionConfig sessionConfig, IMailConfig mailConfig, ITransaction transaction) throws PortalException
Sets the IMailConfig containing the configurations for sending e-mails.- Parameters:
sessionConfig
- the user session information.mailConfig
- the IMailConfig.transaction
- the transaction for persistence access.- Throws:
PortalException
- if it was not possible to set the IMailConfig.- Since:
- 4.0.4
- See Also:
#getMailConfig(ITransaction)
-
sendMail
void sendMail(SessionConfig sessionConfig, ISingleMail mail, ITransaction transaction) throws PortalException
Sends an e-mail immediately. This method does not garantee rollback of the e-mail sending as a result of the transaction rollback.- Parameters:
sessionConfig
- the user session information.mail
- information about the e-mail to be sent.transaction
- the transaction for persistence access.- Throws:
PortalException
- if it was not possible to send the e-mail.- Since:
- 4.0.4
- See Also:
createSingleMail()
-
addMailToSendQueue
void addMailToSendQueue(SessionConfig sessionConfig, ISingleMail mail, java.lang.String queueId, ITransaction transaction) throws PortalException
Adds an e-mail to the send queue. The queue is processed in the background and the e-mail will be sent when it is processed.- Parameters:
sessionConfig
- the user session information.mail
- information about the e-mail to be sent.queueId
- the id of the queue where the mail will be added to. If null a new queue will be generated. To generate a new queueId usegenerateNewQueueId()
.transaction
- the transaction for persistence access. If the transaction rollbacks the e-mail will not be added to the queue and not sent.- Throws:
PortalException
- if it was not possible to queue the the e-mail.- Since:
- 4.0.4
- See Also:
createSingleMail()
-
addMailToSendQueue
void addMailToSendQueue(SessionConfig sessionConfig, IMultipleMail mail, java.lang.String queueId, ITransaction transaction) throws PortalException
Adds an e-mail to the send queue. The queue is processed in the background and the e-mail will be sent when it is processed.- Parameters:
sessionConfig
- the user session information.mail
- information about the e-mail to be sent.queueId
- the id of the queue where the mail will be added to. If null a new queue will be generated. To generate a new queueId usegenerateNewQueueId()
.transaction
- the transaction for persistence access. If the transaction rollbacks the e-mail will not be added to the queue and not sent.- Throws:
PortalException
- if it was not possible to queue the e-mail.- Since:
- 4.0.4
- See Also:
createMultipleMail()
-
pollMailQueueProcessing
void pollMailQueueProcessing() throws PortalException
Verifies the need to create another mail queue process thread, and create it if necessary. This method is called at regular intervals by the portal framework to give the manager the opportunity to span processing threads.- Throws:
PortalException
- if it was not possible to complete the operation.- Since:
- 4.0.4
-
generateNewQueueId
java.lang.String generateNewQueueId() throws PortalException
Returns a new generated queue id.- Returns:
- a new generated queue id.
- Throws:
PortalException
- if the queue id could not be generated.- Since:
- 4.0.4
-
deleteMail
void deleteMail(SessionConfig sessionConfig, java.lang.String mailId, ITransaction transaction) throws PortalException
Deletes a mail and all its internal components (body, attachments, destinations).- Parameters:
sessionConfig
- the user session information.mailId
- the mail's id.transaction
- the transaction for persistence access.- Throws:
PortalException
- if it was not possible to delete the mail.- Since:
- 4.0.4
-
deleteMailDestination
void deleteMailDestination(SessionConfig sessionConfig, java.lang.String mailDestinationId, ITransaction transaction) throws PortalException
Deletes a mail destination.- Parameters:
sessionConfig
- the user session information.mailDestinationId
- the mail destination's id.transaction
- the transaction for persistence access.- Throws:
PortalException
- if it was not possible to delete the mail destination.- Since:
- 8.1.0
-
-