java.lang.Object
one.jpro.platform.mail.impl.MailConfigImpl
- All Implemented Interfaces:
MailConfig
- Direct Known Subclasses:
GoogleMailConfig,MailTrapConfig
Mail configuration implementation.
- Author:
- Besmir Beqiri
-
Field Summary
Fields inherited from interface one.jpro.platform.mail.MailConfig
DEFAULT_MAIL_DEBUG, DEFAULT_MAIL_SMTP_AUTH, DEFAULT_MAIL_SMTP_AUTH_DIGEST_MD5_DISABLE, DEFAULT_MAIL_SMTP_AUTH_XOAUTH2_DISABLE, DEFAULT_MAIL_SMTP_HOST, DEFAULT_MAIL_SMTP_PORT, DEFAULT_MAIL_SMTP_SSL_CHECKSERVERIDENTITY, DEFAULT_MAIL_SMTP_SSL_ENABLE, DEFAULT_MAIL_SMTP_STARTTLS, MAIL_DEBUG, MAIL_SMTP_AUTH, MAIL_SMTP_AUTH_DIGEST_MD5_DISABLE, MAIL_SMTP_AUTH_LOGIN_DISABLE, MAIL_SMTP_AUTH_MECHANISMS, MAIL_SMTP_AUTH_PLAIN_DISABLE, MAIL_SMTP_AUTH_XOAUTH2_DISABLE, MAIL_SMTP_CONNECTIONTIMEOUT, MAIL_SMTP_HOST, MAIL_SMTP_PORT, MAIL_SMTP_SSL_CHECKSERVERIDENTITY, MAIL_SMTP_SSL_ENABLE, MAIL_SMTP_SSL_TRUST, MAIL_SMTP_STARTTLS_ENABLE, MAIL_SMTP_STARTTLS_REQUIRED, MAIL_SMTP_TIMEOUT, MAIL_SMTP_USER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull StringGets the SMTP authentication mechanisms.intGets the SMTP connection timeout.@NotNull StringGets the SMTP host.intGets the SMTP port.@NotNull StringGets the SMTP SSL trust setting.@NotNull StartTLSOptionGets the STARTTLS option.intGets the SMTP timeout.@NotNull StringGets the SMTP user.@NotNull PropertiesGets the mail properties.booleanChecks if mail debugging is enabled.booleanChecks if SMTP authentication is enabled.booleanChecks if the "AUTH DIGEST-MD5" command is disabled.booleanChecks if the "AUTH LOGIN" command is disabled.booleanChecks if the "AUTH PLAIN" command is disabled.booleanChecks if the "AUTH XOAUTH2" command is disabled.booleanChecks if the server identity is checked for SMTP SSL.booleanChecks if SSL is enabled for SMTP.@NotNull MailConfigsetMailDebug(boolean mailDebug) Sets the mail debugging option.@NotNull MailConfigsetMailSmtpAuth(boolean mailSmtpAuth) Sets the SMTP authentication option.@NotNull MailConfigsetMailSmtpAuthDigestMd5Disable(boolean mailSmtpAuthDigestMd5Disable) Sets the option to disable the "AUTH DIGEST-MD5" command.@NotNull MailConfigsetMailSmtpAuthLoginDisable(boolean mailSmtpAuthLoginDisable) Sets the option to disable the "AUTH LOGIN" command.@NotNull MailConfigsetMailSmtpAuthMechanisms(String mailSmtpAuthMechanisms) Sets the SMTP authentication mechanisms.@NotNull MailConfigsetMailSmtpAuthPlainDisable(boolean mailSmtpAuthPlainDisable) Sets the option to disable the "AUTH PLAIN" command.@NotNull MailConfigsetMailSmtpAuthXOAuth2Disable(boolean mailSmtpAuthXOAuth2Disable) Sets the option to disable the "AUTH XOAUTH2" command.@NotNull MailConfigsetMailSmtpConnectionTimeout(int mailSmtpConnectionTimeout) Sets the SMTP connection timeout.@NotNull MailConfigsetMailSmtpHost(String mailSmtpHost) Sets the SMTP host.@NotNull MailConfigsetMailSmtpPort(int mailSmtpPort) Sets the SMTP port.@NotNull MailConfigsetMailSmtpSslCheckServerIdentity(boolean mailSmtpSslCheckServerIdentity) Sets the option to check the server identity for SMTP SSL.@NotNull MailConfigsetMailSmtpSslEnable(boolean mailSmtpSslEnable) Sets the option to enable SSL for SMTP.@NotNull MailConfigsetMailSmtpSslTrust(String mailSmtpSslTrust) Sets the SMTP SSL trust setting.@NotNull MailConfigsetMailSmtpStartTLS(StartTLSOption mailSmtpStarttls) Sets the STARTTLS option.@NotNull MailConfigsetMailSmtpTimeout(int mailSmtpTimeout) Sets the SMTP timeout.@NotNull MailConfigsetMailSmtpUser(String mailSmtpUser) Sets the SMTP user.
-
Constructor Details
-
MailConfigImpl
public MailConfigImpl()
-
-
Method Details
-
getProperties
Description copied from interface:MailConfigGets the mail properties.- Specified by:
getPropertiesin interfaceMailConfig- Returns:
- a
Propertiesobject containing mail properties
-
isMailDebug
public boolean isMailDebug()Description copied from interface:MailConfigChecks if mail debugging is enabled.- Specified by:
isMailDebugin interfaceMailConfig- Returns:
trueif mail debugging is enabled,falseotherwise
-
setMailDebug
Description copied from interface:MailConfigSets the mail debugging option.- Specified by:
setMailDebugin interfaceMailConfig- Parameters:
mailDebug-trueto enable mail debugging,falseto disable it- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpUser
Description copied from interface:MailConfigGets the SMTP user.- Specified by:
getMailSmtpUserin interfaceMailConfig- Returns:
- the SMTP user as a string
-
setMailSmtpUser
Description copied from interface:MailConfigSets the SMTP user.- Specified by:
setMailSmtpUserin interfaceMailConfig- Parameters:
mailSmtpUser- the SMTP user to set- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpHost
Description copied from interface:MailConfigGets the SMTP host.- Specified by:
getMailSmtpHostin interfaceMailConfig- Returns:
- the SMTP host
-
setMailSmtpHost
Description copied from interface:MailConfigSets the SMTP host.- Specified by:
setMailSmtpHostin interfaceMailConfig- Parameters:
mailSmtpHost- the SMTP host to set- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpPort
public int getMailSmtpPort()Description copied from interface:MailConfigGets the SMTP port.- Specified by:
getMailSmtpPortin interfaceMailConfig- Returns:
- the SMTP port
-
setMailSmtpPort
Description copied from interface:MailConfigSets the SMTP port.- Specified by:
setMailSmtpPortin interfaceMailConfig- Parameters:
mailSmtpPort- the SMTP port to set- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpConnectionTimeout
public int getMailSmtpConnectionTimeout()Description copied from interface:MailConfigGets the SMTP connection timeout.- Specified by:
getMailSmtpConnectionTimeoutin interfaceMailConfig- Returns:
- the SMTP connection timeout in milliseconds
-
setMailSmtpConnectionTimeout
Description copied from interface:MailConfigSets the SMTP connection timeout.- Specified by:
setMailSmtpConnectionTimeoutin interfaceMailConfig- Parameters:
mailSmtpConnectionTimeout- the SMTP connection timeout in milliseconds- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpTimeout
public int getMailSmtpTimeout()Description copied from interface:MailConfigGets the SMTP timeout.- Specified by:
getMailSmtpTimeoutin interfaceMailConfig- Returns:
- the SMTP timeout in milliseconds
-
setMailSmtpTimeout
Description copied from interface:MailConfigSets the SMTP timeout.- Specified by:
setMailSmtpTimeoutin interfaceMailConfig- Parameters:
mailSmtpTimeout- the SMTP timeout in milliseconds- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpAuth
public boolean isMailSmtpAuth()Description copied from interface:MailConfigChecks if SMTP authentication is enabled.- Specified by:
isMailSmtpAuthin interfaceMailConfig- Returns:
trueif SMTP authentication is enabled,falseotherwise
-
setMailSmtpAuth
Description copied from interface:MailConfigSets the SMTP authentication option.- Specified by:
setMailSmtpAuthin interfaceMailConfig- Parameters:
mailSmtpAuth-trueto enable SMTP authentication,falseto disable- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpAuthMechanisms
Description copied from interface:MailConfigGets the SMTP authentication mechanisms.- Specified by:
getMailSmtpAuthMechanismsin interfaceMailConfig- Returns:
- a string representing the SMTP authentication mechanisms
-
setMailSmtpAuthMechanisms
Description copied from interface:MailConfigSets the SMTP authentication mechanisms.- Specified by:
setMailSmtpAuthMechanismsin interfaceMailConfig- Parameters:
mailSmtpAuthMechanisms- the SMTP authentication mechanisms to set- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpAuthLoginDisable
public boolean isMailSmtpAuthLoginDisable()Description copied from interface:MailConfigChecks if the "AUTH LOGIN" command is disabled.- Specified by:
isMailSmtpAuthLoginDisablein interfaceMailConfig- Returns:
trueif the "AUTH LOGIN" command is disabled,falseotherwise
-
setMailSmtpAuthLoginDisable
Description copied from interface:MailConfigSets the option to disable the "AUTH LOGIN" command.- Specified by:
setMailSmtpAuthLoginDisablein interfaceMailConfig- Parameters:
mailSmtpAuthLoginDisable-trueto disable the "AUTH LOGIN" command,falseto enable- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpAuthPlainDisable
public boolean isMailSmtpAuthPlainDisable()Description copied from interface:MailConfigChecks if the "AUTH PLAIN" command is disabled.- Specified by:
isMailSmtpAuthPlainDisablein interfaceMailConfig- Returns:
trueif the "AUTH PLAIN" command is disabled,falseotherwise
-
setMailSmtpAuthPlainDisable
Description copied from interface:MailConfigSets the option to disable the "AUTH PLAIN" command.- Specified by:
setMailSmtpAuthPlainDisablein interfaceMailConfig- Parameters:
mailSmtpAuthPlainDisable-trueto disable the "AUTH PLAIN" command,falseto enable- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpAuthDigestMd5Disable
public boolean isMailSmtpAuthDigestMd5Disable()Description copied from interface:MailConfigChecks if the "AUTH DIGEST-MD5" command is disabled.- Specified by:
isMailSmtpAuthDigestMd5Disablein interfaceMailConfig- Returns:
trueif the "AUTH DIGEST-MD5" command is disabled,falseotherwise
-
setMailSmtpAuthDigestMd5Disable
@NotNull public @NotNull MailConfig setMailSmtpAuthDigestMd5Disable(boolean mailSmtpAuthDigestMd5Disable) Description copied from interface:MailConfigSets the option to disable the "AUTH DIGEST-MD5" command.- Specified by:
setMailSmtpAuthDigestMd5Disablein interfaceMailConfig- Parameters:
mailSmtpAuthDigestMd5Disable-trueto disable the "AUTH DIGEST-MD5" command,falseto enable- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpAuthXOAuth2Disable
public boolean isMailSmtpAuthXOAuth2Disable()Description copied from interface:MailConfigChecks if the "AUTH XOAUTH2" command is disabled.- Specified by:
isMailSmtpAuthXOAuth2Disablein interfaceMailConfig- Returns:
trueif the "AUTH XOAUTH2" command is disabled,falseotherwise
-
setMailSmtpAuthXOAuth2Disable
@NotNull public @NotNull MailConfig setMailSmtpAuthXOAuth2Disable(boolean mailSmtpAuthXOAuth2Disable) Description copied from interface:MailConfigSets the option to disable the "AUTH XOAUTH2" command.- Specified by:
setMailSmtpAuthXOAuth2Disablein interfaceMailConfig- Parameters:
mailSmtpAuthXOAuth2Disable-trueto disable the "AUTH XOAUTH2" command,falseto enable- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpStartTLS
Description copied from interface:MailConfigGets the STARTTLS option.- Specified by:
getMailSmtpStartTLSin interfaceMailConfig- Returns:
- the STARTTLS option
-
setMailSmtpStartTLS
Description copied from interface:MailConfigSets the STARTTLS option.- Specified by:
setMailSmtpStartTLSin interfaceMailConfig- Parameters:
mailSmtpStarttls- the STARTTLS option to set- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpSslEnable
public boolean isMailSmtpSslEnable()Description copied from interface:MailConfigChecks if SSL is enabled for SMTP.- Specified by:
isMailSmtpSslEnablein interfaceMailConfig- Returns:
trueif SSL is enabled,falseotherwise
-
setMailSmtpSslEnable
Description copied from interface:MailConfigSets the option to enable SSL for SMTP.- Specified by:
setMailSmtpSslEnablein interfaceMailConfig- Parameters:
mailSmtpSslEnable-trueto enable SSL,falseto disable- Returns:
- the updated
MailConfiginstance for method chaining
-
isMailSmtpSslCheckServerIdentity
public boolean isMailSmtpSslCheckServerIdentity()Description copied from interface:MailConfigChecks if the server identity is checked for SMTP SSL.- Specified by:
isMailSmtpSslCheckServerIdentityin interfaceMailConfig- Returns:
trueif the server identity is checked,falseotherwise
-
setMailSmtpSslCheckServerIdentity
@NotNull public @NotNull MailConfig setMailSmtpSslCheckServerIdentity(boolean mailSmtpSslCheckServerIdentity) Description copied from interface:MailConfigSets the option to check the server identity for SMTP SSL.- Specified by:
setMailSmtpSslCheckServerIdentityin interfaceMailConfig- Parameters:
mailSmtpSslCheckServerIdentity-trueto check the server identity,falseto disable- Returns:
- the updated
MailConfiginstance for method chaining
-
getMailSmtpSslTrust
Description copied from interface:MailConfigGets the SMTP SSL trust setting.- Specified by:
getMailSmtpSslTrustin interfaceMailConfig- Returns:
- a string representing the SMTP SSL trust setting
-
setMailSmtpSslTrust
Description copied from interface:MailConfigSets the SMTP SSL trust setting.- Specified by:
setMailSmtpSslTrustin interfaceMailConfig- Parameters:
mailSmtpSslTrust- the SMTP SSL trust setting to set- Returns:
- the updated
MailConfiginstance for method chaining
-