public class MailerModel extends AbstractTestElement implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
MailerModel.MailAuthType |
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
MailerModel()
Constructs a MailerModel.
|
Modifier and Type | Method and Description |
---|---|
void |
add(SampleResult sample)
Adds a SampleResult for display in the Visualizer.
|
void |
add(SampleResult sample,
boolean sendMails)
Adds a SampleResult.
|
void |
addChangeListener(ChangeListener list) |
void |
clear()
Resets the state of this object to its default.
|
Object |
clone() |
List<String> |
getAddressList()
Gets a List of String-objects.
|
long |
getFailureCount() |
long |
getFailureLimit() |
String |
getFailureSubject() |
String |
getFromAddress() |
String |
getLogin() |
MailerModel.MailAuthType |
getMailAuthType() |
String |
getPassword() |
String |
getSmtpHost() |
String |
getSmtpPort() |
long |
getSuccessCount() |
long |
getSuccessLimit() |
String |
getSuccessSubject() |
String |
getToAddress() |
void |
notifyChangeListeners() |
void |
sendMail(String from,
List<String> vEmails,
String subject,
String attText,
String smtpHost)
Sends a mail with the given parameters using SMTP.
|
void |
sendMail(String from,
List<String> vEmails,
String subject,
String attText,
String smtpHost,
String smtpPort,
String user,
String password,
MailerModel.MailAuthType mailAuthType,
boolean debug)
Sends a mail with the given parameters using SMTP.
|
void |
sendTestMail()
Send a Test Mail to check configuration
|
void |
setFailureLimit(String limit) |
void |
setFailureSubject(String str) |
void |
setFromAddress(String str) |
void |
setLogin(String login) |
void |
setMailAuthType(String value) |
void |
setPassword(String password) |
void |
setSmtpHost(String str) |
void |
setSmtpPort(String value) |
void |
setSuccessLimit(String limit) |
void |
setSuccessSubject(String str) |
void |
setToAddress(String str) |
String |
toString()
Returns a String-representation of this object.
|
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
finalize, getClass, notify, notifyAll, wait, wait, wait
removed
public void addChangeListener(ChangeListener list)
public Object clone()
clone
in interface TestElement
clone
in class AbstractTestElement
public void notifyChangeListeners()
public List<String> getAddressList()
setToAddress(str)
. The addresses
must be separated by commas. Only String-objects containing a "@" are
added to the returned List.public void add(SampleResult sample)
sample
- the SampleResult encapsulating information about the last sample.public void add(SampleResult sample, boolean sendMails)
successCount
and
failureCount
.sample
- the SampleResult encapsulating information about the last
sample.sendMails
- whether or not to send e-mailspublic void clear()
clear
in interface TestElement
clear
in class AbstractTestElement
public String toString()
public void sendMail(String from, List<String> vEmails, String subject, String attText, String smtpHost) throws javax.mail.MessagingException
from
- the sender of the mail as shown in the mail-client.vEmails
- all receivers of the mail. The receivers are seperated by
commas.subject
- the subject of the mail.attText
- the message-body.smtpHost
- the smtp-server used to send the mail.javax.mail.MessagingException
- if the building of the message failsjavax.mail.internet.AddressException
- if any of the addresses is wrongpublic void sendMail(String from, List<String> vEmails, String subject, String attText, String smtpHost, String smtpPort, String user, String password, MailerModel.MailAuthType mailAuthType, boolean debug) throws javax.mail.MessagingException
from
- the sender of the mail as shown in the mail-client.vEmails
- all receivers of the mail. The receivers are seperated by
commas.subject
- the subject of the mail.attText
- the message-body.smtpHost
- the smtp-server used to send the mail.smtpPort
- the smtp-server port used to send the mail.user
- the login used to authenticatepassword
- the password used to authenticatemailAuthType
- MailerModel.MailAuthType
Security policydebug
- Flag whether debug messages for the mail session should be generatedjavax.mail.internet.AddressException
- If mail address is wrongjavax.mail.MessagingException
- If building MimeMessage failspublic void sendTestMail() throws javax.mail.MessagingException
javax.mail.internet.AddressException
- If mail address is wrongjavax.mail.MessagingException
- If building MimeMessage failspublic void setToAddress(String str)
public void setFromAddress(String str)
public void setSmtpHost(String str)
public void setSmtpPort(String value)
public void setLogin(String login)
public void setPassword(String password)
public void setMailAuthType(String value)
public void setFailureSubject(String str)
public void setSuccessSubject(String str)
public void setSuccessLimit(String limit)
public void setFailureLimit(String limit)
public String getToAddress()
public String getFromAddress()
public String getSmtpHost()
public String getSmtpPort()
public String getFailureSubject()
public String getSuccessSubject()
public long getSuccessLimit()
public long getSuccessCount()
public long getFailureLimit()
public long getFailureCount()
public String getLogin()
public String getPassword()
public MailerModel.MailAuthType getMailAuthType()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.