org.apache.jmeter.reporters

## Class MailerModel

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.reporters.MailerModel

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, Searchable, TestElement

      public class MailerModel
      extends AbstractTestElement
      implements java.io.Serializable

  The model for a MailerVisualizer.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MailerModel.MailAuthType`

  - ### Field Summary

    - ### Fields inherited from interface org.apache.jmeter.testelement.TestElement

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MailerModel()` Constructs a MailerModel.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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(javax.swing.event.ChangeListener list)`
    `void` | `clear()` Resets the state of this object to its default.
    `java.lang.Object` | `clone()`
    `java.util.List<java.lang.String>` | `getAddressList()` Gets a List of String-objects.
    `long` | `getFailureCount()`
    `long` | `getFailureLimit()`
    `java.lang.String` | `getFailureSubject()`
    `java.lang.String` | `getFromAddress()`
    `java.lang.String` | `getLogin()`
    `MailerModel.MailAuthType` | `getMailAuthType()`
    `java.lang.String` | `getPassword()`
    `java.lang.String` | `getSmtpHost()`
    `java.lang.String` | `getSmtpPort()`
    `long` | `getSuccessCount()`
    `long` | `getSuccessLimit()`
    `java.lang.String` | `getSuccessSubject()`
    `java.lang.String` | `getToAddress()`
    `void` | `notifyChangeListeners()`
    `void` | `sendMail(java.lang.String from, java.util.List<java.lang.String> vEmails, java.lang.String subject, java.lang.String attText, java.lang.String smtpHost)` Sends a mail with the given parameters using SMTP.
    `void` | `sendMail(java.lang.String from, java.util.List<java.lang.String> vEmails, java.lang.String subject, java.lang.String attText, java.lang.String smtpHost, java.lang.String smtpPort, java.lang.String user, java.lang.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(java.lang.String limit)`
    `void` | `setFailureSubject(java.lang.String str)`
    `void` | `setFromAddress(java.lang.String str)`
    `void` | `setLogin(java.lang.String login)`
    `void` | `setMailAuthType(java.lang.String value)`
    `void` | `setPassword(java.lang.String password)`
    `void` | `setSmtpHost(java.lang.String str)`
    `void` | `setSmtpPort(java.lang.String value)`
    `void` | `setSuccessLimit(java.lang.String limit)`
    `void` | `setSuccessSubject(java.lang.String str)`
    `void` | `setToAddress(java.lang.String str)`
    `java.lang.String` | `toString()` Returns a String-representation of this object.

    - ### Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

      `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`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.TestElement

      `removed`

- - ### Constructor Detail

    - #### MailerModel

          public MailerModel()

      Constructs a MailerModel.

  - ### Method Detail

    - #### addChangeListener

          public void addChangeListener(javax.swing.event.ChangeListener list)

    - #### clone

          public java.lang.Object clone()

      Specified by:
        `clone` in interface `TestElement`
      Overrides:
        `clone` in class `AbstractTestElement`

    - #### notifyChangeListeners

          public void notifyChangeListeners()

    - #### getAddressList

          public java.util.List<java.lang.String> getAddressList()

      Gets a List of String-objects. Each String is one mail-address of the addresses-String set by `setToAddress(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.

    - #### add

          public void add(SampleResult sample)

      Adds a SampleResult for display in the Visualizer.
      Parameters:
        `sample` - the SampleResult encapsulating information about the last sample.

    - #### add

          public void add(SampleResult sample,
                          boolean sendMails)

      Adds 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 of `successCount` and `failureCount`.
      Parameters:
        `sample` - the SampleResult encapsulating information about the last sample.
        `sendMails` - whether or not to send e-mails

    - #### clear

          public 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:
        `clear` in interface `TestElement`
      Overrides:
        `clear` in class `AbstractTestElement`

    - #### toString

          public java.lang.String toString()

      Returns 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...).
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A String-representation of this object.

    - #### sendMail

          public void sendMail(java.lang.String from,
                               java.util.List<java.lang.String> vEmails,
                               java.lang.String subject,
                               java.lang.String attText,
                               java.lang.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

    - #### sendMail

          public void sendMail(java.lang.String from,
                               java.util.List<java.lang.String> vEmails,
                               java.lang.String subject,
                               java.lang.String attText,
                               java.lang.String smtpHost,
                               java.lang.String smtpPort,
                               java.lang.String user,
                               java.lang.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.MailAuthType` Security 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

    - #### sendTestMail

          public void sendTestMail()
                            throws javax.mail.MessagingException

      Send a Test Mail to check configuration
      Throws:
        `javax.mail.internet.AddressException` - If mail address is wrong
        `javax.mail.MessagingException` - If building MimeMessage fails

    - #### setToAddress

          public void setToAddress(java.lang.String str)

    - #### setFromAddress

          public void setFromAddress(java.lang.String str)

    - #### setSmtpHost

          public void setSmtpHost(java.lang.String str)

    - #### setSmtpPort

          public void setSmtpPort(java.lang.String value)

    - #### setLogin

          public void setLogin(java.lang.String login)

    - #### setPassword

          public void setPassword(java.lang.String password)

    - #### setMailAuthType

          public void setMailAuthType(java.lang.String value)

    - #### setFailureSubject

          public void setFailureSubject(java.lang.String str)

    - #### setSuccessSubject

          public void setSuccessSubject(java.lang.String str)

    - #### setSuccessLimit

          public void setSuccessLimit(java.lang.String limit)

    - #### setFailureLimit

          public void setFailureLimit(java.lang.String limit)

    - #### getToAddress

          public java.lang.String getToAddress()

    - #### getFromAddress

          public java.lang.String getFromAddress()

    - #### getSmtpHost

          public java.lang.String getSmtpHost()

    - #### getSmtpPort

          public java.lang.String getSmtpPort()

    - #### getFailureSubject

          public java.lang.String getFailureSubject()

    - #### getSuccessSubject

          public java.lang.String getSuccessSubject()

    - #### getSuccessLimit

          public long getSuccessLimit()

    - #### getSuccessCount

          public long getSuccessCount()

    - #### getFailureLimit

          public long getFailureLimit()

    - #### getFailureCount

          public long getFailureCount()

    - #### getLogin

          public java.lang.String getLogin()

    - #### getPassword

          public java.lang.String getPassword()

    - #### getMailAuthType

          public MailerModel.MailAuthType getMailAuthType()

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.