Class CmsMailHost

  • All Implemented Interfaces:
    java.lang.Comparable<CmsMailHost>

    public class CmsMailHost
    extends java.lang.Object
    implements java.lang.Comparable<CmsMailHost>
    Contains the configuration of an individual mail host.

    Since:
    6.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      CmsMailHost​(java.lang.String hostname, java.lang.Integer port, java.lang.Integer order, java.lang.String protocol, java.lang.String security, java.lang.String username, java.lang.String password)
      Creates a new mail host.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(CmsMailHost obj)  
      boolean equals​(java.lang.Object obj)  
      java.lang.String getHostname()
      Returns the host name.
      java.lang.Integer getOrder()
      Returns the order of this mail host.
      java.lang.String getPassword()
      Returns the password used for authentication.
      int getPort()
      Returns the port.
      java.lang.String getProtocol()
      Returns the protocol used for mail sending, default is "smtp".
      java.lang.String getSecurity()
      Gets the value of the security setting.
      java.lang.String getUsername()
      Returns the user name used for authentication.
      int hashCode()  
      boolean isAuthenticating()
      Returns true only if authentication is enabled, the default is false.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CmsMailHost

        public CmsMailHost​(java.lang.String hostname,
                           java.lang.Integer port,
                           java.lang.Integer order,
                           java.lang.String protocol,
                           java.lang.String security,
                           java.lang.String username,
                           java.lang.String password)
        Creates a new mail host.

        Parameters:
        hostname - the name of the mail host
        order - the order in which the host is tried
        protocol - the protocol to use (default "smtp")
        security - the security setting
        username - the user name to use for authentication
        password - the password to use for authentication
        port - the port, if < 0 then 25 is used
    • Method Detail

      • compareTo

        public int compareTo​(CmsMailHost obj)
        Specified by:
        compareTo in interface java.lang.Comparable<CmsMailHost>
        See Also:
        Comparable.compareTo(java.lang.Object)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • getHostname

        public java.lang.String getHostname()
        Returns the host name.

        Returns:
        the host name
      • getOrder

        public java.lang.Integer getOrder()
        Returns the order of this mail host.

        Returns:
        the order of this mail host
      • getPassword

        public java.lang.String getPassword()
        Returns the password used for authentication.

        Returns:
        the password used for authentication
      • getPort

        public int getPort()
        Returns the port.

        Returns:
        the port
      • getProtocol

        public java.lang.String getProtocol()
        Returns the protocol used for mail sending, default is "smtp".

        Returns:
        the protocol used for mail sending
      • getSecurity

        public java.lang.String getSecurity()
        Gets the value of the security setting.

        Returns:
        the value of the security setting
      • getUsername

        public java.lang.String getUsername()
        Returns the user name used for authentication.

        Returns:
        the user name used for authentication
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • isAuthenticating

        public boolean isAuthenticating()
        Returns true only if authentication is enabled, the default is false.

        Authentication is enabled only if both "username" and "password" are not null.

        Returns:
        true only if authentication is enabled
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()