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

java.lang.Object
  extended by org.apache.http.impl.client.cache.CacheInvalidator

@ThreadSafe
public class CacheInvalidator
extends Object

Given a particular HttpRequest, flush any cache entries that this request would invalidate.

Since:
4.1

Constructor Summary
CacheInvalidator(URIExtractor uriExtractor, HttpCache<CacheEntry> cache)
          Create a new CacheInvalidator for a given HttpCache and URIExtractor.
 
Method Summary
protected  boolean flushAbsoluteUriFromSameHost(URL reqURL, String uri)
           
 void flushInvalidatedCacheEntries(HttpHost host, HttpRequest req)
          Remove cache entries from the cache that are no longer fresh or have been invalidated in some way.
protected  void flushRelativeUriFromSameHost(URL reqURL, String relUri)
           
protected  void flushUriIfSameHost(URL requestURL, URL targetURL)
           
protected  boolean requestShouldNotBeCached(HttpRequest req)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheInvalidator

public CacheInvalidator(URIExtractor uriExtractor,
                        HttpCache<CacheEntry> cache)
Create a new CacheInvalidator for a given HttpCache and URIExtractor.

Parameters:
uriExtractor - Provides identifiers for the keys to store cache entries
cache - the cache to store items away in
Method Detail

flushInvalidatedCacheEntries

public void flushInvalidatedCacheEntries(HttpHost host,
                                         HttpRequest req)
Remove cache entries from the cache that are no longer fresh or have been invalidated in some way.

Parameters:
host - The backend host we are talking to
req - The HttpRequest to that host

flushUriIfSameHost

protected void flushUriIfSameHost(URL requestURL,
                                  URL targetURL)
                           throws HttpCacheOperationException
Throws:
HttpCacheOperationException

flushRelativeUriFromSameHost

protected void flushRelativeUriFromSameHost(URL reqURL,
                                            String relUri)
                                     throws HttpCacheOperationException
Throws:
HttpCacheOperationException

flushAbsoluteUriFromSameHost

protected boolean flushAbsoluteUriFromSameHost(URL reqURL,
                                               String uri)
                                        throws HttpCacheOperationException
Throws:
HttpCacheOperationException

requestShouldNotBeCached

protected boolean requestShouldNotBeCached(HttpRequest req)


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.