Class MailerModel

  • All Implemented Interfaces:
    java.io.Serializable , java.lang.Cloneable , org.apache.jmeter.gui.Searchable , org.apache.jmeter.testelement.TestElement

    
    public class MailerModel
    extends AbstractTestElement implements Serializable
                        

    The model for a MailerVisualizer.

    • Constructor Detail

      • MailerModel

        MailerModel()
        Constructs a MailerModel.
    • Method Detail

      • getAddressList

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

         void add(SampleResult sample)

        Adds a SampleResult for display in the Visualizer.

        Parameters:
        sample - the SampleResult encapsulating information about the last sample.
      • add

         synchronized 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

         synchronized 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.

      • toString

         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...).

        Returns:

        A String-representation of this object.

      • sendMail

         void sendMail(String from, List<String> vEmails, String subject, String attText, String smtpHost)

        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.
        subject - the subject of the mail.
        attText - the message-body.
        smtpHost - the smtp-server used to send the mail.
      • sendMail

         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.

        Parameters:
        from - the sender of the mail as shown in the mail-client.
        vEmails - all receivers of the mail.
        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 - MailAuthType Security policy
        debug - Flag whether debug messages for the mail session should be generated
      • sendTestMail

         synchronized void sendTestMail()

        Send a Test Mail to check configuration