Class 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.Loggable
    abstract class to handle mail connector
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.function.Consumer<java.util.Properties> sessionPropertiesConfigurationConsumer  
      • Fields inherited from interface eu.tsystems.mms.tic.testframework.logging.Loggable

        prompt
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      AbstractMailConnector configureSessionProperties​(java.util.function.Consumer<java.util.Properties> consumer)
      Sets a consumer for configuring properties right before openSession()
      protected jakarta.mail.Session createDefaultSession​(java.util.Properties mailProperties, java.lang.String protocol)  
      java.lang.String getInboxFolder()
      gets the inboxFolder
      java.lang.String getPassword()
      gets the password
      java.lang.String getPort()
      gets the port
      java.lang.String getServer()
      gets the server
      jakarta.mail.Session getSession()
      gets the session
      java.lang.String getUsername()
      gets the username
      boolean isDebug()
      checks if the debug is true or false
      boolean isSslEnabled()
      checks the sslEnabled if it is true or false
      protected abstract void openSession()  
      void setDebug​(boolean debug)
      sets the debug
      void setInboxFolder​(java.lang.String inboxFolder)
      sets the inboxFolder
      void setPassword​(java.lang.String password)
      sets the password
      void setPort​(java.lang.String port)
      sets the port
      void setServer​(java.lang.String server)
      sets the server
      void setSession​(jakarta.mail.Session session)
      sets the session
      void setSslEnabled​(boolean sslEnabled)
      sets the sslEnabled
      void setUsername​(java.lang.String username)
      sets the username
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface eu.tsystems.mms.tic.testframework.logging.Loggable

        log
    • Field Detail

      • sessionPropertiesConfigurationConsumer

        protected java.util.function.Consumer<java.util.Properties> sessionPropertiesConfigurationConsumer
    • Constructor Detail

      • AbstractMailConnector

        public AbstractMailConnector()
    • 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 before openSession()
      • 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