org.littleshoot.proxy
Class DefaultProxyCacheManager

java.lang.Object
  extended by org.littleshoot.proxy.DefaultProxyCacheManager
All Implemented Interfaces:
ProxyCacheManager

public class DefaultProxyCacheManager
extends Object
implements ProxyCacheManager

Default cache manager for the proxy.


Constructor Summary
DefaultProxyCacheManager()
           
 
Method Summary
 Future<String> cache(org.jboss.netty.handler.codec.http.HttpRequest httpRequest, org.jboss.netty.handler.codec.http.HttpResponse httpResponse, Object response, org.jboss.netty.buffer.ChannelBuffer encoded)
          Caches the request and response object, if appropriate.
 boolean returnCacheHit(org.jboss.netty.handler.codec.http.HttpRequest request, org.jboss.netty.channel.Channel channel)
          Writes a cached response back to the browser if we have a hit in the cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultProxyCacheManager

public DefaultProxyCacheManager()
Method Detail

returnCacheHit

public boolean returnCacheHit(org.jboss.netty.handler.codec.http.HttpRequest request,
                              org.jboss.netty.channel.Channel channel)
Description copied from interface: ProxyCacheManager
Writes a cached response back to the browser if we have a hit in the cache.

Specified by:
returnCacheHit in interface ProxyCacheManager
Parameters:
request - The HTTP request.
channel - The channel the request came in on.
Returns:
true if there was a hit in the cache and we returned a response, otherwise false.

cache

public Future<String> cache(org.jboss.netty.handler.codec.http.HttpRequest httpRequest,
                            org.jboss.netty.handler.codec.http.HttpResponse httpResponse,
                            Object response,
                            org.jboss.netty.buffer.ChannelBuffer encoded)
Description copied from interface: ProxyCacheManager
Caches the request and response object, if appropriate.

Specified by:
cache in interface ProxyCacheManager
Parameters:
httpRequest - The original HTTP request.
httpResponse - The HTTP response.
response - The response object. Can be an HttpResponse or an HttpChunk.
encoded - The encoded response to cache.
Returns:
The future for when the cache operation is executed.


Copyright © 2009-2013 LittleShoot. All Rights Reserved.