Class DefaultSamplerCreator
- java.lang.Object
-
- org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator
-
- org.apache.jmeter.protocol.http.proxy.DefaultSamplerCreator
-
- All Implemented Interfaces:
SamplerCreator
public class DefaultSamplerCreator extends AbstractSamplerCreator
Default implementation that handles classical HTTP textual + Multipart requests
-
-
Field Summary
-
Fields inherited from class org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator
HTTP, HTTPS
-
-
Constructor Summary
Constructors Constructor Description DefaultSamplerCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcomputeContentEncoding(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings, String urlWithoutQuery)Computes content encoding from request and if not found uses pageEncoding and formEncoding to see if URL was previously computed with a content typeprotected voidcomputeContentEncoding(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)Compute content encodingprotected voidcomputeDomain(HTTPSamplerBase sampler, HttpRequestHdr request)Set domain on samplerprotected voidcomputeFromHeader(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)Compute sampler informations from Request Headerprotected voidcomputeFromPostBody(HTTPSamplerBase sampler, HttpRequestHdr request)Compute sampler informations from Request Headerprotected voidcomputeMethod(HTTPSamplerBase sampler, HttpRequestHdr request)Set method on samplerprotected voidcomputePath(HTTPSamplerBase sampler, HttpRequestHdr request)Set path on samplerprotected voidcomputePort(HTTPSamplerBase sampler, HttpRequestHdr request)Set Port on samplerprotected voidcomputeProtocol(HTTPSamplerBase sampler, HttpRequestHdr request)Set protocol on samplerprotected voidcomputeSamplerName(HTTPSamplerBase sampler, HttpRequestHdr request)Compute sampler nameHTTPSamplerBasecreateSampler(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)Create HTTPSamplerBaseString[]getManagedContentTypes()voidpopulateSampler(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)Populate sampler from request-
Methods inherited from class org.apache.jmeter.protocol.http.proxy.AbstractSamplerCreator
createAndPopulateSampler, createChildren, getBinaryDirectory, getBinaryFileSuffix, getRequestNumber, incrementRequestNumber, isBinaryContent, isNumberRequests, postProcessSampler
-
-
-
-
Method Detail
-
getManagedContentTypes
public String[] getManagedContentTypes()
- Returns:
- String[] array of Content types managed by Factory
- See Also:
SamplerCreator.getManagedContentTypes()
-
createSampler
public HTTPSamplerBase createSampler(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings)
Description copied from interface:SamplerCreatorCreate HTTPSamplerBase- Parameters:
request-HttpRequestHdrpageEncodings- Map of page encodingsformEncodings- Map of form encodings- Returns:
HTTPSamplerBase- See Also:
SamplerCreator.createSampler(org.apache.jmeter.protocol.http.proxy.HttpRequestHdr, java.util.Map, java.util.Map)
-
populateSampler
public final void populateSampler(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws Exception
Description copied from interface:SamplerCreatorPopulate sampler from request- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdrpageEncodings- Map of page encodingsformEncodings- Map of form encodings- Throws:
Exception- when something fails- See Also:
SamplerCreator.populateSampler(org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase, org.apache.jmeter.protocol.http.proxy.HttpRequestHdr, java.util.Map, java.util.Map)
-
computeFromHeader
protected void computeFromHeader(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws Exception
Compute sampler informations from Request Header- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdrpageEncodings- Map of page encodingsformEncodings- Map of form encodings- Throws:
Exception- when something fails
-
computeFromPostBody
protected void computeFromPostBody(HTTPSamplerBase sampler, HttpRequestHdr request) throws Exception
Compute sampler informations from Request Header- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr- Throws:
Exception- when something fails
-
computeSamplerName
protected void computeSamplerName(HTTPSamplerBase sampler, HttpRequestHdr request)
Compute sampler name- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr
-
computePath
protected void computePath(HTTPSamplerBase sampler, HttpRequestHdr request)
Set path on sampler- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr
-
computeContentEncoding
protected void computeContentEncoding(HTTPSamplerBase sampler, HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings) throws MalformedURLException
Compute content encoding- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdrpageEncodings- Map of page encodingsformEncodings- Map of form encodings- Throws:
MalformedURLException- when noURLcould be built fromsamplerandrequest
-
computeContentEncoding
protected String computeContentEncoding(HttpRequestHdr request, Map<String,String> pageEncodings, Map<String,String> formEncodings, String urlWithoutQuery)
Computes content encoding from request and if not found uses pageEncoding and formEncoding to see if URL was previously computed with a content type- Parameters:
request-HttpRequestHdrpageEncodings- Map of page encodingsformEncodings- Map of form encodingsurlWithoutQuery- the request URL without the query parameters- Returns:
- String content encoding
-
computeProtocol
protected void computeProtocol(HTTPSamplerBase sampler, HttpRequestHdr request)
Set protocol on sampler- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr
-
computePort
protected void computePort(HTTPSamplerBase sampler, HttpRequestHdr request)
Set Port on sampler- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr
-
computeMethod
protected void computeMethod(HTTPSamplerBase sampler, HttpRequestHdr request)
Set method on sampler- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr
-
computeDomain
protected void computeDomain(HTTPSamplerBase sampler, HttpRequestHdr request)
Set domain on sampler- Parameters:
sampler-HTTPSamplerBaserequest-HttpRequestHdr
-
-