com.koushikdutta.async.http
Class ResponseCacheMiddleware

java.lang.Object
  extended by com.koushikdutta.async.http.SimpleMiddleware
      extended by com.koushikdutta.async.http.ResponseCacheMiddleware
All Implemented Interfaces:
AsyncHttpClientMiddleware

public class ResponseCacheMiddleware
extends SimpleMiddleware


Nested Class Summary
static class ResponseCacheMiddleware.CacheData
           
 
Nested classes/interfaces inherited from interface com.koushikdutta.async.http.AsyncHttpClientMiddleware
AsyncHttpClientMiddleware.GetSocketData, AsyncHttpClientMiddleware.OnBodyData, AsyncHttpClientMiddleware.OnHeadersReceivedData, AsyncHttpClientMiddleware.OnRequestCompleteData, AsyncHttpClientMiddleware.OnSocketData
 
Method Summary
static ResponseCacheMiddleware addCache(AsyncHttpClient client, java.io.File cacheDir, long size)
           
 void clear()
           
 int getCacheHitCount()
           
 int getCacheStoreCount()
           
 boolean getCaching()
           
 int getConditionalCacheHitCount()
           
 int getNetworkCount()
           
 Cancellable getSocket(AsyncHttpClientMiddleware.GetSocketData data)
           
 void onBodyDecoder(AsyncHttpClientMiddleware.OnBodyData data)
           
 void onRequestComplete(AsyncHttpClientMiddleware.OnRequestCompleteData data)
           
 void setCaching(boolean caching)
           
 
Methods inherited from class com.koushikdutta.async.http.SimpleMiddleware
onHeadersReceived, onSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addCache

public static ResponseCacheMiddleware addCache(AsyncHttpClient client,
                                               java.io.File cacheDir,
                                               long size)
                                        throws java.io.IOException
Throws:
java.io.IOException

setCaching

public void setCaching(boolean caching)

getCaching

public boolean getCaching()

getSocket

public Cancellable getSocket(AsyncHttpClientMiddleware.GetSocketData data)
Specified by:
getSocket in interface AsyncHttpClientMiddleware
Overrides:
getSocket in class SimpleMiddleware

getConditionalCacheHitCount

public int getConditionalCacheHitCount()

getCacheHitCount

public int getCacheHitCount()

getNetworkCount

public int getNetworkCount()

getCacheStoreCount

public int getCacheStoreCount()

onBodyDecoder

public void onBodyDecoder(AsyncHttpClientMiddleware.OnBodyData data)
Specified by:
onBodyDecoder in interface AsyncHttpClientMiddleware
Overrides:
onBodyDecoder in class SimpleMiddleware

onRequestComplete

public void onRequestComplete(AsyncHttpClientMiddleware.OnRequestCompleteData data)
Specified by:
onRequestComplete in interface AsyncHttpClientMiddleware
Overrides:
onRequestComplete in class SimpleMiddleware

clear

public void clear()
           throws java.io.IOException
Throws:
java.io.IOException