Interface IMailService

  • All Known Implementing Classes:
    MailService

    public interface IMailService
    The IMailService interface defines the functionality provided by a Mail Service implementation.
    Author:
    Marcus Portmann
    • Method Detail

      • createMailTemplate

        MailTemplate createMailTemplate​(MailTemplate mailTemplate)
                                 throws africa.absa.inception.core.service.InvalidArgumentException,
                                        DuplicateMailTemplateException,
                                        africa.absa.inception.core.service.ServiceUnavailableException
        Create the new mail template.
        Parameters:
        mailTemplate - the MailTemplate instance containing the information for the new mail template
        Returns:
        the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        DuplicateMailTemplateException - if the mail template already exists
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template could not be created
      • deleteMailTemplate

        void deleteMailTemplate​(String mailTemplateId)
                         throws africa.absa.inception.core.service.InvalidArgumentException,
                                MailTemplateNotFoundException,
                                africa.absa.inception.core.service.ServiceUnavailableException
        Delete the existing mail template.
        Parameters:
        mailTemplateId - the ID for the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template could not be deleted
      • getMailTemplate

        MailTemplate getMailTemplate​(String mailTemplateId)
                              throws africa.absa.inception.core.service.InvalidArgumentException,
                                     MailTemplateNotFoundException,
                                     africa.absa.inception.core.service.ServiceUnavailableException
        Retrieve the mail template.
        Parameters:
        mailTemplateId - the ID for the mail template
        Returns:
        the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template could not be retrieved
      • getMailTemplateName

        String getMailTemplateName​(String mailTemplateId)
                            throws africa.absa.inception.core.service.InvalidArgumentException,
                                   MailTemplateNotFoundException,
                                   africa.absa.inception.core.service.ServiceUnavailableException
        Retrieve the name of the mail template.
        Parameters:
        mailTemplateId - the ID for the mail template
        Returns:
        the name of the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the name of the mail template could not be retrieved
      • getMailTemplateSummaries

        List<MailTemplateSummary> getMailTemplateSummaries()
                                                    throws africa.absa.inception.core.service.ServiceUnavailableException
        Returns the summaries for all the mail templates.
        Returns:
        the summaries for all the mail templates
        Throws:
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template summaries could not be retrieved
      • getMailTemplateSummary

        MailTemplateSummary getMailTemplateSummary​(String mailTemplateId)
                                            throws africa.absa.inception.core.service.InvalidArgumentException,
                                                   MailTemplateNotFoundException,
                                                   africa.absa.inception.core.service.ServiceUnavailableException
        Retrieve the summary for the mail template.
        Parameters:
        mailTemplateId - the ID for the mail template
        Returns:
        the summary for the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template summary could not be retrieved
      • getMailTemplateUpdated

        LocalDateTime getMailTemplateUpdated​(String mailTemplateId)
                                      throws africa.absa.inception.core.service.InvalidArgumentException,
                                             MailTemplateNotFoundException,
                                             africa.absa.inception.core.service.ServiceUnavailableException
        Returns the date and time the mail template was last updated.
        Parameters:
        mailTemplateId - the ID for the mail template
        Returns:
        the date and time the mail template was last updated
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the date and time the mail template was last updated could not be retrieved
      • getMailTemplates

        List<MailTemplate> getMailTemplates()
                                     throws africa.absa.inception.core.service.ServiceUnavailableException
        Returns all the mail templates.
        Returns:
        the mail templates
        Throws:
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail templates could not be retrieved
      • mailTemplateExists

        boolean mailTemplateExists​(String mailTemplateId)
                            throws africa.absa.inception.core.service.InvalidArgumentException,
                                   africa.absa.inception.core.service.ServiceUnavailableException
        Check whether the mail template exists.
        Parameters:
        mailTemplateId - the ID for the mail template
        Returns:
        true if the mail template exists or false otherwise
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        africa.absa.inception.core.service.ServiceUnavailableException - if the check for the existing mail template failed
      • processMailTemplate

        String processMailTemplate​(String mailTemplateId,
                                   Map<String,​String> templateParameters)
                            throws africa.absa.inception.core.service.InvalidArgumentException,
                                   africa.absa.inception.core.service.ServiceUnavailableException
        Process the mail template.
        Parameters:
        mailTemplateId - the ID for the mail template
        templateParameters - the template parameters
        Returns:
        the output of processing the template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template processing failed
      • sendMail

        void sendMail​(List<String> to,
                      String subject,
                      String from,
                      String fromName,
                      String mailTemplateId,
                      Map<String,​String> mailTemplateParameters)
               throws africa.absa.inception.core.service.InvalidArgumentException,
                      MailTemplateNotFoundException,
                      africa.absa.inception.core.service.ServiceUnavailableException
        Send a mail.
        Parameters:
        to - the list of e-mail addresses to send the mail to
        subject - the subject for the mail
        from - the from e-mail address
        fromName - the from e-mail name
        mailTemplateId - the ID for the mail template
        mailTemplateParameters - the parameters to apply to the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail could not be sent
      • updateMailTemplate

        MailTemplate updateMailTemplate​(MailTemplate mailTemplate)
                                 throws africa.absa.inception.core.service.InvalidArgumentException,
                                        MailTemplateNotFoundException,
                                        africa.absa.inception.core.service.ServiceUnavailableException
        Update the mail template.
        Parameters:
        mailTemplate - the MailTemplate instance containing the updated information for the mail template
        Returns:
        the mail template
        Throws:
        africa.absa.inception.core.service.InvalidArgumentException - if an argument is invalid
        MailTemplateNotFoundException - if the mail template could not be found
        africa.absa.inception.core.service.ServiceUnavailableException - if the mail template could not be updated