lumis.portal.sendmail
Interface ISendMailManager

Package class diagram package ISendMailManager
All Known Implementing Classes:
SendMailManager

@StableMinor(version="6.2",
             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

Method Summary
 void addMailToSendQueue(SessionConfig sessionConfig, IMultipleMail mail, String queueId, ITransaction transaction)
          Adds an e-mail to the send queue.
 void addMailToSendQueue(SessionConfig sessionConfig, ISingleMail mail, 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, String mailId, ITransaction transaction)
          Deletes a mail and all its internal components (body, attachments, destinations).
 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 of ISingleMail, 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 of IMultipleMail, 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 of IMailDestination, 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 of IMailAttachment, 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,
                        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 use generateNewQueueId().
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,
                        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 use generateNewQueueId().
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

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,
                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


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.