Class CachingHttpAsyncClient
- All Implemented Interfaces:
HttpAsyncClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AsynchronousAsyncValidatorprivate final HttpAsyncClientprivate final org.apache.http.impl.client.cache.CacheableRequestPolicyprivate final AtomicLongprivate final AtomicLongprivate final AtomicLongprivate final org.apache.http.impl.client.cache.ConditionalRequestBuilderprivate final org.apache.commons.logging.Logprivate final longprivate final org.apache.http.impl.client.cache.RequestProtocolComplianceprivate final org.apache.http.impl.client.cache.HttpCacheprivate final org.apache.http.impl.client.cache.ResponseCachingPolicyprivate final org.apache.http.impl.client.cache.ResponseProtocolComplianceprivate final org.apache.http.impl.client.cache.CachedHttpResponseGeneratorprivate final booleanprivate final org.apache.http.impl.client.cache.CachedResponseSuitabilityCheckerprivate static final booleanprivate final org.apache.http.impl.client.cache.CacheValidityPolicy -
Constructor Summary
ConstructorsConstructorDescriptionCachingHttpAsyncClient(org.apache.http.impl.client.cache.CacheConfig config) CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.client.cache.HttpCacheStorage storage, org.apache.http.impl.client.cache.CacheConfig config) CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.client.cache.ResourceFactory resourceFactory, org.apache.http.client.cache.HttpCacheStorage storage, org.apache.http.impl.client.cache.CacheConfig config) CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.impl.client.cache.CacheConfig config) CachingHttpAsyncClient(HttpAsyncClient backend, org.apache.http.impl.client.cache.CacheValidityPolicy validityPolicy, org.apache.http.impl.client.cache.ResponseCachingPolicy responseCachingPolicy, org.apache.http.impl.client.cache.HttpCache responseCache, org.apache.http.impl.client.cache.CachedHttpResponseGenerator responseGenerator, org.apache.http.impl.client.cache.CacheableRequestPolicy cacheableRequestPolicy, org.apache.http.impl.client.cache.CachedResponseSuitabilityChecker suitabilityChecker, org.apache.http.impl.client.cache.ConditionalRequestBuilder conditionalRequestBuilder, org.apache.http.impl.client.cache.ResponseProtocolCompliance responseCompliance, org.apache.http.impl.client.cache.RequestProtocolCompliance requestCompliance) CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.impl.client.cache.HttpCache cache, org.apache.http.impl.client.cache.CacheConfig config) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanalreadyHaveNewerCacheEntry(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.HttpResponse backendResponse) (package private) voidcallBackend(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext) (package private) booleanclientRequestsOurOptions(org.apache.http.HttpRequest request) Future<org.apache.http.HttpResponse> execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Initiates asynchronous HTTP request execution.Future<org.apache.http.HttpResponse> execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Initiates asynchronous HTTP request execution using the given context.Future<org.apache.http.HttpResponse> execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Initiates asynchronous HTTP request execution against the given target.Future<org.apache.http.HttpResponse> execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest originalRequest, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> futureCallback) Initiates asynchronous HTTP request execution against the given target using the given context.<T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.concurrent.FutureCallback<T> callback) Initiates asynchronous HTTP request execution using the default context.<T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<T> callback) Initiates asynchronous HTTP request execution using the given context.private booleanexplicitFreshnessRequest(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheEntry entry, Date now) private voidflushEntriesInvalidatedByRequest(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) private org.apache.http.HttpResponsegenerateCachedResponse(org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry, Date now) private org.apache.http.HttpResponsegenerateGatewayTimeout(org.apache.http.client.cache.HttpCacheContext clientContext) private StringgenerateViaHeader(org.apache.http.HttpMessage msg) longReports the number of times that the cache successfully responded to anHttpRequestwithout contacting the origin server.longReports the number of times that the cache contacted the origin server because it had no appropriate response cached.longReports the number of times that the cache was able to satisfy a response by revalidating an existing but stale cache entry.(package private) DategetExistingCacheVariants(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) private org.apache.http.HttpResponsegetFatallyNoncompliantResponse(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheContext clientContext) private org.apache.http.client.cache.HttpCacheEntrygetUpdatedVariantEntry(org.apache.http.HttpHost target, org.apache.http.HttpRequest conditionalRequest, Date requestDate, Date responseDate, org.apache.http.HttpResponse backendResponse, org.apache.http.impl.client.cache.Variant matchingVariant, org.apache.http.client.cache.HttpCacheEntry matchedEntry) (package private) org.apache.http.client.methods.CloseableHttpResponsehandleBackendResponse(org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, Date requestDate, Date responseDate, org.apache.http.client.methods.CloseableHttpResponse backendResponse) private voidhandleCacheHit(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry) private voidhandleCacheMiss(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext) private org.apache.http.HttpResponsehandleRevalidationFailure(org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry, Date now) booleanReports whether thisCachingHttpClientis configured as a shared (public) or non-shared (private) cache.private AsynchronousAsyncValidatormakeAsynchronousValidator(org.apache.http.impl.client.cache.CacheConfig config) private booleanmayCallBackend(org.apache.http.HttpRequest request) (package private) voidnegotiateResponseFromVariants(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, Map<String, org.apache.http.impl.client.cache.Variant> variants) private voidrecordCacheHit(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) private voidrecordCacheMiss(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) private voidrecordCacheUpdate(org.apache.http.client.cache.HttpCacheContext clientContext) private voidretryRequestUnconditionally(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry matchedEntry) (package private) voidrevalidateCacheEntry(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry cacheEntry) private voidrevalidateCacheEntry(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry, Date now) private voidrevalidateCacheEntryCompleted(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry cacheEntry, org.apache.http.client.methods.HttpRequestWrapper conditionalRequest, Date requestDate, org.apache.http.HttpResponse httpResponse, Date responseDate) private booleanrevalidationResponseIsTooOld(org.apache.http.HttpResponse backendResponse, org.apache.http.client.cache.HttpCacheEntry cacheEntry) private org.apache.http.client.cache.HttpCacheEntrysatisfyFromCache(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) private voidsetResponseStatus(org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.CacheResponseStatus value) private booleanshouldSendNotModifiedResponse(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheEntry responseEntry) private booleanstaleIfErrorAppliesTo(int statusCode) private booleanstaleResponseNotAllowed(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheEntry entry, Date now) private voidstoreRequestIfModifiedSinceFor304Response(org.apache.http.HttpRequest request, org.apache.http.HttpResponse backendResponse) For 304 Not modified responses, adds a "Last-Modified" header with the value of the "If-Modified-Since" header passed in the request.booleanReports whether thisCachingHttpClientimplementation supports byte-range requests as specified by theRangeandContent-Rangeheaders.private voidtryToUpdateVariantMap(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.impl.client.cache.Variant matchingVariant) private org.apache.http.HttpResponseunvalidatedCacheHit(org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheEntry entry)
-
Field Details
-
SUPPORTS_RANGE_AND_CONTENT_RANGE_HEADERS
private static final boolean SUPPORTS_RANGE_AND_CONTENT_RANGE_HEADERS- See Also:
-
cacheHits
-
cacheMisses
-
cacheUpdates
-
viaHeaders
-
backend
-
responseCache
private final org.apache.http.impl.client.cache.HttpCache responseCache -
validityPolicy
private final org.apache.http.impl.client.cache.CacheValidityPolicy validityPolicy -
responseCachingPolicy
private final org.apache.http.impl.client.cache.ResponseCachingPolicy responseCachingPolicy -
responseGenerator
private final org.apache.http.impl.client.cache.CachedHttpResponseGenerator responseGenerator -
cacheableRequestPolicy
private final org.apache.http.impl.client.cache.CacheableRequestPolicy cacheableRequestPolicy -
suitabilityChecker
private final org.apache.http.impl.client.cache.CachedResponseSuitabilityChecker suitabilityChecker -
conditionalRequestBuilder
private final org.apache.http.impl.client.cache.ConditionalRequestBuilder conditionalRequestBuilder -
maxObjectSizeBytes
private final long maxObjectSizeBytes -
responseCompliance
private final org.apache.http.impl.client.cache.ResponseProtocolCompliance responseCompliance -
requestCompliance
private final org.apache.http.impl.client.cache.RequestProtocolCompliance requestCompliance -
asynchAsyncRevalidator
-
log
private final org.apache.commons.logging.Log log
-
-
Constructor Details
-
CachingHttpAsyncClient
CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.impl.client.cache.HttpCache cache, org.apache.http.impl.client.cache.CacheConfig config) -
CachingHttpAsyncClient
public CachingHttpAsyncClient() throws org.apache.http.nio.reactor.IOReactorException- Throws:
org.apache.http.nio.reactor.IOReactorException
-
CachingHttpAsyncClient
public CachingHttpAsyncClient(org.apache.http.impl.client.cache.CacheConfig config) throws org.apache.http.nio.reactor.IOReactorException - Throws:
org.apache.http.nio.reactor.IOReactorException
-
CachingHttpAsyncClient
-
CachingHttpAsyncClient
public CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.impl.client.cache.CacheConfig config) -
CachingHttpAsyncClient
public CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.client.cache.ResourceFactory resourceFactory, org.apache.http.client.cache.HttpCacheStorage storage, org.apache.http.impl.client.cache.CacheConfig config) -
CachingHttpAsyncClient
public CachingHttpAsyncClient(HttpAsyncClient client, org.apache.http.client.cache.HttpCacheStorage storage, org.apache.http.impl.client.cache.CacheConfig config) -
CachingHttpAsyncClient
CachingHttpAsyncClient(HttpAsyncClient backend, org.apache.http.impl.client.cache.CacheValidityPolicy validityPolicy, org.apache.http.impl.client.cache.ResponseCachingPolicy responseCachingPolicy, org.apache.http.impl.client.cache.HttpCache responseCache, org.apache.http.impl.client.cache.CachedHttpResponseGenerator responseGenerator, org.apache.http.impl.client.cache.CacheableRequestPolicy cacheableRequestPolicy, org.apache.http.impl.client.cache.CachedResponseSuitabilityChecker suitabilityChecker, org.apache.http.impl.client.cache.ConditionalRequestBuilder conditionalRequestBuilder, org.apache.http.impl.client.cache.ResponseProtocolCompliance responseCompliance, org.apache.http.impl.client.cache.RequestProtocolCompliance requestCompliance)
-
-
Method Details
-
makeAsynchronousValidator
private AsynchronousAsyncValidator makeAsynchronousValidator(org.apache.http.impl.client.cache.CacheConfig config) -
getCacheHits
public long getCacheHits()Reports the number of times that the cache successfully responded to anHttpRequestwithout contacting the origin server.- Returns:
- the number of cache hits
-
getCacheMisses
public long getCacheMisses()Reports the number of times that the cache contacted the origin server because it had no appropriate response cached.- Returns:
- the number of cache misses
-
getCacheUpdates
public long getCacheUpdates()Reports the number of times that the cache was able to satisfy a response by revalidating an existing but stale cache entry.- Returns:
- the number of cache revalidations
-
execute
public Future<org.apache.http.HttpResponse> execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Description copied from interface:HttpAsyncClientInitiates asynchronous HTTP request execution against the given target.- Specified by:
executein interfaceHttpAsyncClient- Parameters:
target- the target host for the request. Implementations may acceptnullif they can still determine a route, for example to a default target or by inspecting the request.request- the request to executecallback- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.concurrent.FutureCallback<T> callback) Description copied from interface:HttpAsyncClientInitiates asynchronous HTTP request execution using the default context.The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
- Specified by:
executein interfaceHttpAsyncClient- Type Parameters:
T- the result type of request execution.- Parameters:
requestProducer- request producer callback.responseConsumer- response consumer callaback.callback- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<T> callback) Description copied from interface:HttpAsyncClientInitiates asynchronous HTTP request execution using the given context.The request producer passed to this method will be used to generate a request message and stream out its content without buffering it in memory. The response consumer passed to this method will be used to process a response message without buffering its content in memory.
Please note it may be unsafe to interact with the context instance while the request is still being executed.
- Specified by:
executein interfaceHttpAsyncClient- Type Parameters:
T- the result type of request execution.- Parameters:
requestProducer- request producer callback.responseConsumer- response consumer callaback.context- HTTP contextcallback- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public Future<org.apache.http.HttpResponse> execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Description copied from interface:HttpAsyncClientInitiates asynchronous HTTP request execution.- Specified by:
executein interfaceHttpAsyncClient- Parameters:
request- the request to executecallback- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public Future<org.apache.http.HttpResponse> execute(org.apache.http.client.methods.HttpUriRequest request, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> callback) Description copied from interface:HttpAsyncClientInitiates asynchronous HTTP request execution using the given context.Please note it may be unsafe to interact with the context instance while the request is still being executed.
- Specified by:
executein interfaceHttpAsyncClient- Parameters:
request- the request to executecontext- HTTP contextcallback- future callback.- Returns:
- future representing pending completion of the operation.
-
execute
public Future<org.apache.http.HttpResponse> execute(org.apache.http.HttpHost target, org.apache.http.HttpRequest originalRequest, org.apache.http.protocol.HttpContext context, org.apache.http.concurrent.FutureCallback<org.apache.http.HttpResponse> futureCallback) Description copied from interface:HttpAsyncClientInitiates asynchronous HTTP request execution against the given target using the given context.Please note it may be unsafe to interact with the context instance while the request is still being executed.
- Specified by:
executein interfaceHttpAsyncClient- Parameters:
target- the target host for the request. Implementations may acceptnullif they can still determine a route, for example to a default target or by inspecting the request.originalRequest- the request to executecontext- the context to use for the execution, ornullto use the default contextfutureCallback- future callback.- Returns:
- future representing pending completion of the operation.
-
handleCacheHit
private void handleCacheHit(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry) throws IOException - Throws:
IOException
-
revalidateCacheEntry
private void revalidateCacheEntry(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry, Date now) throws org.apache.http.client.ClientProtocolException - Throws:
org.apache.http.client.ClientProtocolException
-
handleCacheMiss
private void handleCacheMiss(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext) -
satisfyFromCache
private org.apache.http.client.cache.HttpCacheEntry satisfyFromCache(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) -
getFatallyNoncompliantResponse
private org.apache.http.HttpResponse getFatallyNoncompliantResponse(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheContext clientContext) -
getExistingCacheVariants
-
recordCacheMiss
private void recordCacheMiss(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) -
recordCacheHit
private void recordCacheHit(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) -
recordCacheUpdate
private void recordCacheUpdate(org.apache.http.client.cache.HttpCacheContext clientContext) -
flushEntriesInvalidatedByRequest
private void flushEntriesInvalidatedByRequest(org.apache.http.HttpHost target, org.apache.http.HttpRequest request) -
generateCachedResponse
private org.apache.http.HttpResponse generateCachedResponse(org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry, Date now) -
handleRevalidationFailure
private org.apache.http.HttpResponse handleRevalidationFailure(org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry, Date now) -
generateGatewayTimeout
private org.apache.http.HttpResponse generateGatewayTimeout(org.apache.http.client.cache.HttpCacheContext clientContext) -
unvalidatedCacheHit
private org.apache.http.HttpResponse unvalidatedCacheHit(org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheEntry entry) -
staleResponseNotAllowed
private boolean staleResponseNotAllowed(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheEntry entry, Date now) -
mayCallBackend
private boolean mayCallBackend(org.apache.http.HttpRequest request) -
explicitFreshnessRequest
private boolean explicitFreshnessRequest(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheEntry entry, Date now) -
generateViaHeader
-
setResponseStatus
private void setResponseStatus(org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.CacheResponseStatus value) -
supportsRangeAndContentRangeHeaders
public boolean supportsRangeAndContentRangeHeaders()Reports whether thisCachingHttpClientimplementation supports byte-range requests as specified by theRangeandContent-Rangeheaders.- Returns:
trueif byte-range requests are supported
-
getCurrentDate
Date getCurrentDate() -
clientRequestsOurOptions
boolean clientRequestsOurOptions(org.apache.http.HttpRequest request) -
callBackend
void callBackend(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext) -
revalidationResponseIsTooOld
private boolean revalidationResponseIsTooOld(org.apache.http.HttpResponse backendResponse, org.apache.http.client.cache.HttpCacheEntry cacheEntry) -
negotiateResponseFromVariants
void negotiateResponseFromVariants(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, Map<String, org.apache.http.impl.client.cache.Variant> variants) -
retryRequestUnconditionally
private void retryRequestUnconditionally(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry matchedEntry) -
getUpdatedVariantEntry
private org.apache.http.client.cache.HttpCacheEntry getUpdatedVariantEntry(org.apache.http.HttpHost target, org.apache.http.HttpRequest conditionalRequest, Date requestDate, Date responseDate, org.apache.http.HttpResponse backendResponse, org.apache.http.impl.client.cache.Variant matchingVariant, org.apache.http.client.cache.HttpCacheEntry matchedEntry) -
tryToUpdateVariantMap
private void tryToUpdateVariantMap(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.impl.client.cache.Variant matchingVariant) -
shouldSendNotModifiedResponse
private boolean shouldSendNotModifiedResponse(org.apache.http.HttpRequest request, org.apache.http.client.cache.HttpCacheEntry responseEntry) -
revalidateCacheEntry
void revalidateCacheEntry(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry cacheEntry) throws org.apache.http.ProtocolException - Throws:
org.apache.http.ProtocolException
-
revalidateCacheEntryCompleted
private void revalidateCacheEntryCompleted(org.apache.http.concurrent.BasicFuture<org.apache.http.HttpResponse> future, org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry cacheEntry, org.apache.http.client.methods.HttpRequestWrapper conditionalRequest, Date requestDate, org.apache.http.HttpResponse httpResponse, Date responseDate) -
staleIfErrorAppliesTo
private boolean staleIfErrorAppliesTo(int statusCode) -
handleBackendResponse
org.apache.http.client.methods.CloseableHttpResponse handleBackendResponse(org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, Date requestDate, Date responseDate, org.apache.http.client.methods.CloseableHttpResponse backendResponse) throws IOException - Throws:
IOException
-
storeRequestIfModifiedSinceFor304Response
private void storeRequestIfModifiedSinceFor304Response(org.apache.http.HttpRequest request, org.apache.http.HttpResponse backendResponse) For 304 Not modified responses, adds a "Last-Modified" header with the value of the "If-Modified-Since" header passed in the request. This header is required to be able to reuse match the cache entry for subsequent requests but as defined in http specifications it is not included in 304 responses by backend servers. This header will not be included in the resulting response. -
alreadyHaveNewerCacheEntry
private boolean alreadyHaveNewerCacheEntry(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.HttpResponse backendResponse)
-