org.w3c.www.protocol.http.cache
Class SimpleCacheValidator

java.lang.Object
  extended by org.w3c.www.protocol.http.cache.CacheValidator
      extended by org.w3c.www.protocol.http.cache.SimpleCacheValidator
Direct Known Subclasses:
SimplePushCacheValidator

public class SimpleCacheValidator
extends CacheValidator


Constructor Summary
SimpleCacheValidator()
           
 
Method Summary
 boolean checkStaleness(CachedResource cr)
          Check if the request is stale or not
 boolean isValid(CachedResource cr, Request request)
          Is the currently cached version usable to answer the given request ?
 void revalidateResource(CachedResource cr, Request request, Reply reply)
          reset all the ages after a revalidation
 void updateExpirationInfo(CachedResource cr, Request request, Reply reply)
          Update the expiration information on a cached resource, even if it was not used.
 
Methods inherited from class org.w3c.www.protocol.http.cache.CacheValidator
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCacheValidator

public SimpleCacheValidator()
Method Detail

checkStaleness

public boolean checkStaleness(CachedResource cr)
Check if the request is stale or not

Specified by:
checkStaleness in class CacheValidator
Returns:
a boolean, false if the resource is still valid true it if needs a revalidation.

isValid

public boolean isValid(CachedResource cr,
                       Request request)
Is the currently cached version usable to answer the given request ?

Specified by:
isValid in class CacheValidator
Returns:
A boolean, true if we are able to generate a valid answer to this request by the perform method, false otherwise (the resource needs to be refreshed).

updateExpirationInfo

public void updateExpirationInfo(CachedResource cr,
                                 Request request,
                                 Reply reply)
Update the expiration information on a cached resource, even if it was not used. Note that it is the right place to update also information for other cache behaviour used by the sweeper.

Specified by:
updateExpirationInfo in class CacheValidator
Parameters:
cr, - the CachedResource we are upgrading.
request, - the Request
reply, - the Reply

revalidateResource

public void revalidateResource(CachedResource cr,
                               Request request,
                               Reply reply)
reset all the ages after a revalidation

Specified by:
revalidateResource in class CacheValidator
Parameters:
cr, - the CachedResource we are upgrading.
request, - the Request
reply, - the Reply