Package overit.geocall.config.company
Class PropertiesMailService
java.lang.Object
overit.geocall.config.company.PropertiesMailService
class containing the configurations related to the configured mail services.
note: all the configuration refers to the company whose the identity belongs to.
note: all the configuration refers to the company whose the identity belongs to.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringRetrieve the client id used to authenticate with OAuth.static StringclientSecret(Company company, String mailService) Retrieve the client secret used to authenticate with OAuth.static MailServergetMailServer(Company company, String mailService) Get the MailServer instance starting from the configuration related to the passed companystatic StringRetrieve the hostname associated to the mail server.static StringoauthSystemUser(Company company, String mailService) Retrieve the OAuth system user used to perform the POST.static StringRetrieve the password used to authenticate with the mail server.static IntegerRetrieve the listening port of the mail server.static StringRetrieve the provider configuration string.static booleansendBySystemUser(Company company, String mailService) Retrieve the boolean value indicating if send by system user capability is enabled or not.Get the list of the names for the configured mail services.static StringRetrieve the token url used to authenticate with OAuth.static StringRetrieve the username used to authenticate with the mail server.
-
Method Details
-
services
Get the list of the names for the configured mail services.- Parameters:
company- the company from which extract the configuration- Returns:
- the names of the configured mail service. If there's no mail service configured, this method will return an empty list.
-
host
Retrieve the hostname associated to the mail server.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the service hostname or null if it is not configured
-
port
Retrieve the listening port of the mail server.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the service port or null if it is not configured
-
provider
Retrieve the provider configuration string. Typically, this configuration is composed by different parameters separated by spaces. The first parameter is always the protocol that will be used, and this could be:smtpsmtps
tls: to enable the startTLS supportsendpartial: to send the message even if there's any invalid addresses within the recipient's listdsn: to enable the Delivery Status Notificationdelay=5: to set a defined delay (expressed in seconds) after the message has been senttimeout=10: to set a timeout (expressed in seconds) during the message sendingssl=10: specifies the SSL protocols that will be enabled for SSL connection (i.e.SSLv2Hello, SSLv3, TLSv1, TLSv1.1 or TLSv1.2)
- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the service provider configuration or null if it is not configured
-
username
Retrieve the username used to authenticate with the mail server.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the username that will be used within the authentication or null if it is not configured
-
password
Retrieve the password used to authenticate with the mail server.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the password that will be used within the authentication or null if it is not configured
-
clientId
Retrieve the client id used to authenticate with OAuth.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the client id that will be used within the OAuth authentication or null if it is not configured.
-
clientSecret
Retrieve the client secret used to authenticate with OAuth.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the client secret that will be used within the OAuth authentication or null if it is not configured.
-
tokenUrl
Retrieve the token url used to authenticate with OAuth.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the token url that will be used within the OAuth authentication or null if it is not configured.
-
oauthSystemUser
Retrieve the OAuth system user used to perform the POST. Alternatively can be used also the ID of the user in Azure.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
- the OAuth system user used to perform the POST or null if it is not configured.
-
sendBySystemUser
Retrieve the boolean value indicating if send by system user capability is enabled or not. If this value is false then the email will be sent by the user obtained from the filed "From" of the message object.- Parameters:
company- the company from which extract the configurationmailService- the name of the selected mail service- Returns:
trueif is enabled,falseotherwise
-
getMailServer
Get the MailServer instance starting from the configuration related to the passed company- Parameters:
company- the company from which extract the configurationmailService- the identifier of the mail service configuration- Returns:
- the mail sever instance or null if it cannot be retrieved
- Throws:
overit.geocall.asserts.AssertsException- if the passed company is null
-