Class SMTPRelay
- java.lang.Object
-
- com.levigo.jadice.server.agent.email.SMTPRelay
-
- Direct Known Subclasses:
ErrorRelay
public class SMTPRelay extends Object
Definition of an SMTP server that allows jadice server to send outgoingMessage
s.Secure transport can be enforced by configuring an
SMTPS
connection and applying additional session parameters as described in the javamail documentation.- Since:
- jadice server 4.2.1.6
-
-
Constructor Summary
Constructors Constructor Description SMTPRelay()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getAdditionalSessionProperties()
javax.mail.internet.InternetAddress
getAddress()
String
getAddressAsString()
String
getHostname()
String
getPassword()
String
getProtocol()
javax.mail.Session
getSession()
String
getUsername()
void
send(javax.mail.internet.MimeMessage message)
Send a message via the specified connection and parameters.void
setAdditionalSessionProperties(Map<String,String> props)
Apply additional parameters to the underlying javamailSession
.void
setAddress(javax.mail.internet.InternetAddress address)
void
setAddressAsString(String address)
void
setHostname(String hostname)
Set the SMTP host where to connect tovoid
setPassword(String password)
void
setProtocol(String protocol)
Alters the transport protocol.void
setUsername(String username)
-
-
-
Method Detail
-
getHostname
public String getHostname()
-
setHostname
public void setHostname(String hostname)
Set the SMTP host where to connect to- Parameters:
hostname
- hostname, must not benull
.- Throws:
IllegalArgumentException
- ifhostname
isnull
.
-
getProtocol
public String getProtocol()
-
setProtocol
public void setProtocol(String protocol)
Alters the transport protocol.smtp
orsmtps
are reasonable values. Default value:smtp
- Parameters:
protocol
- the transport protocol to use- Throws:
IllegalArgumentException
- ifprotocol
isnull
.- Since:
- jadice server 5.1.5.0
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
-
getPassword
public String getPassword()
-
setPassword
public void setPassword(String password)
-
getAddress
public javax.mail.internet.InternetAddress getAddress()
-
setAddress
public void setAddress(javax.mail.internet.InternetAddress address)
-
setAddressAsString
public void setAddressAsString(String address) throws javax.mail.internet.AddressException
- Throws:
javax.mail.internet.AddressException
-
getAddressAsString
public String getAddressAsString()
-
setAdditionalSessionProperties
public void setAdditionalSessionProperties(Map<String,String> props)
Apply additional parameters to the underlying javamailSession
.- Parameters:
props
- additional properties- Throws:
IllegalArgumentException
- ifprops
isnull
.- Since:
- jadice server 5.1.5.0
- See Also:
- javamail documentation
-
send
public void send(javax.mail.internet.MimeMessage message) throws javax.mail.MessagingException
Send a message via the specified connection and parameters.- Parameters:
message
- the message to send- Throws:
javax.mail.MessagingException
- if communication failsIllegalArgumentException
- ifmessage
is null
-
getSession
public javax.mail.Session getSession()
-
-