org.apache.jmeter.protocol.http.proxy

## Class AbstractSamplerCreator

- java.lang.Object
- - org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator

- All Implemented Interfaces:
    SamplerCreator
  Direct Known Subclasses:
    DefaultSamplerCreator

      public abstract class AbstractSamplerCreator
      extends java.lang.Object
      implements SamplerCreator

  Base class for SamplerCreator

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `HTTP`
    `protected static java.lang.String` | `HTTPS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractSamplerCreator()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HTTPSamplerBase` | `createAndPopulateSampler(HttpRequestHdr request, java.util.Map<java.lang.String,java.lang.String> pageEncodings, java.util.Map<java.lang.String,java.lang.String> formEncodings)` Default implementation calls: `SamplerCreator` `SamplerCreator.createSampler(HttpRequestHdr, Map, Map)` `SamplerCreator` `SamplerCreator.populateSampler(HTTPSamplerBase, HttpRequestHdr, Map, Map)`
    `java.util.List<TestElement>` | `createChildren(HTTPSamplerBase sampler, SampleResult result)` Default implementation returns an empty list
    `protected java.lang.String` | `getBinaryDirectory()`
    `protected java.lang.String` | `getBinaryFileSuffix()`
    `protected static int` | `getRequestNumber()`
    `protected static void` | `incrementRequestNumber()` Increment request number
    `protected static int` | `incrementRequestNumberAndGet()` Increment request number
    `protected boolean` | `isBinaryContent(java.lang.String contentType)`
    `protected static boolean` | `isNumberRequests()`
    `void` | `postProcessSampler(HTTPSamplerBase sampler, SampleResult result)` Post process sampler Called after sampling

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

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

    - ### Methods inherited from interface org.apache.jmeter.protocol.http.proxy.SamplerCreator

      `createSampler, getManagedContentTypes, populateSampler`

- - ### Field Detail

    - #### HTTP

          protected static final java.lang.String HTTP

      See Also:
        Constant Field Values

    - #### HTTPS

          protected static final java.lang.String HTTPS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### AbstractSamplerCreator

          public AbstractSamplerCreator()

  - ### Method Detail

    - #### getRequestNumber

          protected static int getRequestNumber()

      Returns:
        int request number

    - #### incrementRequestNumber

          protected static void incrementRequestNumber()

      Increment request number

    - #### incrementRequestNumberAndGet

          protected static int incrementRequestNumberAndGet()

      Increment request number
      Returns:
        int number for created sampler

    - #### isNumberRequests

          protected static boolean isNumberRequests()

      Returns:
        boolean is numbering requests is required

    - #### isBinaryContent

          protected boolean isBinaryContent(java.lang.String contentType)

      Parameters:
        `contentType` - String content type
      Returns:
        true if contentType is part of binary declared types

    - #### getBinaryFileSuffix

          protected java.lang.String getBinaryFileSuffix()

      Returns:
        String binary file suffix

    - #### getBinaryDirectory

          protected java.lang.String getBinaryDirectory()

      Returns:
        String binary directory

    - #### postProcessSampler

          public void postProcessSampler(HTTPSamplerBase sampler,
                                         SampleResult result)

      Description copied from interface: `SamplerCreator`
      Post process sampler Called after sampling
      Specified by:
        `postProcessSampler` in interface `SamplerCreator`
      Parameters:
        `sampler` - HTTPSamplerBase
        `result` - SampleResult
      See Also:
        `SamplerCreator.postProcessSampler(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase, org.apache.jmeter.samplers.SampleResult)`

    - #### createAndPopulateSampler

          public HTTPSamplerBase createAndPopulateSampler(HttpRequestHdr request,
                                                          java.util.Map<java.lang.String,java.lang.String> pageEncodings,
                                                          java.util.Map<java.lang.String,java.lang.String> formEncodings)
                                                   throws java.lang.Exception

      Description copied from interface: `SamplerCreator`
      Default implementation calls:
      1. `SamplerCreator` `SamplerCreator.createSampler(HttpRequestHdr, Map, Map)`
      2. `SamplerCreator` `SamplerCreator.populateSampler(HTTPSamplerBase, HttpRequestHdr, Map, Map)`
      Specified by:
        `createAndPopulateSampler` in interface `SamplerCreator`
      Parameters:
        `request` - `HttpRequestHdr`
        `pageEncodings` - Map of page encodings
        `formEncodings` - Map of form encodings
      Returns:
        `HTTPSamplerBase`
      Throws:
        `java.lang.Exception` - when something fails
      See Also:
        `SamplerCreator.createAndPopulateSampler(org.apache.jmeter.protocol.http.proxy.HttpRequestHdr, java.util.Map, java.util.Map)`

    - #### createChildren

          public java.util.List<TestElement> createChildren(HTTPSamplerBase sampler,
                                                            SampleResult result)

      Default implementation returns an empty list
      Specified by:
        `createChildren` in interface `SamplerCreator`
      Parameters:
        `sampler` - `HTTPSamplerBase`
        `result` - `SampleResult`
      Returns:
        List
      See Also:
        `SamplerCreator.createChildren(HTTPSamplerBase, SampleResult)`

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