Class AbstractMailConnector
- java.lang.Object
-
- eu.tsystems.mms.tic.testframework.mailconnector.util.AbstractMailConnector
-
- All Implemented Interfaces:
eu.tsystems.mms.tic.testframework.logging.Loggable
- Direct Known Subclasses:
AbstractInboxConnector,SMTPMailConnector
public abstract class AbstractMailConnector extends java.lang.Object implements eu.tsystems.mms.tic.testframework.logging.Loggableabstract class to handle mail connector
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Consumer<java.util.Properties>sessionPropertiesConfigurationConsumer
-
Constructor Summary
Constructors Constructor Description AbstractMailConnector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AbstractMailConnectorconfigureSessionProperties(java.util.function.Consumer<java.util.Properties> consumer)Sets a consumer for configuring properties right beforeopenSession()protected jakarta.mail.SessioncreateDefaultSession(java.util.Properties mailProperties, java.lang.String protocol)java.lang.StringgetInboxFolder()gets the inboxFolderjava.lang.StringgetPassword()gets the passwordjava.lang.StringgetPort()gets the portjava.lang.StringgetServer()gets the serverjakarta.mail.SessiongetSession()gets the sessionjava.lang.StringgetUsername()gets the usernamebooleanisDebug()checks if the debug is true or falsebooleanisSslEnabled()checks the sslEnabled if it is true or falseprotected abstract voidopenSession()voidsetDebug(boolean debug)sets the debugvoidsetInboxFolder(java.lang.String inboxFolder)sets the inboxFoldervoidsetPassword(java.lang.String password)sets the passwordvoidsetPort(java.lang.String port)sets the portvoidsetServer(java.lang.String server)sets the servervoidsetSession(jakarta.mail.Session session)sets the sessionvoidsetSslEnabled(boolean sslEnabled)sets the sslEnabledvoidsetUsername(java.lang.String username)sets the username
-
-
-
Method Detail
-
openSession
protected abstract void openSession()
-
configureSessionProperties
public AbstractMailConnector configureSessionProperties(java.util.function.Consumer<java.util.Properties> consumer)
Sets a consumer for configuring properties right beforeopenSession()
-
createDefaultSession
protected jakarta.mail.Session createDefaultSession(java.util.Properties mailProperties, java.lang.String protocol)
-
getSession
public jakarta.mail.Session getSession()
gets the session- Returns:
- the session
-
getServer
public java.lang.String getServer()
gets the server- Returns:
- the server
-
setServer
public void setServer(java.lang.String server)
sets the server- Parameters:
server- the server to set
-
getPort
public java.lang.String getPort()
gets the port- Returns:
- the port
-
setPort
public void setPort(java.lang.String port)
sets the port- Parameters:
port- the port to set
-
getInboxFolder
public java.lang.String getInboxFolder()
gets the inboxFolder- Returns:
- the inboxFolder
-
setInboxFolder
public void setInboxFolder(java.lang.String inboxFolder)
sets the inboxFolder- Parameters:
inboxFolder- the inboxFolder to set
-
getUsername
public java.lang.String getUsername()
gets the username- Returns:
- the username
-
setUsername
public void setUsername(java.lang.String username)
sets the username- Parameters:
username- the username to set
-
getPassword
public java.lang.String getPassword()
gets the password- Returns:
- the password
-
setPassword
public void setPassword(java.lang.String password)
sets the password- Parameters:
password- the password to set
-
isDebug
public boolean isDebug()
checks if the debug is true or false- Returns:
- the debug
-
setDebug
public void setDebug(boolean debug)
sets the debug- Parameters:
debug- the debug to set
-
isSslEnabled
public boolean isSslEnabled()
checks the sslEnabled if it is true or false- Returns:
- the sslEnabled
-
setSslEnabled
public void setSslEnabled(boolean sslEnabled)
sets the sslEnabled- Parameters:
sslEnabled- the sslEnabled to set
-
setSession
public void setSession(jakarta.mail.Session session)
sets the session- Parameters:
session- the session to set
-
-