public abstract class HTTPAbstractImpl extends java.lang.Object implements Interruptible, HTTPConstantsInterface
Modifier and Type | Field and Description |
---|---|
protected static boolean |
ADD_CONTENT_TYPE_TO_POST_IF_MISSING
Should we add to POST request content-type header if missing:
Content-Type: application/x-www-form-urlencoded
|
protected static java.util.function.Predicate<java.lang.String> |
ALL_EXCEPT_COOKIE |
protected static java.util.function.Predicate<java.lang.String> |
ONLY_COOKIE |
protected HTTPSamplerBase |
testElement |
APPLICATION_X_WWW_FORM_URLENCODED, CACHE_CONTROL, CONNECT, CONNECTION_CLOSE, COPY, DATE, DEFAULT_HTTP_PORT, DEFAULT_HTTP_PORT_STRING, DEFAULT_HTTPS_PORT, DEFAULT_HTTPS_PORT_STRING, DELETE, ENCODING_BROTLI, ENCODING_DEFLATE, ENCODING_GZIP, ETAG, EXPIRES, GET, HEAD, HEADER_AUTHORIZATION, HEADER_CONNECTION, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, HEADER_COOKIE_IN_REQUEST, HEADER_HOST, HEADER_LOCAL_ADDRESS, HEADER_LOCATION, HEADER_SET_COOKIE, HTTP_1_1, IF_MODIFIED_SINCE, IF_NONE_MATCH, KEEP_ALIVE, LAST_MODIFIED, LOCK, MKCALENDAR, MKCOL, MOVE, MULTIPART_FORM_DATA, OPTIONS, PATCH, POST, PROPFIND, PROPPATCH, PROTOCOL_HTTP, PROTOCOL_HTTPS, PUT, REPORT, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_SEE_OTHER, SC_TEMPORARY_REDIRECT, SEARCH, TRACE, TRANSFER_ENCODING, UNLOCK, VARY
Modifier | Constructor and Description |
---|---|
protected |
HTTPAbstractImpl(HTTPSamplerBase testElement) |
Modifier and Type | Method and Description |
---|---|
protected HTTPSampleResult |
errorResult(java.lang.Throwable t,
HTTPSampleResult res)
Populates the provided HTTPSampleResult with details from the Exception.
|
protected Arguments |
getArguments()
Invokes
HTTPSamplerBase.getArguments() |
protected AuthManager |
getAuthManager()
Invokes
HTTPSamplerBase.getAuthManager() |
protected boolean |
getAutoRedirects()
|
protected CacheManager |
getCacheManager()
|
protected int |
getConnectTimeout()
|
protected java.lang.String |
getContentEncoding()
|
protected CookieManager |
getCookieManager()
|
protected boolean |
getDoBrowserCompatibleMultipart()
|
protected HeaderManager |
getHeaderManager()
|
protected HTTPFileArg[] |
getHTTPFiles()
Get the collection of files as a list.
|
protected java.lang.String |
getIpSource()
Invokes
HTTPSamplerBase.getIpSource() |
protected java.net.InetAddress |
getIpSourceAddress()
Gets the IP source address (IP spoofing) if one has been provided.
|
protected java.lang.String |
getProxyHost()
Invokes
HTTPSamplerBase.getProxyHost() |
protected java.lang.String |
getProxyPass()
Invokes
HTTPSamplerBase.getProxyPass() |
protected int |
getProxyPortInt()
|
protected java.lang.String |
getProxyScheme()
Invokes
HTTPSamplerBase.getProxyScheme() |
protected java.lang.String |
getProxyUser()
Invokes
HTTPSamplerBase.getProxyUser() |
protected int |
getResponseTimeout()
|
protected boolean |
getSendFileAsPostBody()
Determine whether to send a file as the entire body of an
entity enclosing request such as POST, PUT or PATCH.
|
protected boolean |
getSendParameterValuesAsPostBody()
Determine whether to send concatenated parameters as the entire body of an
entity enclosing request such as POST, PUT or PATCH.
|
protected boolean |
getUseKeepAlive()
|
protected boolean |
getUseMultipart()
Determine if we should use
multipart/form-data or
application/x-www-form-urlencoded for the method
Invokes HTTPSamplerBase.getUseMultipart() |
protected boolean |
getUseMultipartForPost()
Deprecated.
|
protected boolean |
hasArguments()
Invokes
HTTPSamplerBase.hasArguments() |
protected boolean |
isMonitor()
Deprecated.
since 3.2 always return false
|
protected boolean |
isSuccessCode(int errorLevel)
Determine if the HTTP status code is successful or not i.e. in range 200
to 399 inclusive
Invokes
HTTPSamplerBase.isSuccessCode(int) |
protected void |
notifyFirstSampleAfterLoopRestart() |
protected void |
notifySSLContextWasReset()
Deprecated.
** unused since r1489189. **
|
protected byte[] |
readResponse(SampleResult res,
java.io.BufferedInputStream in,
int contentLength)
Deprecated.
|
protected byte[] |
readResponse(SampleResult res,
java.io.BufferedInputStream in,
long contentLength)
Read response from the input stream, converting to MD5 digest if the
useMD5 property is set.
|
protected byte[] |
readResponse(SampleResult res,
java.io.InputStream instream,
int responseContentLength)
Read response from the input stream, converting to MD5 digest if the
useMD5 property is set.
|
protected byte[] |
readResponse(SampleResult res,
java.io.InputStream instream,
long responseContentLength)
Read response from the input stream, converting to MD5 digest if the
useMD5 property is set.
|
protected HTTPSampleResult |
resultProcessing(boolean areFollowingRedirect,
int frameDepth,
HTTPSampleResult res)
Follow redirects and download page resources if appropriate. this works,
but the container stuff here is what's doing it. followRedirects() is
actually doing the work to make sure we have only one container to make
this work more naturally, I think this method - sample() - needs to take
an HTTPSamplerResult container parameter instead of a
boolean:areFollowingRedirect.
|
protected abstract HTTPSampleResult |
sample(java.net.URL url,
java.lang.String method,
boolean areFollowingRedirect,
int frameDepth) |
protected void |
setUseKeepAlive(boolean b)
|
protected void |
threadFinished() |
protected HTTPSampleResult |
updateSampleResultForResourceInCache(HTTPSampleResult res)
Update HTTPSampleResult for a resource in cache
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
interrupt
protected static final boolean ADD_CONTENT_TYPE_TO_POST_IF_MISSING
protected static final java.util.function.Predicate<java.lang.String> ALL_EXCEPT_COOKIE
protected static final java.util.function.Predicate<java.lang.String> ONLY_COOKIE
protected final HTTPSamplerBase testElement
protected HTTPAbstractImpl(HTTPSamplerBase testElement)
protected abstract HTTPSampleResult sample(java.net.URL url, java.lang.String method, boolean areFollowingRedirect, int frameDepth)
protected void threadFinished()
protected void notifyFirstSampleAfterLoopRestart()
protected HTTPSampleResult errorResult(java.lang.Throwable t, HTTPSampleResult res)
See HTTPSamplerBase.errorResult(Throwable, HTTPSampleResult)
t
- Exception representing the error.res
- SampleResult to be modifiedprotected Arguments getArguments()
HTTPSamplerBase.getArguments()
protected AuthManager getAuthManager()
HTTPSamplerBase.getAuthManager()
AuthManager
of the associated test elementprotected boolean getAutoRedirects()
protected CacheManager getCacheManager()
CacheManager
of the associated test elementprotected int getConnectTimeout()
protected java.lang.String getContentEncoding()
protected CookieManager getCookieManager()
CookieManager
of the associated test elementprotected HeaderManager getHeaderManager()
HeaderManager
of the associated test elementprotected HTTPFileArg[] getHTTPFiles()
If there are no valid file entries, then an empty list is returned.
Invokes HTTPSamplerBase.getHTTPFiles()
null
)protected java.lang.String getIpSource()
HTTPSamplerBase.getIpSource()
protected java.net.InetAddress getIpSourceAddress() throws java.net.UnknownHostException, java.net.SocketException
null
, if none provided or the device address could not be found)java.net.UnknownHostException
- if the hostname/ip for getIpSource()
could not be resolved or not interface was found for itjava.net.SocketException
- if an I/O error occursprotected java.lang.String getProxyScheme()
HTTPSamplerBase.getProxyScheme()
protected java.lang.String getProxyHost()
HTTPSamplerBase.getProxyHost()
protected java.lang.String getProxyPass()
HTTPSamplerBase.getProxyPass()
protected int getProxyPortInt()
protected java.lang.String getProxyUser()
HTTPSamplerBase.getProxyUser()
protected int getResponseTimeout()
protected boolean getSendFileAsPostBody()
HTTPSamplerBase.getSendFileAsPostBody()
protected boolean getSendParameterValuesAsPostBody()
HTTPSamplerBase.getSendParameterValuesAsPostBody()
protected boolean getUseKeepAlive()
@Deprecated protected boolean getUseMultipartForPost()
getUseMultipart()
multipart/form-data
or
application/x-www-form-urlencoded
for the post
true
if multipart/form-data
should be
used and method is POSTprotected boolean getUseMultipart()
multipart/form-data
or
application/x-www-form-urlencoded
for the method
true
if multipart/form-data
should be usedprotected boolean getDoBrowserCompatibleMultipart()
protected boolean hasArguments()
HTTPSamplerBase.hasArguments()
@Deprecated protected boolean isMonitor()
HTTPSamplerBase.isMonitor()
protected boolean isSuccessCode(int errorLevel)
errorLevel
- status code to checkprotected byte[] readResponse(SampleResult res, java.io.InputStream instream, int responseContentLength) throws java.io.IOException
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes
HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoinstream
- input stream from which to read the responseresponseContentLength
- expected input length or zerojava.io.IOException
- if reading the result failsprotected byte[] readResponse(SampleResult res, java.io.InputStream instream, long responseContentLength) throws java.io.IOException
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes
HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoinstream
- input stream from which to read the responseresponseContentLength
- expected input length or zerojava.io.IOException
- if reading the result fails@Deprecated protected byte[] readResponse(SampleResult res, java.io.BufferedInputStream in, int contentLength) throws java.io.IOException
readResponse(SampleResult, BufferedInputStream, long)
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoin
- input stream from which to read the responsecontentLength
- expected input length or zerojava.io.IOException
- when reading the result failsprotected byte[] readResponse(SampleResult res, java.io.BufferedInputStream in, long contentLength) throws java.io.IOException
For the MD5 case, the result byte count is set to the size of the original response.
Closes the inputStream
Invokes HTTPSamplerBase.readResponse(SampleResult, InputStream, long)
res
- sample to store information about the response intoin
- input stream from which to read the responsecontentLength
- expected input length or zerojava.io.IOException
- when reading the result failsprotected HTTPSampleResult resultProcessing(boolean areFollowingRedirect, int frameDepth, HTTPSampleResult res)
Invokes
HTTPSamplerBase.resultProcessing(boolean, int, HTTPSampleResult)
areFollowingRedirect
- flag whether we are getting a redirect targetframeDepth
- Depth of this target in the frame structure. Used only to
prevent infinite recursion.res
- sample result to processprotected void setUseKeepAlive(boolean b)
b
- flag whether to use keep-alive for requests@Deprecated protected void notifySSLContextWasReset()
protected HTTPSampleResult updateSampleResultForResourceInCache(HTTPSampleResult res)
res
- HTTPSampleResult
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.