org.apache.jmeter.protocol.jms.sampler

## Class BaseJMSSampler

- java.lang.Object
- - org.apache.jmeter.testelement.AbstractTestElement
  - - org.apache.jmeter.samplers.AbstractSampler
    - - org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, ConfigMergabilityIndicator, Searchable, Sampler, TestElement
  Direct Known Subclasses:
    PublisherSampler, SubscriberSampler

      public abstract class BaseJMSSampler
      extends AbstractSampler

  BaseJMSSampler is an abstract class which provides implementation for common properties. Rather than duplicate the code, it's contained in the base class.
  See Also:
    Serialized Form

- - ### Field Summary

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

      `COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseJMSSampler()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `configureIsReconnectErrorCode()`
    `java.lang.String` | `getConnectionFactory()` return the connection factory parameter used to lookup the connection factory from the JMS server
    `java.lang.String` | `getDestination()` return the destination (topic or queue name)
    `java.util.function.Predicate<java.lang.String>` | `getIsReconnectErrorCode()`
    `int` | `getIterationCount()` get the number of samples to aggregate
    `java.lang.String` | `getIterations()` get the number of samples to aggregate
    `java.lang.String` | `getJNDIInitialContextFactory()` method returns the initial context factory for jndi initial context lookup.
    `static java.lang.String` | `getMessageHeaders(javax.jms.Message message)` Returns a String with the JMS Message Header values.
    `java.lang.String` | `getPassword()` return the password used to login to the jms server
    `java.lang.String` | `getProviderUrl()` method returns the provider url for jndi to connect to
    `java.lang.String` | `getReadResponse()` return whether the sampler should store the response
    `boolean` | `getReadResponseAsBoolean()` return whether the sampler should store the response
    `java.lang.String` | `getReconnectionErrorCodes()`
    `java.lang.String` | `getUseJNDIProperties()` return whether the sampler should use properties file instead of UI parameters.
    `boolean` | `getUseJNDIPropertiesAsBoolean()` return the properties as boolean true/false.
    `java.lang.String` | `getUsername()` return the username used to login to the jms server
    `boolean` | `isDestinationStatic()` return whether the sampler should use a static destination.
    `boolean` | `isUseAuth()` return whether jndi requires authentication
    `abstract SampleResult` | `sample()`
    `SampleResult` | `sample(Entry e)` Obtains statistics about the given Entry, and packages the information into a SampleResult.
    `void` | `setConnectionFactory(java.lang.String factory)` set the connection factory for
    `void` | `setDestination(java.lang.String dest)` set the destination (topic or queue name)
    `void` | `setDestinationStatic(boolean isStatic)` if the sampler should use a static destination, call the method with true
    `void` | `setIterations(java.lang.String count)` set the number of iterations the sampler should aggregate
    `void` | `setJNDIIntialContextFactory(java.lang.String icf)` set the initial context factory
    `void` | `setPassword(java.lang.String pwd)` Set the password to login to the jms server
    `void` | `setProviderUrl(java.lang.String url)` set the provider user for jndi
    `void` | `setReadResponse(java.lang.String read)` set whether the sampler should store the response or not
    `void` | `setReconnectionErrorCodes(java.lang.String reconnectionErrorCodes)`
    `void` | `setUseAuth(boolean useAuth)` Set whether authentication is required for JNDI
    `void` | `setUseJNDIProperties(java.lang.String properties)` if the sampler should use jndi.properties file, call the method with the string "true"
    `void` | `setUsername(java.lang.String user)` set the username to login into the jms server if needed

    - ### Methods inherited from class org.apache.jmeter.samplers.AbstractSampler

      `applies`

    - ### 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, toString, 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`

