org.codehaus.httpcache4j.cache
Class DefaultCacheItem

java.lang.Object
  extended by org.codehaus.httpcache4j.cache.DefaultCacheItem
All Implemented Interfaces:
CacheItem

public class DefaultCacheItem
extends Object
implements CacheItem

This is an internal class, and should not be used by clients.

Author:
Erlend Hamnaberg

Field Summary
protected  org.joda.time.DateTime cachedTime
           
protected  HTTPResponse response
           
protected  int ttl
           
 
Constructor Summary
DefaultCacheItem(HTTPResponse response)
           
DefaultCacheItem(HTTPResponse response, org.joda.time.DateTime cachedTime)
           
 
Method Summary
 boolean equals(Object o)
           
 int getAge(HTTPRequest request)
           
 org.joda.time.DateTime getCachedTime()
           
 HTTPResponse getResponse()
           
 int getTTL()
           
static int getTTL(HTTPResponse response, int defaultTTLinSeconds)
           
 int hashCode()
           
 boolean isStale(HTTPRequest request)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cachedTime

protected org.joda.time.DateTime cachedTime

response

protected HTTPResponse response

ttl

protected int ttl
Constructor Detail

DefaultCacheItem

public DefaultCacheItem(HTTPResponse response)

DefaultCacheItem

public DefaultCacheItem(HTTPResponse response,
                        org.joda.time.DateTime cachedTime)
Method Detail

getTTL

public int getTTL()
Specified by:
getTTL in interface CacheItem

isStale

public boolean isStale(HTTPRequest request)
Specified by:
isStale in interface CacheItem

getAge

public int getAge(HTTPRequest request)
Specified by:
getAge in interface CacheItem

getTTL

public static int getTTL(HTTPResponse response,
                         int defaultTTLinSeconds)

getCachedTime

public org.joda.time.DateTime getCachedTime()
Specified by:
getCachedTime in interface CacheItem

getResponse

public HTTPResponse getResponse()
Specified by:
getResponse in interface CacheItem

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2008-2011. All Rights Reserved.