org.apache.jmeter.protocol.http.sampler

## Class HTTPSamplerFactory

- java.lang.Object
- - org.apache.jmeter.protocol.http.sampler.HTTPSamplerFactory

-     public final class HTTPSamplerFactory
      extends java.lang.Object

  Factory to return the appropriate HTTPSampler for use with classes that need an HTTPSampler; also creates the implementations for use with HTTPSamplerProxy.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DEFAULT_CLASSNAME`
    `static java.lang.String` | `HTTP_SAMPLER_APACHE` Use Apache HTTPClient HTTP implementation
    `static java.lang.String` | `HTTP_SAMPLER_JAVA` Use the default Java HTTP implementation
    `static java.lang.String` | `IMPL_HTTP_CLIENT3_1`
    `static java.lang.String` | `IMPL_HTTP_CLIENT4`
    `static java.lang.String` | `IMPL_JAVA`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static HTTPAbstractImpl` | `getImplementation(java.lang.String impl, HTTPSamplerBase base)`
    `static java.lang.String[]` | `getImplementations()`
    `static HTTPSamplerBase` | `newInstance()` Create a new instance of the default sampler
    `static HTTPSamplerBase` | `newInstance(java.lang.String alias)` Create a new instance of the required sampler type

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### HTTP_SAMPLER_JAVA

          public static final java.lang.String HTTP_SAMPLER_JAVA

      Use the default Java HTTP implementation
      See Also:
        Constant Field Values

    - #### HTTP_SAMPLER_APACHE

          public static final java.lang.String HTTP_SAMPLER_APACHE

      Use Apache HTTPClient HTTP implementation
      See Also:
        Constant Field Values

    - #### IMPL_HTTP_CLIENT4

          public static final java.lang.String IMPL_HTTP_CLIENT4

      See Also:
        Constant Field Values

    - #### IMPL_HTTP_CLIENT3_1

          public static final java.lang.String IMPL_HTTP_CLIENT3_1

      See Also:
        Constant Field Values

    - #### IMPL_JAVA

          public static final java.lang.String IMPL_JAVA

      See Also:
        Constant Field Values

    - #### DEFAULT_CLASSNAME

          public static final java.lang.String DEFAULT_CLASSNAME

  - ### Method Detail

    - #### newInstance

          public static HTTPSamplerBase newInstance()

      Create a new instance of the default sampler
      Returns:
        instance of default sampler

    - #### newInstance

          public static HTTPSamplerBase newInstance(java.lang.String alias)

      Create a new instance of the required sampler type
      Parameters:
        `alias` - HTTP_SAMPLER or HTTP_SAMPLER_APACHE or IMPL_HTTP_CLIENT3_1 or IMPL_HTTP_CLIENT4
      Returns:
        the appropriate sampler
      Throws:
        `java.lang.UnsupportedOperationException` - if alias is not recognised

    - #### getImplementations

          public static java.lang.String[] getImplementations()

    - #### getImplementation

          public static HTTPAbstractImpl getImplementation(java.lang.String impl,
                                                           HTTPSamplerBase base)

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