Package org.opencms.mail
Class CmsMailHost
- java.lang.Object
-
- org.opencms.mail.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()
Returnstrue
only if authentication is enabled, the default isfalse
.java.lang.String
toString()
-
-
-
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 hostorder
- the order in which the host is triedprotocol
- the protocol to use (default "smtp")security
- the security settingusername
- the user name to use for authenticationpassword
- the password to use for authenticationport
- the port, if < 0 then 25 is used
-
-
Method Detail
-
compareTo
public int compareTo(CmsMailHost obj)
- Specified by:
compareTo
in interfacejava.lang.Comparable<CmsMailHost>
- See Also:
Comparable.compareTo(java.lang.Object)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.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 classjava.lang.Object
- See Also:
Object.hashCode()
-
isAuthenticating
public boolean isAuthenticating()
Returnstrue
only if authentication is enabled, the default isfalse
.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 classjava.lang.Object
- See Also:
Object.toString()
-
-