Class EmailAccount


  • public class EmailAccount
    extends java.lang.Object
    Email account data. Note, the file format has changed for Jadex 3.0, but still support reading the old format.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Properties props
      All settings are stored in standard javax.mail...
    • Constructor Summary

      Constructors 
      Constructor Description
      EmailAccount()
      Create a new EmailAccount.
      EmailAccount​(java.lang.String filename)
      Create a new EmailAccount.
      EmailAccount​(java.lang.String user, java.lang.String password, java.lang.String sender, java.lang.String smtphost, java.lang.Integer smtpport, boolean ssl, boolean starttls, java.lang.String receivehost, java.lang.String receiveprotocol, boolean noauth)
      Create a new account.
      EmailAccount​(java.util.Properties props)
      Create an account with initial properties.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static EmailAccount createAccount​(java.lang.String filename, java.lang.ClassLoader cl)
      Read account data from property file.
      java.lang.String getPassword()
      Get the password.
      java.util.Properties getProperties()
      Get the properties.
      java.lang.String getReceiveHost()
      Get the receivehost.
      java.lang.String getReceiveProtocol()
      Get the receiveprotocol.
      java.lang.String getSender()
      Get the sender.
      java.lang.String getSmtpHost()
      Get host.
      java.lang.Integer getSmtpPort()
      Get the port.
      java.lang.String getUser()
      Get the user.
      boolean isNoAuthentication()
      Get the noAuthentication.
      boolean isSsl()
      Is ssl connection?
      boolean isStartTls()
      Get the starttls.
      void readAccount​(java.io.InputStream is)
      Read account data from property file.
      void readAccount​(java.lang.String filename)
      Read account data from property file.
      void setNoAuthentication​(boolean noauth)
      Set the noAuthentication.
      void setPassword​(java.lang.String password)
      Set the password.
      void setProperties​(java.util.Properties props)
      Set the properties.
      void setReceiveHost​(java.lang.String receivehost)
      Set the receivehost.
      void setReceiveProtocol​(java.lang.String receiveprotocol)
      Set the receiveprotocol.
      void setSender​(java.lang.String sender)
      Set the sender.
      void setSmtpHost​(java.lang.String host)
      Set the host.
      void setSmtpPort​(java.lang.Integer port)
      Set the port.
      void setSsl​(boolean ssl)
      Set the ssl connection property.
      void setStartTls​(boolean starttls)
      Set the starttls.
      void setUser​(java.lang.String user)
      Set the user.
      void writeAccount​(java.lang.String filename)
      Store data to a property file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • props

        protected java.util.Properties props
        All settings are stored in standard javax.mail... and extended jadex.mail... properties.
    • Constructor Detail

      • EmailAccount

        public EmailAccount()
        Create a new EmailAccount.
      • EmailAccount

        public EmailAccount​(java.lang.String filename)
        Create a new EmailAccount.
      • EmailAccount

        public EmailAccount​(java.util.Properties props)
        Create an account with initial properties.
      • EmailAccount

        public EmailAccount​(java.lang.String user,
                            java.lang.String password,
                            java.lang.String sender,
                            java.lang.String smtphost,
                            java.lang.Integer smtpport,
                            boolean ssl,
                            boolean starttls,
                            java.lang.String receivehost,
                            java.lang.String receiveprotocol,
                            boolean noauth)
        Create a new account.
        Parameters:
        smtphost - The smtp host.
        port - The smtp port.
        user - The user name.
        password - The password.
        sender - The sender email.
        ssl - Flag for ssl.
    • Method Detail

      • getProperties

        public java.util.Properties getProperties()
        Get the properties.
      • setProperties

        public void setProperties​(java.util.Properties props)
        Set the properties.
      • getSmtpHost

        public java.lang.String getSmtpHost()
        Get host.
        Returns:
        The host.
      • setSmtpHost

        public void setSmtpHost​(java.lang.String host)
        Set the host.
        Parameters:
        host - The host.
      • getSmtpPort

        public java.lang.Integer getSmtpPort()
        Get the port.
        Returns:
        The port.
      • setSmtpPort

        public void setSmtpPort​(java.lang.Integer port)
        Set the port.
        Parameters:
        port - The port.
      • getUser

        public java.lang.String getUser()
        Get the user.
        Returns:
        The user.
      • setUser

        public void setUser​(java.lang.String user)
        Set the user.
        Parameters:
        user - The user.
      • getPassword

        public java.lang.String getPassword()
        Get the password.
        Returns:
        The password.
      • setPassword

        public void setPassword​(java.lang.String password)
        Set the password.
        Parameters:
        password - The password.
      • getSender

        public java.lang.String getSender()
        Get the sender.
        Returns:
        The sender.
      • setSender

        public void setSender​(java.lang.String sender)
        Set the sender.
        Parameters:
        sender - The sender.
      • isSsl

        public boolean isSsl()
        Is ssl connection?
        Returns:
        The
      • setSsl

        public void setSsl​(boolean ssl)
        Set the ssl connection property.
        Parameters:
        ssl - Flag indicating ssl.
      • isStartTls

        public boolean isStartTls()
        Get the starttls.
        Returns:
        The starttls.
      • setStartTls

        public void setStartTls​(boolean starttls)
        Set the starttls.
        Parameters:
        starttls - The starttls to set.
      • getReceiveHost

        public java.lang.String getReceiveHost()
        Get the receivehost.
        Returns:
        The receivehost.
      • setReceiveHost

        public void setReceiveHost​(java.lang.String receivehost)
        Set the receivehost.
        Parameters:
        receivehost - The receivehost to set.
      • getReceiveProtocol

        public java.lang.String getReceiveProtocol()
        Get the receiveprotocol.
        Returns:
        The receiveprotocol.
      • setReceiveProtocol

        public void setReceiveProtocol​(java.lang.String receiveprotocol)
        Set the receiveprotocol.
        Parameters:
        receiveprotocol - The receiveprotocol to set.
      • isNoAuthentication

        public boolean isNoAuthentication()
        Get the noAuthentication.
        Returns:
        The noAuthentication
      • setNoAuthentication

        public void setNoAuthentication​(boolean noauth)
        Set the noAuthentication.
        Parameters:
        noAuthentication - The noAuthentication to set
      • writeAccount

        public void writeAccount​(java.lang.String filename)
        Store data to a property file.
      • readAccount

        public void readAccount​(java.lang.String filename)
        Read account data from property file.
      • createAccount

        public static EmailAccount createAccount​(java.lang.String filename,
                                                 java.lang.ClassLoader cl)
        Read account data from property file.
      • readAccount

        public void readAccount​(java.io.InputStream is)
        Read account data from property file.