org.apache.jmeter.protocol.mail.sampler

## Class MailReaderSampler

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.samplers.AbstractSampler
    - - org.apache.jmeter.protocol.mail.sampler.MailReaderSampler

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

      public class MailReaderSampler
      extends AbstractSampler
      implements Interruptible

  Sampler that can read from POP3 and IMAP mail servers
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALL_MESSAGES`
    `static java.lang.String` | `DEFAULT_PROTOCOL`

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

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MailReaderSampler()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `applies(ConfigTestElement configElement)` Does configElement apply to Sampler
    `boolean` | `getDeleteMessages()`
    `java.lang.String` | `getFolder()`
    `boolean` | `getHeaderOnly()`
    `int` | `getNumMessages()`
    `java.lang.String` | `getNumMessagesString()`
    `java.lang.String` | `getPassword()`
    `java.lang.String` | `getPort()`
    `java.lang.String` | `getServer()`
    `java.lang.String` | `getServerType()` Returns the type of the protocol set to use when talking with the remote server.
    `java.lang.String` | `getTrustStoreToUse()`
    `java.lang.String` | `getUserName()`
    `boolean` | `interrupt()` Interrupt the current operation if possible.
    `boolean` | `isEnforceStartTLS()`
    `boolean` | `isStoreMimeMessage()`
    `boolean` | `isTrustAllCerts()`
    `boolean` | `isUseLocalTrustStore()`
    `boolean` | `isUseSSL()`
    `boolean` | `isUseStartTLS()`
    `SampleResult` | `sample(Entry e)` Obtains statistics about the given Entry, and packages the information into a SampleResult.
    `void` | `setDeleteMessages(boolean delete)`
    `void` | `setFolder(java.lang.String folder)`
    `void` | `setHeaderOnly(boolean selected)`
    `void` | `setNumMessages(int numMessages)`
    `void` | `setNumMessages(java.lang.String numMessages)`
    `void` | `setPassword(java.lang.String password)`
    `void` | `setPort(java.lang.String port)`
    `void` | `setServer(java.lang.String server)`
    `void` | `setServerType(java.lang.String serverType)` Sets the type of protocol to use when talking with the remote mail server.
    `void` | `setStoreMimeMessage(boolean storeMimeMessage)`
    `void` | `setUserName(java.lang.String username)`
    `java.lang.String` | `toString()`

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

      `addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, 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

      `addTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse`

- - ### Field Detail

    - #### DEFAULT_PROTOCOL

          public static final java.lang.String DEFAULT_PROTOCOL

      See Also:
        Constant Field Values

    - #### ALL_MESSAGES

          public static final int ALL_MESSAGES

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MailReaderSampler

          public MailReaderSampler()

  - ### Method Detail

    - #### isUseLocalTrustStore

          public boolean isUseLocalTrustStore()

    - #### getTrustStoreToUse

          public java.lang.String getTrustStoreToUse()

    - #### isUseSSL

          public boolean isUseSSL()

    - #### isUseStartTLS

          public boolean isUseStartTLS()

    - #### isTrustAllCerts

          public boolean isTrustAllCerts()

    - #### isEnforceStartTLS

          public boolean isEnforceStartTLS()

    - #### sample

          public SampleResult sample(Entry e)

      Obtains statistics about the given Entry, and packages the information into a SampleResult.
      Specified by:
        `sample` in interface `Sampler`
      Parameters:
        `e` - the Entry (TODO seems to be unused)
      Returns:
        information about the sample

    - #### setServerType

          public void setServerType(java.lang.String serverType)

      Sets the type of protocol to use when talking with the remote mail server. Either MailReaderSampler.TYPE_IMAP[S] or MailReaderSampler.TYPE_POP3[S]. Default is MailReaderSampler.TYPE_POP3.
      Parameters:
        `serverType` - protocol to use

    - #### getServerType

          public java.lang.String getServerType()

      Returns the type of the protocol set to use when talking with the remote server. Either MailReaderSampler.TYPE_IMAP[S] or MailReaderSampler.TYPE_POP3[S].
      Returns:
        Server Type

    - #### setServer

          public void setServer(java.lang.String server)

      Parameters:
        `server` - - The name or address of the remote server.

    - #### getServer

          public java.lang.String getServer()

      Returns:
        The name or address of the remote server.

    - #### getPort

          public java.lang.String getPort()

    - #### setPort

          public void setPort(java.lang.String port)

    - #### setUserName

          public void setUserName(java.lang.String username)

      Parameters:
        `username` - - The username of the mail account.

    - #### getUserName

          public java.lang.String getUserName()

      Returns:
        The username of the mail account.

    - #### setPassword

          public void setPassword(java.lang.String password)

      Parameters:
        `password` - the password to use

    - #### getPassword

          public java.lang.String getPassword()

      Returns:
        password

    - #### setFolder

          public void setFolder(java.lang.String folder)

      Parameters:
        `folder` - - Name of the folder to read emails from. "INBOX" is the only acceptable value if the server type is POP3.

    - #### getFolder

          public java.lang.String getFolder()

      Returns:
        folder

    - #### setNumMessages

          public void setNumMessages(int numMessages)

      Parameters:
        `numMessages` - - The number of messages to retrieve from the mail server. Set this value to -1 to retrieve all messages.

    - #### setNumMessages

          public void setNumMessages(java.lang.String numMessages)

      Parameters:
        `numMessages` - - The number of messages to retrieve from the mail server. Set this value to -1 to retrieve all messages.

    - #### getNumMessages

          public int getNumMessages()

      Returns:
        The number of messages to retrieve from the mail server. -1 denotes get all messages.

    - #### getNumMessagesString

          public java.lang.String getNumMessagesString()

      Returns:
        The number of messages to retrieve from the mail server. -1 denotes get all messages.

    - #### setDeleteMessages

          public void setDeleteMessages(boolean delete)

      Parameters:
        `delete` - - Whether or not to delete the read messages from the folder.

    - #### getDeleteMessages

          public boolean getDeleteMessages()

      Returns:
        Whether or not to delete the read messages from the folder.

    - #### isStoreMimeMessage

          public boolean isStoreMimeMessage()

      Returns:
        Whether or not to store the retrieved message as MIME message in the sample result

    - #### setStoreMimeMessage

          public void setStoreMimeMessage(boolean storeMimeMessage)

      Parameters:
        `storeMimeMessage` - Whether or not to store the retrieved message as MIME message in the sample result

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### interrupt

          public boolean interrupt()

      Interrupt the current operation if possible.
      Specified by:
        `interrupt` in interface `Interruptible`
      Returns:
        `true` if there was an operation to interrupt.

    - #### applies

          public boolean applies(ConfigTestElement configElement)

      Description copied from class: `AbstractSampler`
      Does configElement apply to Sampler
      Specified by:
        `applies` in interface `ConfigMergabilityIndicator`
      Overrides:
        `applies` in class `AbstractSampler`
      Parameters:
        `configElement` - `ConfigTestElement`
      Returns:
        boolean
      See Also:
        `AbstractSampler.applies(org.apache.jmeter.config.ConfigTestElement)`

    - #### getHeaderOnly

          public boolean getHeaderOnly()

    - #### setHeaderOnly

          public void setHeaderOnly(boolean selected)

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