Package africa.absa.inception.mail
Interface IMailService
-
- All Known Implementing Classes:
MailService
public interface IMailServiceThe IMailService interface defines the functionality provided by a Mail Service implementation.- Author:
- Marcus Portmann
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MailTemplatecreateMailTemplate(MailTemplate mailTemplate)Create the new mail template.voiddeleteMailTemplate(String mailTemplateId)Delete the existing mail template.MailTemplategetMailTemplate(String mailTemplateId)Retrieve the mail template.StringgetMailTemplateName(String mailTemplateId)Retrieve the name of the mail template.List<MailTemplate>getMailTemplates()Returns all the mail templates.List<MailTemplateSummary>getMailTemplateSummaries()Returns the summaries for all the mail templates.MailTemplateSummarygetMailTemplateSummary(String mailTemplateId)Retrieve the summary for the mail template.LocalDateTimegetMailTemplateUpdated(String mailTemplateId)Returns the date and time the mail template was last updated.booleanmailTemplateExists(String mailTemplateId)Check whether the mail template exists.StringprocessMailTemplate(String mailTemplateId, Map<String,String> templateParameters)Process the mail template.voidsendMail(List<String> to, String subject, String from, String fromName, String mailTemplateId, Map<String,String> mailTemplateParameters)Send a mail.MailTemplateupdateMailTemplate(MailTemplate mailTemplate)Update the mail template.
-
-
-
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 invalidDuplicateMailTemplateException- if the mail template already existsafrica.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 invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.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 invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.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 invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.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 invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.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 invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.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 invalidafrica.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 templatetemplateParameters- the template parameters- Returns:
- the output of processing the template
- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidafrica.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 tosubject- the subject for the mailfrom- the from e-mail addressfromName- the from e-mail namemailTemplateId- the ID for the mail templatemailTemplateParameters- the parameters to apply to the mail template- Throws:
africa.absa.inception.core.service.InvalidArgumentException- if an argument is invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.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 invalidMailTemplateNotFoundException- if the mail template could not be foundafrica.absa.inception.core.service.ServiceUnavailableException- if the mail template could not be updated
-
-