org.apache.abdera.protocol.client.cache
Class CachedResponseBase

java.lang.Object
  extended by org.apache.abdera.protocol.util.AbstractResponse
      extended by org.apache.abdera.protocol.client.AbstractClientResponse
          extended by org.apache.abdera.protocol.client.cache.CachedResponseBase
All Implemented Interfaces:
CachedResponse, ClientResponse, Response, ResponseInfo, ProtocolConstants
Direct Known Subclasses:
InMemoryCachedResponse

public abstract class CachedResponseBase
extends AbstractClientResponse
implements CachedResponse


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.abdera.protocol.Response
Response.ResponseType
 
Field Summary
protected  Cache cache
           
protected  long initial_age
           
protected  CacheKey key
           
 
Fields inherited from class org.apache.abdera.protocol.client.AbstractClientResponse
abdera, in, now, parser, response_date
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractResponse
flags, max_age, nocache_headers, private_headers, smax_age
 
Fields inherited from interface org.apache.abdera.protocol.util.ProtocolConstants
NOCACHE, NOSTORE, NOTRANSFORM, ONLYIFCACHED, PRIVATE, PROXYREVALIDATE, PUBLIC, REVALIDATE
 
Constructor Summary
protected CachedResponseBase(Abdera abdera, CacheKey key, Cache cache)
           
 
Method Summary
 CacheKey geKey()
           
 Cache getCache()
           
 long getCachedTime()
           
 long getCurrentAge()
           
 CacheDisposition getDisposition()
           
 long getFreshnessLifetime()
           
 long getHowStale()
           
 long getInitialAge()
           
 long getResidentAge()
           
 boolean isFresh()
           
 void release()
          Release the resources associated with this response
 
Methods inherited from class org.apache.abdera.protocol.client.AbstractClientResponse
getDocument, getDocument, getDocument, getDocument, getInputStream, getParser, getServerDate, parse_cc, setInputStream
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractResponse
getAge, getAllow, getCacheControl, getContentLanguage, getContentLength, getContentLocation, getContentType, getEntityTag, getExpires, getLastModified, getLocation, getMaxAge, getNoCacheHeaders, getPrivateHeaders, getSlug, getSMaxAge, getType, getUriHeader, isMustRevalidate, isNoCache, isNoStore, isNoTransform, isPrivate, isProxyRevalidate, isPublic, setMaxAge, setMustRevalidate, setNoCache, setNoCacheHeaders, setNoStore, setNoTransform, setPrivate, setPrivateHeaders, setProxyRevalidate, setPublic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.protocol.client.ClientResponse
getDocument, getDocument, getDocument, getDocument, getInputStream, getMethod, getServerDate, getUri, setInputStream
 
Methods inherited from interface org.apache.abdera.protocol.Response
getAge, getAllow, getCacheControl, getContentLanguage, getContentLength, getContentLocation, getContentType, getDateHeader, getExpires, getHeader, getHeaderNames, getHeaders, getHeaders, getLastModified, getLocation, getMaxAge, getNoCacheHeaders, getPrivateHeaders, getSlug, getSMaxAge, getStatus, getStatusText, getType, getUriHeader, isMustRevalidate, isNoCache, isNoStore, isNoTransform, isPrivate, isProxyRevalidate, isPublic
 
Methods inherited from interface org.apache.abdera.protocol.ResponseInfo
getEntityTag
 

Field Detail

key

protected final CacheKey key

cache

protected final Cache cache

initial_age

protected long initial_age
Constructor Detail

CachedResponseBase

protected CachedResponseBase(Abdera abdera,
                             CacheKey key,
                             Cache cache)
Method Detail

geKey

public CacheKey geKey()
Specified by:
geKey in interface CachedResponse

getCache

public Cache getCache()
Specified by:
getCache in interface CachedResponse

release

public void release()
Description copied from interface: ClientResponse
Release the resources associated with this response

Specified by:
release in interface ClientResponse

getDisposition

public CacheDisposition getDisposition()

getInitialAge

public long getInitialAge()
Specified by:
getInitialAge in interface CachedResponse

getCachedTime

public long getCachedTime()
Specified by:
getCachedTime in interface CachedResponse

getResidentAge

public long getResidentAge()
Specified by:
getResidentAge in interface CachedResponse

getCurrentAge

public long getCurrentAge()
Specified by:
getCurrentAge in interface CachedResponse

getFreshnessLifetime

public long getFreshnessLifetime()
Specified by:
getFreshnessLifetime in interface CachedResponse

getHowStale

public long getHowStale()
Specified by:
getHowStale in interface CachedResponse

isFresh

public boolean isFresh()
Specified by:
isFresh in interface CachedResponse