Package | Description |
---|---|
org.apache.http.client.cache |
This package consists largely of constants and interfaces that are
necessary for building new storage backends for the
CachingHttpClient or for
those clients wanting to get a little more behavioral information
out of the cache module (for example, whether a particular response
was a cache hit or not). |
org.apache.http.impl.client.cache |
This package contains a cache module that can be used for HTTP/1.1
client-side caching.
|
Modifier and Type | Method and Description |
---|---|
HttpCacheEntry |
HttpCacheStorage.getEntry(java.lang.String key)
Retrieves the cache entry stored under the given key
or null if no entry exists under that key.
|
HttpCacheEntry |
HttpCacheEntrySerializer.readFrom(java.io.InputStream is)
Deserializes a byte representation of a cache entry by reading
from the given
InputStream . |
HttpCacheEntry |
HttpCacheUpdateCallback.update(HttpCacheEntry existing)
Returns the new cache entry that should replace an existing one.
|
Modifier and Type | Method and Description |
---|---|
void |
HttpCacheStorage.putEntry(java.lang.String key,
HttpCacheEntry entry)
Store a given cache entry under the given key.
|
HttpCacheEntry |
HttpCacheUpdateCallback.update(HttpCacheEntry existing)
Returns the new cache entry that should replace an existing one.
|
void |
HttpCacheEntrySerializer.writeTo(HttpCacheEntry entry,
java.io.OutputStream os)
Serializes the given entry to a byte representation on the
given
OutputStream . |
Modifier and Type | Field and Description |
---|---|
private HttpCacheEntry |
CacheEntity.cacheEntry |
private HttpCacheEntry |
AsynchronousValidationRequest.cacheEntry |
private HttpCacheEntry |
CachingHttpClient.AsynchronousValidationRequest.cacheEntry |
private HttpCacheEntry |
Variant.entry |
Modifier and Type | Field and Description |
---|---|
private java.lang.ref.ReferenceQueue<HttpCacheEntry> |
ManagedHttpCacheStorage.morque |
Modifier and Type | Method and Description |
---|---|
(package private) HttpCacheEntry |
BasicHttpCache.doGetUpdatedParentEntry(java.lang.String requestId,
HttpCacheEntry existing,
HttpCacheEntry entry,
java.lang.String variantKey,
java.lang.String variantCacheKey) |
HttpCacheEntry |
HttpCache.getCacheEntry(org.apache.http.HttpHost host,
org.apache.http.HttpRequest request)
Retrieve matching
HttpCacheEntry from the cache if it exists |
HttpCacheEntry |
BasicHttpCache.getCacheEntry(org.apache.http.HttpHost host,
org.apache.http.HttpRequest request) |
HttpCacheEntry |
Variant.getEntry() |
private HttpCacheEntry |
CacheInvalidator.getEntry(java.lang.String theUri) |
HttpCacheEntry |
ManagedHttpCacheStorage.getEntry(java.lang.String url) |
HttpCacheEntry |
BasicHttpCacheStorage.getEntry(java.lang.String url)
Gets an entry from the cache, if it exists
|
private HttpCacheEntry |
CachingExec.getUpdatedVariantEntry(org.apache.http.HttpHost target,
HttpRequestWrapper conditionalRequest,
java.util.Date requestDate,
java.util.Date responseDate,
CloseableHttpResponse backendResponse,
Variant matchingVariant,
HttpCacheEntry matchedEntry) |
private HttpCacheEntry |
CachingHttpClient.getUpdatedVariantEntry(org.apache.http.HttpHost target,
HttpRequestWrapper conditionalRequest,
java.util.Date requestDate,
java.util.Date responseDate,
org.apache.http.HttpResponse backendResponse,
Variant matchingVariant,
HttpCacheEntry matchedEntry)
Deprecated.
|
HttpCacheEntry |
DefaultHttpCacheEntrySerializer.readFrom(java.io.InputStream is) |
private HttpCacheEntry |
CachingExec.satisfyFromCache(org.apache.http.HttpHost target,
HttpRequestWrapper request) |
private HttpCacheEntry |
CachingHttpClient.satisfyFromCache(org.apache.http.HttpHost target,
HttpRequestWrapper request)
Deprecated.
|
HttpCacheEntry |
HttpCache.updateCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived)
Update a
HttpCacheEntry using a 304 HttpResponse . |
HttpCacheEntry |
BasicHttpCache.updateCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived) |
HttpCacheEntry |
CacheEntryUpdater.updateCacheEntry(java.lang.String requestId,
HttpCacheEntry entry,
java.util.Date requestDate,
java.util.Date responseDate,
org.apache.http.HttpResponse response)
Update the entry with the new information from the response.
|
HttpCacheEntry |
HttpCache.updateVariantCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived,
java.lang.String cacheKey)
Update a specific
HttpCacheEntry representing a cached variant
using a 304 HttpResponse . |
HttpCacheEntry |
BasicHttpCache.updateVariantCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived,
java.lang.String cacheKey) |
Modifier and Type | Method and Description |
---|---|
boolean |
CachedResponseSuitabilityChecker.allConditionalsMatch(org.apache.http.HttpRequest request,
HttpCacheEntry entry,
java.util.Date now)
Check that conditionals that are part of this request match
|
HttpRequestWrapper |
ConditionalRequestBuilder.buildConditionalRequest(HttpRequestWrapper request,
HttpCacheEntry cacheEntry)
When a
HttpCacheEntry is stale but 'might' be used as a response
to an HttpRequest we will attempt to revalidate
the entry with the origin. |
HttpRequestWrapper |
ConditionalRequestBuilder.buildUnconditionalRequest(HttpRequestWrapper request,
HttpCacheEntry entry)
Returns a request to unconditionally validate a cache entry with
the origin.
|
private boolean |
CachedResponseSuitabilityChecker.cacheEntryDoesNotContainMethodAndEntity(HttpCacheEntry entry) |
boolean |
CachedResponseSuitabilityChecker.canCachedResponseBeUsed(org.apache.http.HttpHost host,
org.apache.http.HttpRequest request,
HttpCacheEntry entry,
java.util.Date now)
Determine if I can utilize a
HttpCacheEntry to respond to the given
HttpRequest |
protected boolean |
CacheValidityPolicy.contentLengthHeaderMatchesActualLength(HttpCacheEntry entry)
This matters for deciding whether the cache entry is valid to serve as a
response.
|
(package private) HttpCacheEntry |
BasicHttpCache.doGetUpdatedParentEntry(java.lang.String requestId,
HttpCacheEntry existing,
HttpCacheEntry entry,
java.lang.String variantKey,
java.lang.String variantCacheKey) |
private boolean |
CacheEntryUpdater.entryAndResponseHaveDateHeader(HttpCacheEntry entry,
org.apache.http.HttpResponse response) |
private boolean |
CacheEntryUpdater.entryDateHeaderNewerThenResponse(HttpCacheEntry entry,
org.apache.http.HttpResponse response) |
private boolean |
CachedResponseSuitabilityChecker.entryIsNotA204Response(HttpCacheEntry entry) |
private boolean |
CachedResponseSuitabilityChecker.etagValidatorMatches(org.apache.http.HttpRequest request,
HttpCacheEntry entry)
Check entry against If-None-Match
|
private boolean |
CachingExec.explicitFreshnessRequest(HttpRequestWrapper request,
HttpCacheEntry entry,
java.util.Date now) |
private boolean |
CachingHttpClient.explicitFreshnessRequest(HttpRequestWrapper request,
HttpCacheEntry entry,
java.util.Date now)
Deprecated.
|
private CloseableHttpResponse |
CachingExec.generateCachedResponse(HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry,
java.util.Date now) |
private org.apache.http.HttpResponse |
CachingHttpClient.generateCachedResponse(HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry,
java.util.Date now)
Deprecated.
|
(package private) CloseableHttpResponse |
CachedHttpResponseGenerator.generateNotModifiedResponse(HttpCacheEntry entry)
Generate a 304 - Not Modified response from a
CacheEntity . |
(package private) CloseableHttpResponse |
CachedHttpResponseGenerator.generateResponse(HttpRequestWrapper request,
HttpCacheEntry entry)
If I was able to use a
CacheEntity to response to the HttpRequest then
generate an HttpResponse based on the cache entry. |
protected long |
CacheValidityPolicy.getAgeValue(HttpCacheEntry entry) |
protected long |
CacheValidityPolicy.getApparentAgeSecs(HttpCacheEntry entry) |
protected long |
CacheValidityPolicy.getContentLengthValue(HttpCacheEntry entry) |
protected long |
CacheValidityPolicy.getCorrectedInitialAgeSecs(HttpCacheEntry entry) |
protected long |
CacheValidityPolicy.getCorrectedReceivedAgeSecs(HttpCacheEntry entry) |
long |
CacheValidityPolicy.getCurrentAgeSecs(HttpCacheEntry entry,
java.util.Date now) |
protected java.util.Date |
CacheValidityPolicy.getDateValue(HttpCacheEntry entry)
Deprecated.
(4.3) use
getDate() . |
protected java.util.Date |
CacheValidityPolicy.getExpirationDate(HttpCacheEntry entry) |
long |
CacheValidityPolicy.getFreshnessLifetimeSecs(HttpCacheEntry entry) |
long |
CacheValidityPolicy.getHeuristicFreshnessLifetimeSecs(HttpCacheEntry entry,
float coefficient,
long defaultLifetime) |
protected java.util.Date |
CacheValidityPolicy.getLastModifiedValue(HttpCacheEntry entry) |
protected long |
CacheValidityPolicy.getMaxAge(HttpCacheEntry entry) |
protected long |
CacheValidityPolicy.getResidentTimeSecs(HttpCacheEntry entry,
java.util.Date now) |
protected long |
CacheValidityPolicy.getResponseDelaySecs(HttpCacheEntry entry) |
long |
CacheValidityPolicy.getStalenessSecs(HttpCacheEntry entry,
java.util.Date now) |
private HttpCacheEntry |
CachingExec.getUpdatedVariantEntry(org.apache.http.HttpHost target,
HttpRequestWrapper conditionalRequest,
java.util.Date requestDate,
java.util.Date responseDate,
CloseableHttpResponse backendResponse,
Variant matchingVariant,
HttpCacheEntry matchedEntry) |
private HttpCacheEntry |
CachingHttpClient.getUpdatedVariantEntry(org.apache.http.HttpHost target,
HttpRequestWrapper conditionalRequest,
java.util.Date requestDate,
java.util.Date responseDate,
org.apache.http.HttpResponse backendResponse,
Variant matchingVariant,
HttpCacheEntry matchedEntry)
Deprecated.
|
java.lang.String |
CacheKeyGenerator.getVariantKey(org.apache.http.HttpRequest req,
HttpCacheEntry entry)
Compute a "variant key" from the headers of a given request that are
covered by the Vary header of a given cache entry.
|
java.lang.String |
CacheKeyGenerator.getVariantURI(org.apache.http.HttpHost host,
org.apache.http.HttpRequest req,
HttpCacheEntry entry)
For a given
HttpHost and HttpRequest if the request has a
VARY header - I need to get an additional URI from the pair of host and
request so that I can also store the variant into my HttpCache. |
private org.apache.http.HttpResponse |
CachingHttpClient.handleCacheHit(org.apache.http.HttpHost target,
HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry)
Deprecated.
|
private CloseableHttpResponse |
CachingExec.handleCacheHit(HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry entry) |
private CloseableHttpResponse |
CachingExec.handleRevalidationFailure(HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry,
java.util.Date now) |
private org.apache.http.HttpResponse |
CachingHttpClient.handleRevalidationFailure(HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry,
java.util.Date now)
Deprecated.
|
boolean |
CacheValidityPolicy.hasCacheControlDirective(HttpCacheEntry entry,
java.lang.String directive) |
protected boolean |
CacheValidityPolicy.hasContentLengthHeader(HttpCacheEntry entry) |
private boolean |
CachedResponseSuitabilityChecker.hasUnsupportedCacheEntryForGet(org.apache.http.HttpRequest request,
HttpCacheEntry entry) |
private boolean |
CacheInvalidator.isAHeadCacheEntry(HttpCacheEntry parentCacheEntry) |
private boolean |
CachedResponseSuitabilityChecker.isFreshEnough(HttpCacheEntry entry,
org.apache.http.HttpRequest request,
java.util.Date now) |
boolean |
CacheValidityPolicy.isResponseFresh(HttpCacheEntry entry,
java.util.Date now) |
boolean |
CacheValidityPolicy.isResponseHeuristicallyFresh(HttpCacheEntry entry,
java.util.Date now,
float coefficient,
long defaultLifetime)
Decides if this response is fresh enough based Last-Modified and Date, if available.
|
boolean |
CacheValidityPolicy.isRevalidatable(HttpCacheEntry entry) |
private void |
ManagedHttpCacheStorage.keepResourceReference(HttpCacheEntry entry) |
private boolean |
CachedResponseSuitabilityChecker.lastModifiedValidatorMatches(org.apache.http.HttpRequest request,
HttpCacheEntry entry,
java.util.Date now)
Check entry against If-Modified-Since, if If-Modified-Since is in the future it is invalid as per
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
|
boolean |
CacheValidityPolicy.mayReturnStaleIfError(org.apache.http.HttpRequest request,
HttpCacheEntry entry,
java.util.Date now) |
boolean |
CacheValidityPolicy.mayReturnStaleWhileRevalidating(HttpCacheEntry entry,
java.util.Date now) |
protected org.apache.http.Header[] |
CacheEntryUpdater.mergeHeaders(HttpCacheEntry entry,
org.apache.http.HttpResponse response) |
boolean |
CacheValidityPolicy.mustRevalidate(HttpCacheEntry entry) |
private boolean |
CachedResponseSuitabilityChecker.originInsistsOnFreshness(HttpCacheEntry entry) |
boolean |
CacheValidityPolicy.proxyRevalidate(HttpCacheEntry entry) |
void |
ManagedHttpCacheStorage.putEntry(java.lang.String url,
HttpCacheEntry entry) |
void |
BasicHttpCacheStorage.putEntry(java.lang.String url,
HttpCacheEntry entry)
Places a HttpCacheEntry in the cache
|
private void |
CacheEntryUpdater.removeCacheEntry1xxWarnings(java.util.List<org.apache.http.Header> cacheEntryHeaderList,
HttpCacheEntry entry) |
private boolean |
CacheInvalidator.responseAndEntryEtagsDiffer(org.apache.http.HttpResponse response,
HttpCacheEntry entry) |
private boolean |
CacheInvalidator.responseDateOlderThanEntryDate(org.apache.http.HttpResponse response,
HttpCacheEntry entry) |
private boolean |
CachedHttpResponseGenerator.responseShouldContainEntity(HttpRequestWrapper request,
HttpCacheEntry cacheEntry) |
private org.apache.http.HttpResponse |
CachingHttpClient.retryRequestUnconditionally(org.apache.http.HttpHost target,
HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry matchedEntry)
Deprecated.
|
private CloseableHttpResponse |
CachingExec.retryRequestUnconditionally(HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry matchedEntry) |
void |
AsynchronousValidator.revalidateCacheEntry(CachingExec cachingExec,
HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry entry)
Schedules an asynchronous revalidation
|
(package private) org.apache.http.HttpResponse |
CachingHttpClient.revalidateCacheEntry(org.apache.http.HttpHost target,
HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry cacheEntry)
Deprecated.
|
void |
CachingHttpClient.AsynchronousValidator.revalidateCacheEntry(org.apache.http.HttpHost target,
HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry)
Schedules an asynchronous revalidation
|
private org.apache.http.HttpResponse |
CachingHttpClient.revalidateCacheEntry(org.apache.http.HttpHost target,
HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry,
java.util.Date now)
Deprecated.
|
(package private) CloseableHttpResponse |
CachingExec.revalidateCacheEntry(HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry cacheEntry) |
private CloseableHttpResponse |
CachingExec.revalidateCacheEntry(HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry entry,
java.util.Date now) |
private boolean |
CachingExec.revalidationResponseIsTooOld(org.apache.http.HttpResponse backendResponse,
HttpCacheEntry cacheEntry) |
private boolean |
CachingHttpClient.revalidationResponseIsTooOld(org.apache.http.HttpResponse backendResponse,
HttpCacheEntry cacheEntry)
Deprecated.
|
private boolean |
CacheInvalidator.shouldInvalidateHeadCacheEntry(org.apache.http.HttpRequest req,
HttpCacheEntry parentCacheEntry) |
private boolean |
CachingExec.shouldSendNotModifiedResponse(HttpRequestWrapper request,
HttpCacheEntry responseEntry) |
private boolean |
CachingHttpClient.shouldSendNotModifiedResponse(HttpRequestWrapper request,
HttpCacheEntry responseEntry)
Deprecated.
|
private boolean |
CachingExec.staleResponseNotAllowed(HttpRequestWrapper request,
HttpCacheEntry entry,
java.util.Date now) |
private boolean |
CachingHttpClient.staleResponseNotAllowed(HttpRequestWrapper request,
HttpCacheEntry entry,
java.util.Date now)
Deprecated.
|
(package private) void |
BasicHttpCache.storeInCache(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry entry) |
(package private) void |
BasicHttpCache.storeNonVariantEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest req,
HttpCacheEntry entry) |
(package private) void |
BasicHttpCache.storeVariantEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest req,
HttpCacheEntry entry) |
private CloseableHttpResponse |
CachingExec.unvalidatedCacheHit(HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry) |
private org.apache.http.HttpResponse |
CachingHttpClient.unvalidatedCacheHit(HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry entry)
Deprecated.
|
HttpCacheEntry |
HttpCache.updateCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived)
Update a
HttpCacheEntry using a 304 HttpResponse . |
HttpCacheEntry |
BasicHttpCache.updateCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived) |
HttpCacheEntry |
CacheEntryUpdater.updateCacheEntry(java.lang.String requestId,
HttpCacheEntry entry,
java.util.Date requestDate,
java.util.Date responseDate,
org.apache.http.HttpResponse response)
Update the entry with the new information from the response.
|
HttpCacheEntry |
HttpCache.updateVariantCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived,
java.lang.String cacheKey)
Update a specific
HttpCacheEntry representing a cached variant
using a 304 HttpResponse . |
HttpCacheEntry |
BasicHttpCache.updateVariantCacheEntry(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
HttpCacheEntry stale,
org.apache.http.HttpResponse originResponse,
java.util.Date requestSent,
java.util.Date responseReceived,
java.lang.String cacheKey) |
void |
DefaultHttpCacheEntrySerializer.writeTo(HttpCacheEntry cacheEntry,
java.io.OutputStream os) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
CacheMap.removeEldestEntry(java.util.Map.Entry<java.lang.String,HttpCacheEntry> eldest) |
Constructor and Description |
---|
AsynchronousValidationRequest(AsynchronousValidator parent,
CachingExec cachingExec,
HttpRoute route,
HttpRequestWrapper request,
HttpClientContext context,
HttpExecutionAware execAware,
HttpCacheEntry cacheEntry,
java.lang.String identifier,
int consecutiveFailedAttempts)
Used internally by
AsynchronousValidator to schedule a
revalidation. |
AsynchronousValidationRequest(CachingHttpClient.AsynchronousValidator parent,
CachingHttpClient cachingClient,
org.apache.http.HttpHost target,
HttpRequestWrapper request,
org.apache.http.protocol.HttpContext context,
HttpCacheEntry cacheEntry,
java.lang.String identifier)
Used internally by
AsynchronousValidator to schedule a
revalidation. |
CacheEntity(HttpCacheEntry cacheEntry) |
ResourceReference(HttpCacheEntry entry,
java.lang.ref.ReferenceQueue<HttpCacheEntry> q) |
Variant(java.lang.String variantKey,
java.lang.String cacheKey,
HttpCacheEntry entry) |
Constructor and Description |
---|
ResourceReference(HttpCacheEntry entry,
java.lang.ref.ReferenceQueue<HttpCacheEntry> q) |