|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.protocol.http.sampler.HTTPAbstractImpl
public abstract class HTTPAbstractImpl
Base class for HTTP implementations used by the HTTPSamplerProxy sampler.
Field Summary | |
---|---|
protected HTTPSamplerBase |
testElement
|
Fields inherited from interface org.apache.jmeter.protocol.http.util.HTTPConstantsInterface |
---|
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_GZIP, ETAG, EXPIRES, GET, HEAD, HEADER_AUTHORIZATION, HEADER_CONNECTION, HEADER_CONTENT_DISPOSITION, HEADER_CONTENT_ENCODING, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_COOKIE, 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, TRACE, TRANSFER_ENCODING, UNLOCK |
Constructor Summary | |
---|---|
protected |
HTTPAbstractImpl(HTTPSamplerBase testElement)
|
Method Summary | |
---|---|
protected HTTPSampleResult |
errorResult(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()
Invokes HTTPSamplerBase.getAutoRedirects() |
protected CacheManager |
getCacheManager()
Invokes HTTPSamplerBase.getCacheManager() |
protected int |
getConnectTimeout()
Invokes HTTPSamplerBase.getConnectTimeout() |
protected String |
getContentEncoding()
Invokes HTTPSamplerBase.getContentEncoding() |
protected CookieManager |
getCookieManager()
Invokes HTTPSamplerBase.getCookieManager() |
protected boolean |
getDoBrowserCompatibleMultipart()
Invokes HTTPSamplerBase.getDoBrowserCompatibleMultipart() |
protected HeaderManager |
getHeaderManager()
Invokes HTTPSamplerBase.getHeaderManager() |
protected HTTPFileArg[] |
getHTTPFiles()
Get the collection of files as a list. |
protected String |
getIpSource()
Invokes HTTPSamplerBase.getIpSource() |
protected InetAddress |
getIpSourceAddress()
Gets the IP source address (IP spoofing) if one has been provided. |
protected String |
getProxyHost()
Invokes HTTPSamplerBase.getProxyHost() |
protected String |
getProxyPass()
Invokes HTTPSamplerBase.getProxyPass() |
protected int |
getProxyPortInt()
Invokes HTTPSamplerBase.getProxyPortInt() |
protected String |
getProxyUser()
Invokes HTTPSamplerBase.getProxyUser() |
protected int |
getResponseTimeout()
Invokes HTTPSamplerBase.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()
Invokes HTTPSamplerBase.getUseKeepAlive() |
protected boolean |
getUseMultipartForPost()
Determine if we should use multipart/form-data or
application/x-www-form-urlencoded for the post
Invokes HTTPSamplerBase.getUseMultipartForPost() |
protected boolean |
hasArguments()
Invokes HTTPSamplerBase.hasArguments() |
protected boolean |
isMonitor()
Invokes HTTPSamplerBase.isMonitor() |
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()
Called by testIterationStart if the SSL Context was reset. |
protected byte[] |
readResponse(SampleResult res,
BufferedInputStream in,
int contentLength)
Read response from the input stream, converting to MD5 digest if the useMD5 property is set. |
protected byte[] |
readResponse(SampleResult res,
InputStream instream,
int 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(URL url,
String method,
boolean areFollowingRedirect,
int frameDepth)
|
protected void |
setUseKeepAlive(boolean b)
Invokes HTTPSamplerBase.setUseKeepAlive(boolean) |
protected void |
threadFinished()
|
protected HTTPSampleResult |
updateSampleResultForResourceInCache(HTTPSampleResult res)
Update HTTPSampleResult for a resource in cache |
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.samplers.Interruptible |
---|
interrupt |
Field Detail |
---|
protected final HTTPSamplerBase testElement
Constructor Detail |
---|
protected HTTPAbstractImpl(HTTPSamplerBase testElement)
Method Detail |
---|
protected abstract HTTPSampleResult sample(URL url, String method, boolean areFollowingRedirect, int frameDepth)
protected void threadFinished()
protected void notifyFirstSampleAfterLoopRestart()
protected HTTPSampleResult errorResult(Throwable t, HTTPSampleResult res)
See HTTPSamplerBase.errorResult(Throwable, HTTPSampleResult)
t
- Exception representing the error.res
- SampleResult to be modified
protected Arguments getArguments()
HTTPSamplerBase.getArguments()
protected AuthManager getAuthManager()
HTTPSamplerBase.getAuthManager()
AuthManager
of the associated test elementprotected boolean getAutoRedirects()
HTTPSamplerBase.getAutoRedirects()
protected CacheManager getCacheManager()
HTTPSamplerBase.getCacheManager()
CacheManager
of the associated test elementprotected int getConnectTimeout()
HTTPSamplerBase.getConnectTimeout()
protected String getContentEncoding()
HTTPSamplerBase.getContentEncoding()
protected CookieManager getCookieManager()
HTTPSamplerBase.getCookieManager()
CookieManager
of the associated test elementprotected HeaderManager getHeaderManager()
HTTPSamplerBase.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 String getIpSource()
HTTPSamplerBase.getIpSource()
protected InetAddress getIpSourceAddress() throws UnknownHostException, SocketException
null
, if none provided or the device address could not be found)
UnknownHostException
- if the hostname/ip for getIpSource()
could not be resolved or not interface was found for it
SocketException
- if an I/O error occursprotected String getProxyHost()
HTTPSamplerBase.getProxyHost()
protected String getProxyPass()
HTTPSamplerBase.getProxyPass()
protected int getProxyPortInt()
HTTPSamplerBase.getProxyPortInt()
protected String getProxyUser()
HTTPSamplerBase.getProxyUser()
protected int getResponseTimeout()
HTTPSamplerBase.getResponseTimeout()
protected boolean getSendFileAsPostBody()
HTTPSamplerBase.getSendFileAsPostBody()
protected boolean getSendParameterValuesAsPostBody()
HTTPSamplerBase.getSendParameterValuesAsPostBody()
protected boolean getUseKeepAlive()
HTTPSamplerBase.getUseKeepAlive()
protected boolean getUseMultipartForPost()
multipart/form-data
or
application/x-www-form-urlencoded
for the post
Invokes HTTPSamplerBase.getUseMultipartForPost()
true
if multipart/form-data
should be
used and method is POSTprotected boolean getDoBrowserCompatibleMultipart()
HTTPSamplerBase.getDoBrowserCompatibleMultipart()
protected boolean hasArguments()
HTTPSamplerBase.hasArguments()
protected boolean isMonitor()
HTTPSamplerBase.isMonitor()
protected boolean isSuccessCode(int errorLevel)
Invokes HTTPSamplerBase.isSuccessCode(int)
errorLevel
- status code to check
protected byte[] readResponse(SampleResult res, InputStream instream, int responseContentLength) throws 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, int)
res
- sample to store information about the response intoinstream
- input stream from which to read the responseresponseContentLength
- expected input length or zero
IOException
- if reading the result failsprotected byte[] readResponse(SampleResult res, BufferedInputStream in, int contentLength) throws 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, int)
res
- sample to store information about the response intoin
- input stream from which to read the responsecontentLength
- expected input length or zero
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 process
protected void setUseKeepAlive(boolean b)
HTTPSamplerBase.setUseKeepAlive(boolean)
b
- flag whether to use keep-alive for requestsprotected void notifySSLContextWasReset()
protected HTTPSampleResult updateSampleResultForResourceInCache(HTTPSampleResult res)
res
- HTTPSampleResult
|
Apache JMeter | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |