org.apache.http.impl.client.cache
Class CachingHttpAsyncClient

java.lang.Object
  extended by org.apache.http.impl.client.cache.CachingHttpAsyncClient
All Implemented Interfaces:
HttpAsyncClient

@ThreadSafe
public class CachingHttpAsyncClient
extends Object
implements HttpAsyncClient


Constructor Summary
CachingHttpAsyncClient()
           
CachingHttpAsyncClient(org.apache.http.impl.client.cache.CacheConfig config)
           
CachingHttpAsyncClient(HttpAsyncClient client)
           
CachingHttpAsyncClient(HttpAsyncClient client, 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)
           
 
Method Summary
<T> Future<T>
execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, FutureCallback<T> callback)
           
<T> Future<T>
execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer, org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer, HttpContext context, FutureCallback<T> callback)
           
 Future<HttpResponse> execute(HttpHost target, HttpRequest request, FutureCallback<HttpResponse> callback)
           
 Future<HttpResponse> execute(HttpHost target, HttpRequest originalRequest, HttpContext context, FutureCallback<HttpResponse> futureCallback)
           
 Future<HttpResponse> execute(HttpUriRequest request, FutureCallback<HttpResponse> callback)
           
 Future<HttpResponse> execute(HttpUriRequest request, HttpContext context, FutureCallback<HttpResponse> callback)
           
 long getCacheHits()
          Reports the number of times that the cache successfully responded to an HttpRequest without contacting the origin server.
 long getCacheMisses()
          Reports the number of times that the cache contacted the origin server because it had no appropriate response cached.
 long getCacheUpdates()
          Reports the number of times that the cache was able to satisfy a response by revalidating an existing but stale cache entry.
 boolean isSharedCache()
          Reports whether this CachingHttpClient is configured as a shared (public) or non-shared (private) cache.
 boolean supportsRangeAndContentRangeHeaders()
          Reports whether this CachingHttpClient implementation supports byte-range requests as specified by the Range and Content-Range headers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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

public CachingHttpAsyncClient(HttpAsyncClient client)

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)
Method Detail

getCacheHits

public long getCacheHits()
Reports the number of times that the cache successfully responded to an HttpRequest without 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<HttpResponse> execute(HttpHost target,
                                    HttpRequest request,
                                    FutureCallback<HttpResponse> callback)
Specified by:
execute in interface HttpAsyncClient

execute

public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer,
                             org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer,
                             FutureCallback<T> callback)
Specified by:
execute in interface HttpAsyncClient

execute

public <T> Future<T> execute(org.apache.http.nio.protocol.HttpAsyncRequestProducer requestProducer,
                             org.apache.http.nio.protocol.HttpAsyncResponseConsumer<T> responseConsumer,
                             HttpContext context,
                             FutureCallback<T> callback)
Specified by:
execute in interface HttpAsyncClient

execute

public Future<HttpResponse> execute(HttpUriRequest request,
                                    FutureCallback<HttpResponse> callback)
Specified by:
execute in interface HttpAsyncClient

execute

public Future<HttpResponse> execute(HttpUriRequest request,
                                    HttpContext context,
                                    FutureCallback<HttpResponse> callback)
Specified by:
execute in interface HttpAsyncClient

execute

public Future<HttpResponse> execute(HttpHost target,
                                    HttpRequest originalRequest,
                                    HttpContext context,
                                    FutureCallback<HttpResponse> futureCallback)
Specified by:
execute in interface HttpAsyncClient

supportsRangeAndContentRangeHeaders

public boolean supportsRangeAndContentRangeHeaders()
Reports whether this CachingHttpClient implementation supports byte-range requests as specified by the Range and Content-Range headers.

Returns:
true if byte-range requests are supported

isSharedCache

public boolean isSharedCache()
Reports whether this CachingHttpClient is configured as a shared (public) or non-shared (private) cache. See CacheConfig.setSharedCache(boolean).

Returns:
true if we are behaving as a shared (public) cache


Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.