org.apache.shindig.gadgets.http
Interface HttpCache

All Known Implementing Classes:
AbstractHttpCache, DefaultHttpCache

public interface HttpCache

Cache of HttpResponse. Keys are HttpRequest, values are the HttpResponse.


Method Summary
 boolean addResponse(HttpRequest request, HttpResponse response)
          Add a request/response pair to the cache.
 String createKey(HttpRequest request)
          Create a string representation of the cache key.
 HttpResponse getResponse(HttpRequest request)
           
 HttpResponse removeResponse(HttpRequest key)
           
 

Method Detail

getResponse

HttpResponse getResponse(HttpRequest request)

addResponse

boolean addResponse(HttpRequest request,
                    HttpResponse response)
Add a request/response pair to the cache.

Returns:
true if the response was cached, false if the response was not cached.

removeResponse

HttpResponse removeResponse(HttpRequest key)

createKey

String createKey(HttpRequest request)
Create a string representation of the cache key. If two requests are cache equivalent (a response to one request can be used to respond to the other request), their keys are guaranteed to be identical. Identical keys do not guarantee that two requests are cache equivalent.



Copyright © 2007-2012. All Rights Reserved.