org.opencms.mail
Class CmsMailHost

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

public class CmsMailHost
extends java.lang.Object
implements java.lang.Comparable

Contains the configuration of an individual mail host.

Since:
6.0.0
Version:
$Revision: 1.14 $
Author:
Andreas Zahner

Constructor Summary
CmsMailHost(java.lang.String hostname, java.lang.Integer port, java.lang.Integer order, java.lang.String protocol, java.lang.String username, java.lang.String password)
          Creates a new mail host.
 
Method Summary
 int compareTo(java.lang.Object 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 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 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")
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(java.lang.Object obj)
Specified by:
compareTo in interface java.lang.Comparable
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

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()