public class CacheManager
extends org.apache.jmeter.config.ConfigTestElement
implements org.apache.jmeter.testelement.TestStateListener, org.apache.jmeter.testelement.TestIterationListener, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CLEAR |
static java.lang.String |
MAX_SIZE |
static java.lang.String |
USE_EXPIRES |
| Constructor and Description |
|---|
CacheManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
CacheManager |
createCacheManagerProxy()
create a cache manager that share the underlying cache of the current one
it allows to use the same cache in different threads which does not inherit from each other
|
boolean |
getClearEachIteration() |
int |
getMaxSize() |
boolean |
getUseExpires() |
boolean |
inCache(java.net.URL url)
Deprecated.
use a version of
inCache(URL, Header[])
or
inCache(URL, org.apache.jmeter.protocol.http.control.Header[]) |
boolean |
inCache(java.net.URL url,
org.apache.http.Header[] allHeaders) |
boolean |
inCache(java.net.URL url,
Header[] allHeaders) |
void |
saveDetails(org.apache.http.HttpResponse method,
HTTPSampleResult res)
Save the Last-Modified, Etag, and Expires headers if the result is
cacheable.
|
void |
saveDetails(java.net.URLConnection conn,
HTTPSampleResult res)
Save the Last-Modified, Etag, and Expires headers if the result is cacheable.
|
void |
setClearEachIteration(boolean clear) |
void |
setHeaders(java.net.HttpURLConnection conn,
Header[] headers,
java.net.URL url)
Check the cache, and if there is a match, set the headers:
If-Modified-Since
If-None-Match
|
void |
setHeaders(java.net.URL url,
org.apache.http.client.methods.HttpRequestBase request)
Check the cache, and if there is a match, set the headers:
If-Modified-Since
If-None-Match
Apache HttpClient version.
|
void |
setMaxSize(int size) |
void |
setUseExpires(boolean expires) |
void |
testEnded() |
void |
testEnded(java.lang.String host) |
void |
testIterationStart(org.apache.jmeter.engine.event.LoopIterationEvent event) |
void |
testStarted() |
void |
testStarted(java.lang.String host) |
addConfigElement, addTestElement, expectsModificationaddPropertiesValues, addProperty, addProperty, canRemove, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertypublic static final java.lang.String CLEAR
public static final java.lang.String USE_EXPIRES
public static final java.lang.String MAX_SIZE
public void saveDetails(java.net.URLConnection conn,
HTTPSampleResult res)
conn - connectionres - resultpublic void saveDetails(org.apache.http.HttpResponse method,
HTTPSampleResult res)
method - HttpResponse to extract header information fromres - result to decide if result is cacheablepublic void setHeaders(java.net.URL url,
org.apache.http.client.methods.HttpRequestBase request)
url - URL to look up in cacherequest - where to set the headerspublic void setHeaders(java.net.HttpURLConnection conn,
Header[] headers,
java.net.URL url)
url - URL to look up in cacheheaders - Array of Headerconn - where to set the headers@Deprecated public boolean inCache(java.net.URL url)
inCache(URL, Header[])
or
inCache(URL, org.apache.jmeter.protocol.http.control.Header[])trueurl - URL to look up in cachetrue if entry has an expires header and the entry
has not expired, else falsepublic boolean inCache(java.net.URL url,
org.apache.http.Header[] allHeaders)
public boolean inCache(java.net.URL url,
Header[] allHeaders)
public boolean getClearEachIteration()
public void setClearEachIteration(boolean clear)
public boolean getUseExpires()
public void setUseExpires(boolean expires)
public int getMaxSize()
public void setMaxSize(int size)
size - int cache max sizepublic void clear()
clear in interface org.apache.jmeter.testelement.TestElementclear in class org.apache.jmeter.testelement.AbstractTestElementpublic CacheManager createCacheManagerProxy()
public void testStarted()
testStarted in interface org.apache.jmeter.testelement.TestStateListenerpublic void testEnded()
testEnded in interface org.apache.jmeter.testelement.TestStateListenerpublic void testStarted(java.lang.String host)
testStarted in interface org.apache.jmeter.testelement.TestStateListenerpublic void testEnded(java.lang.String host)
testEnded in interface org.apache.jmeter.testelement.TestStateListenerpublic void testIterationStart(org.apache.jmeter.engine.event.LoopIterationEvent event)
testIterationStart in interface org.apache.jmeter.testelement.TestIterationListenerCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.