org.apache.jmeter.protocol.http.control

Class CacheManager

Implemented Interfaces:
Cloneable, Serializable, ConfigElement, Serializable, TestElement, TestListener

public class CacheManager
extends ConfigTestElement
implements TestListener, Serializable

Handles HTTP Caching

Field Summary

static String
CLEAR

Fields inherited from class org.apache.jmeter.config.ConfigTestElement

PASSWORD, USERNAME

Fields inherited from interface org.apache.jmeter.testelement.TestElement

COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS

Constructor Summary

CacheManager()

Method Summary

void
clear()
boolean
getClearEachIteration()
void
saveDetails(HttpMethod method, SampleResult res)
Save the Last-Modified and Etag headers if the result is cacheable.
void
saveDetails(URLConnection conn, SampleResult res)
Save the Last-Modified and Etag headers if the result is cacheable.
void
setClearEachIteration(boolean clear)
void
setHeaders(HttpURLConnection conn, URL url)
Check the cache, and if there is a match, set the headers:
If-Modified-Since
If-None-Match
void
setHeaders(URL url, HttpMethod method)
Check the cache, and if there is a match, set the headers:
If-Modified-Since
If-None-Match
void
testEnded()
void
testEnded(String host)
void
testIterationStart(LoopIterationEvent event)
void
testStarted()
void
testStarted(String host)

Methods inherited from class org.apache.jmeter.config.ConfigTestElement

addConfigElement, addTestElement, expectsModification

Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement

addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty

Field Details

CLEAR

public static final String CLEAR

Constructor Details

CacheManager

public CacheManager()

Method Details

clear

public void clear()
Specified by:
clear in interface TestElement
Overrides:
clear in interface AbstractTestElement

getClearEachIteration

public boolean getClearEachIteration()

saveDetails

public void saveDetails(HttpMethod method,
                        SampleResult res)
            throws URIException
Save the Last-Modified and Etag headers if the result is cacheable.
Parameters:
method -
res - result

saveDetails

public void saveDetails(URLConnection conn,
                        SampleResult res)
Save the Last-Modified and Etag headers if the result is cacheable.
Parameters:
conn - connection
res - result

setClearEachIteration

public void setClearEachIteration(boolean clear)

setHeaders

public void setHeaders(HttpURLConnection conn,
                       URL url)
Check the cache, and if there is a match, set the headers:
If-Modified-Since
If-None-Match
Parameters:
conn - where to set the headers
url - URL to look up in cache

setHeaders

public void setHeaders(URL url,
                       HttpMethod method)
Check the cache, and if there is a match, set the headers:
If-Modified-Since
If-None-Match
Parameters:
url - URL to look up in cache
method - where to set the headers

testEnded

public void testEnded()
Specified by:
testEnded in interface TestListener

testEnded

public void testEnded(String host)
Specified by:
testEnded in interface TestListener

testIterationStart

public void testIterationStart(LoopIterationEvent event)
Specified by:
testIterationStart in interface TestListener

testStarted

public void testStarted()
Specified by:
testStarted in interface TestListener

testStarted

public void testStarted(String host)
Specified by:
testStarted in interface TestListener

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