- - ### Constructor Detail

    - #### BaseJMSSampler

          public BaseJMSSampler()

  - ### Method Detail

    - #### sample

          public SampleResult sample(Entry e)

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

    - #### sample

          public abstract SampleResult sample()

    - #### setJNDIIntialContextFactory

          public void setJNDIIntialContextFactory(java.lang.String icf)

      set the initial context factory
      Parameters:
        `icf` - the initial context factory

    - #### getJNDIInitialContextFactory

          public java.lang.String getJNDIInitialContextFactory()

      method returns the initial context factory for jndi initial context lookup.
      Returns:
        the initial context factory

    - #### setProviderUrl

          public void setProviderUrl(java.lang.String url)

      set the provider user for jndi
      Parameters:
        `url` - the provider URL

    - #### getProviderUrl

          public java.lang.String getProviderUrl()

      method returns the provider url for jndi to connect to
      Returns:
        the provider URL

    - #### setConnectionFactory

          public void setConnectionFactory(java.lang.String factory)

      set the connection factory for
      Parameters:
        `factory` - the connection factory

    - #### getConnectionFactory

          public java.lang.String getConnectionFactory()

      return the connection factory parameter used to lookup the connection factory from the JMS server
      Returns:
        the connection factory

    - #### setDestination

          public void setDestination(java.lang.String dest)

      set the destination (topic or queue name)
      Parameters:
        `dest` - the destination

    - #### getDestination

          public java.lang.String getDestination()

      return the destination (topic or queue name)
      Returns:
        the destination

    - #### setUsername

          public void setUsername(java.lang.String user)

      set the username to login into the jms server if needed
      Parameters:
        `user` - the name of the user

    - #### getUsername

          public java.lang.String getUsername()

      return the username used to login to the jms server
      Returns:
        the username used to login to the jms server

    - #### setPassword

          public void setPassword(java.lang.String pwd)

      Set the password to login to the jms server
      Parameters:
        `pwd` - the password to use for login on the jms server

    - #### getPassword

          public java.lang.String getPassword()

      return the password used to login to the jms server
      Returns:
        the password used to login to the jms server

    - #### setIterations

          public void setIterations(java.lang.String count)

      set the number of iterations the sampler should aggregate
      Parameters:
        `count` - the number of iterations

    - #### getIterations

          public java.lang.String getIterations()

      get the number of samples to aggregate
      Returns:
        String containing the number of samples to aggregate

    - #### getIterationCount

          public int getIterationCount()

      get the number of samples to aggregate
      Returns:
        int containing the number of samples to aggregate

    - #### setUseAuth

          public void setUseAuth(boolean useAuth)

      Set whether authentication is required for JNDI
      Parameters:
        `useAuth` - flag whether to use authentication

    - #### isUseAuth

          public boolean isUseAuth()

      return whether jndi requires authentication
      Returns:
        whether jndi requires authentication

    - #### setReadResponse

          public void setReadResponse(java.lang.String read)

      set whether the sampler should store the response or not
      Parameters:
        `read` - whether the sampler should store the response or not

    - #### getReadResponse

          public java.lang.String getReadResponse()

      return whether the sampler should store the response
      Returns:
        whether the sampler should store the response

    - #### getReadResponseAsBoolean

          public boolean getReadResponseAsBoolean()

      return whether the sampler should store the response
      Returns:
        boolean: whether the sampler should read the response

    - #### setUseJNDIProperties

          public void setUseJNDIProperties(java.lang.String properties)

      if the sampler should use jndi.properties file, call the method with the string "true"
      Parameters:
        `properties` - flag whether to use jndi.properties file

    - #### getUseJNDIProperties

          public java.lang.String getUseJNDIProperties()

      return whether the sampler should use properties file instead of UI parameters.
      Returns:
        the string "true" when the sampler should use properties file instead of UI parameters, the string "false" otherwise.

    - #### getUseJNDIPropertiesAsBoolean

          public boolean getUseJNDIPropertiesAsBoolean()

      return the properties as boolean true/false.
      Returns:
        whether the sampler should use properties file instead of UI parameters.

    - #### setDestinationStatic

          public void setDestinationStatic(boolean isStatic)

      if the sampler should use a static destination, call the method with true
      Parameters:
        `isStatic` - flag whether the destination is a static destination

    - #### isDestinationStatic

          public boolean isDestinationStatic()

      return whether the sampler should use a static destination.
      Returns:
        whether the sampler should use a static destination.

    - #### getMessageHeaders

          public static java.lang.String getMessageHeaders(javax.jms.Message message)

      Returns a String with the JMS Message Header values.
      Parameters:
        `message` - JMS Message
      Returns:
        String with message header values.

    - #### getReconnectionErrorCodes

          public java.lang.String getReconnectionErrorCodes()

    - #### setReconnectionErrorCodes

          public void setReconnectionErrorCodes(java.lang.String reconnectionErrorCodes)

    - #### getIsReconnectErrorCode

          public java.util.function.Predicate<java.lang.String> getIsReconnectErrorCode()

    - #### configureIsReconnectErrorCode

          protected void configureIsReconnectErrorCode()

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