|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.impl.client.cache.CachingHttpClient
@ThreadSafe public class CachingHttpClient
| Field Summary | |
|---|---|
static ProtocolVersion |
HTTP_1_1
|
| Constructor Summary | |
|---|---|
CachingHttpClient()
|
|
CachingHttpClient(HttpCache<CacheEntry> cache,
int maxObjectSizeBytes)
|
|
CachingHttpClient(HttpClient client,
HttpCache<CacheEntry> cache,
int maxObjectSizeBytes)
|
|
CachingHttpClient(HttpClient backend,
ResponseCachingPolicy responseCachingPolicy,
CacheEntryGenerator cacheEntryGenerator,
URIExtractor uriExtractor,
HttpCache<CacheEntry> responseCache,
CachedHttpResponseGenerator responseGenerator,
CacheInvalidator cacheInvalidator,
CacheableRequestPolicy cacheableRequestPolicy,
CachedResponseSuitabilityChecker suitabilityChecker,
ConditionalRequestBuilder conditionalRequestBuilder,
CacheEntryUpdater entryUpdater,
ResponseProtocolCompliance responseCompliance,
RequestProtocolCompliance requestCompliance)
|
|
| Method Summary | ||
|---|---|---|
protected HttpResponse |
callBackend(HttpHost target,
HttpRequest request,
HttpContext context)
|
|
protected CacheEntry |
doGetUpdatedParentEntry(CacheEntry existing,
HttpHost target,
HttpRequest req,
CacheEntry entry)
|
|
HttpResponse |
execute(HttpHost target,
HttpRequest request)
Execute an HttpRequest @ a given HttpHost |
|
HttpResponse |
execute(HttpHost target,
HttpRequest request,
HttpContext context)
Executes a request to the target using the given context. |
|
|
execute(HttpHost target,
HttpRequest request,
ResponseHandler<? extends T> responseHandler)
Execute an HttpRequest @ a given HttpHost with a specified
ResponseHandler that will deal with the result of the call. |
|
|
execute(HttpHost target,
HttpRequest request,
ResponseHandler<? extends T> responseHandler,
HttpContext context)
Execute an HttpRequest @ a given HttpHost with a specified
ResponseHandler that will deal with the result of the call using
a specific HttpContext |
|
HttpResponse |
execute(HttpUriRequest request)
Executes a request using the default context. |
|
HttpResponse |
execute(HttpUriRequest request,
HttpContext context)
Executes a request using the given context. |
|
|
execute(HttpUriRequest request,
ResponseHandler<? extends T> responseHandler)
Executes a request using the default context and processes the response using the given response handler. |
|
|
execute(HttpUriRequest request,
ResponseHandler<? extends T> responseHandler,
HttpContext context)
Executes a request using the given context and processes the response using the given response handler. |
|
protected CacheEntry |
getCacheEntry(HttpHost target,
HttpRequest request)
|
|
long |
getCacheHits()
Return the number of times that the cache successfully answered an HttpRequest for a document of information from the server. |
|
long |
getCacheMisses()
Return the number of times that the cache was unable to answer an HttpRequest for a document of information from the server. |
|
long |
getCacheUpdates()
Return the number of times that the cache was able to revalidate an existing cache entry for a document of information from the server. |
|
ClientConnectionManager |
getConnectionManager()
Obtains the connection manager used by this client. |
|
protected Date |
getCurrentDate()
|
|
HttpParams |
getParams()
Obtains the parameters for this client. |
|
protected SizeLimitedResponseReader |
getResponseReader(HttpResponse backEndResponse)
|
|
protected HttpResponse |
handleBackendResponse(HttpHost target,
HttpRequest request,
Date requestDate,
Date responseDate,
HttpResponse backendResponse)
|
|
protected HttpResponse |
revalidateCacheEntry(HttpHost target,
HttpRequest request,
HttpContext context,
CacheEntry cacheEntry)
|
|
protected void |
storeInCache(HttpHost target,
HttpRequest request,
CacheEntry entry)
|
|
protected HttpCacheUpdateCallback<CacheEntry> |
storeVariantEntry(HttpHost target,
HttpRequest req,
CacheEntry entry)
|
|
boolean |
supportsRangeAndContentRangeHeaders()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ProtocolVersion HTTP_1_1
| Constructor Detail |
|---|
public CachingHttpClient()
public CachingHttpClient(HttpCache<CacheEntry> cache,
int maxObjectSizeBytes)
public CachingHttpClient(HttpClient client,
HttpCache<CacheEntry> cache,
int maxObjectSizeBytes)
public CachingHttpClient(HttpClient backend,
ResponseCachingPolicy responseCachingPolicy,
CacheEntryGenerator cacheEntryGenerator,
URIExtractor uriExtractor,
HttpCache<CacheEntry> responseCache,
CachedHttpResponseGenerator responseGenerator,
CacheInvalidator cacheInvalidator,
CacheableRequestPolicy cacheableRequestPolicy,
CachedResponseSuitabilityChecker suitabilityChecker,
ConditionalRequestBuilder conditionalRequestBuilder,
CacheEntryUpdater entryUpdater,
ResponseProtocolCompliance responseCompliance,
RequestProtocolCompliance requestCompliance)
| Method Detail |
|---|
public long getCacheHits()
public long getCacheMisses()
public long getCacheUpdates()
public HttpResponse execute(HttpHost target,
HttpRequest request)
throws IOException
HttpRequest @ a given HttpHost
execute in interface HttpClienttarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to execute
IOException
ClientProtocolException - in case of an http protocol error
public <T> T execute(HttpHost target,
HttpRequest request,
ResponseHandler<? extends T> responseHandler)
throws IOException
HttpRequest @ a given HttpHost with a specified
ResponseHandler that will deal with the result of the call.
execute in interface HttpClientT - The Return Type Identified by the generic type of the ResponseHandlertarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to executeresponseHandler - the response handler
IOException
ClientProtocolException - in case of an http protocol error
public <T> T execute(HttpHost target,
HttpRequest request,
ResponseHandler<? extends T> responseHandler,
HttpContext context)
throws IOException
HttpRequest @ a given HttpHost with a specified
ResponseHandler that will deal with the result of the call using
a specific HttpContext
execute in interface HttpClientT - The Return Type Identified by the generic type of the ResponseHandlertarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to executeresponseHandler - the response handlercontext - the context to use for the execution, or
null to use the default context
IOException
ClientProtocolException - in case of an http protocol error
public HttpResponse execute(HttpUriRequest request)
throws IOException
HttpClient
execute in interface HttpClientrequest - the request to execute
IOException
ClientProtocolException - in case of an http protocol error
public HttpResponse execute(HttpUriRequest request,
HttpContext context)
throws IOException
HttpClient
execute in interface HttpClientrequest - the request to executecontext - the context to use for the execution, or
null to use the default context
IOException
ClientProtocolException - in case of an http protocol error
public <T> T execute(HttpUriRequest request,
ResponseHandler<? extends T> responseHandler)
throws IOException
HttpClient
execute in interface HttpClientT - The Return Type Identified by the generic type of the ResponseHandlerrequest - the request to executeresponseHandler - the response handler
IOException
ClientProtocolException - in case of an http protocol error
public <T> T execute(HttpUriRequest request,
ResponseHandler<? extends T> responseHandler,
HttpContext context)
throws IOException
HttpClient
execute in interface HttpClientT - The Return Type Identified by the generic type of the ResponseHandlerrequest - the request to executeresponseHandler - the response handlercontext -
IOException
ClientProtocolException - in case of an http protocol errorpublic ClientConnectionManager getConnectionManager()
HttpClient
getConnectionManager in interface HttpClientpublic HttpParams getParams()
HttpClient
getParams in interface HttpClientprotected Date getCurrentDate()
protected CacheEntry getCacheEntry(HttpHost target,
HttpRequest request)
public HttpResponse execute(HttpHost target,
HttpRequest request,
HttpContext context)
throws IOException
HttpClient
execute in interface HttpClienttarget - the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request - the request to executecontext - the context to use for the execution, or
null to use the default context
IOException
ClientProtocolException - in case of an http protocol error
protected HttpResponse callBackend(HttpHost target,
HttpRequest request,
HttpContext context)
throws IOException
IOException
protected HttpResponse revalidateCacheEntry(HttpHost target,
HttpRequest request,
HttpContext context,
CacheEntry cacheEntry)
throws IOException,
ProtocolException
IOException
ProtocolException
protected void storeInCache(HttpHost target,
HttpRequest request,
CacheEntry entry)
protected HttpCacheUpdateCallback<CacheEntry> storeVariantEntry(HttpHost target,
HttpRequest req,
CacheEntry entry)
protected CacheEntry doGetUpdatedParentEntry(CacheEntry existing,
HttpHost target,
HttpRequest req,
CacheEntry entry)
throws HttpCacheOperationException
HttpCacheOperationException
protected HttpResponse handleBackendResponse(HttpHost target,
HttpRequest request,
Date requestDate,
Date responseDate,
HttpResponse backendResponse)
throws IOException
IOExceptionprotected SizeLimitedResponseReader getResponseReader(HttpResponse backEndResponse)
public boolean supportsRangeAndContentRangeHeaders()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||