org.opencms.mail
Class CmsMailHost

java.lang.Object
  extended by org.opencms.mail.CmsMailHost
All Implemented Interfaces:
Comparable<CmsMailHost>

public class CmsMailHost
extends Object
implements Comparable<CmsMailHost>

Contains the configuration of an individual mail host.

Since:
6.0.0

Constructor Summary
CmsMailHost(String hostname, Integer port, Integer order, String protocol, String username, String password)
          Creates a new mail host.
 
Method Summary
 int compareTo(CmsMailHost obj)
           
 boolean equals(Object obj)
           
 String getHostname()
          Returns the host name.
 Integer getOrder()
          Returns the order of this mail host.
 String getPassword()
          Returns the password used for authentication.
 int getPort()
          Returns the port.
 String getProtocol()
          Returns the protocol used for mail sending, default is "smtp".
 String getUsername()
          Returns the user name used for authentication.
 int hashCode()
           
 boolean isAuthenticating()
          Returns true only if authentication is enabled, the default is false.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsMailHost

public CmsMailHost(String hostname,
                   Integer port,
                   Integer order,
                   String protocol,
                   String username,
                   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")
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 Comparable<CmsMailHost>
See Also:
Comparable.compareTo(java.lang.Object)

equals

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

getHostname

public String getHostname()
Returns the host name.

Returns:
the host name

getOrder

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

Returns:
the order of this mail host

getPassword

public 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 String getProtocol()
Returns the protocol used for mail sending, default is "smtp".

Returns:
the protocol used for mail sending

getUsername

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

Returns:
the user name used for authentication

hashCode

public int hashCode()
Overrides:
hashCode in class 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 String toString()
Overrides:
toString in class Object
See Also:
Object.toString()