Package org.apache.jmeter.reporters
Class MailerModel
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.reporters.MailerModel
- All Implemented Interfaces:
- Serializable,- Cloneable,- Searchable,- org.apache.jmeter.testelement.TestElement
The model for a MailerVisualizer.
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(SampleResult sample) Adds a SampleResult for display in the Visualizer.voidadd(SampleResult sample, boolean sendMails) Adds a SampleResult.voidvoidclear()Resets the state of this object to its default.clone()Gets a List of String-objects.longlonggetLogin()longlongvoidvoidSends a mail with the given parameters using SMTP.voidsendMail(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.voidSend a Test Mail to check configurationvoidsetFailureLimit(String limit) voidsetFailureSubject(String str) voidsetFromAddress(String str) voidvoidsetMailAuthType(String value) voidsetPassword(String password) voidsetSmtpHost(String str) voidsetSmtpPort(String value) voidsetSuccessLimit(String limit) voidsetSuccessSubject(String str) voidsetToAddress(String str) toString()Returns a String-representation of this object.Methods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, 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, traversePropertyMethods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementget, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getProps, getSchema, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
- 
Constructor Details- 
MailerModelpublic MailerModel()Constructs a MailerModel.
 
- 
- 
Method Details- 
addChangeListener
- 
clone- Specified by:
- clonein interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clonein class- AbstractTestElement
 
- 
notifyChangeListenerspublic void notifyChangeListeners()
- 
getAddressListGets a List of String-objects. Each String is one mail-address of the addresses-String set bysetToAddress(str). The addresses must be separated by commas. Only String-objects containing a "@" are added to the returned List.- Returns:
- a List of String-objects wherein each String represents a mail-address.
 
- 
addAdds a SampleResult for display in the Visualizer.- Parameters:
- sample- the SampleResult encapsulating information about the last sample.
 
- 
addAdds a SampleResult. If SampleResult represents a change concerning the failure/success of the sampling a message might be sent to the addressies according to the settings ofsuccessCountandfailureCount.- Parameters:
- sample- the SampleResult encapsulating information about the last sample.
- sendMails- whether or not to send e-mails
 
- 
clearpublic void clear()Resets the state of this object to its default. But: This method does not reset any mail-specific attributes (like sender, mail-subject...) since they are independent of the sampling.- Specified by:
- clearin interface- org.apache.jmeter.testelement.TestElement
- Overrides:
- clearin class- AbstractTestElement
 
- 
toStringReturns a String-representation of this object. Returns always "E-Mail-Notification". Might be enhanced in future versions to return some kind of String-representation of the mail-parameters (like sender, addressies, smtpHost...).
- 
sendMailpublic void sendMail(String from, List<String> vEmails, String subject, String attText, String smtpHost) throws javax.mail.MessagingException Sends a mail with the given parameters using SMTP.- Parameters:
- 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.
- Throws:
- javax.mail.MessagingException- if the building of the message fails
- javax.mail.internet.AddressException- if any of the addresses is wrong
 
- 
sendMailpublic 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 Sends a mail with the given parameters using SMTP.- Parameters:
- 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 authenticate
- password- the password used to authenticate
- mailAuthType-- MailerModel.MailAuthTypeSecurity policy
- debug- Flag whether debug messages for the mail session should be generated
- Throws:
- javax.mail.internet.AddressException- If mail address is wrong
- javax.mail.MessagingException- If building MimeMessage fails
 
- 
sendTestMailpublic void sendTestMail() throws javax.mail.MessagingExceptionSend a Test Mail to check configuration- Throws:
- javax.mail.internet.AddressException- If mail address is wrong
- javax.mail.MessagingException- If building MimeMessage fails
 
- 
setToAddress
- 
setFromAddress
- 
setSmtpHost
- 
setSmtpPort
- 
setLogin
- 
setPassword
- 
setMailAuthType
- 
setFailureSubject
- 
setSuccessSubject
- 
setSuccessLimit
- 
setFailureLimit
- 
getToAddress
- 
getFromAddress
- 
getSmtpHost
- 
getSmtpPort
- 
getFailureSubject
- 
getSuccessSubject
- 
getSuccessLimitpublic long getSuccessLimit()
- 
getSuccessCountpublic long getSuccessCount()
- 
getFailureLimitpublic long getFailureLimit()
- 
getFailureCountpublic long getFailureCount()
- 
getLogin
- 
getPassword
- 
getMailAuthType
 
-