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

java.lang.Object
  extended by org.apache.abdera.protocol.util.AbstractMessage
      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, Message, Response, 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  Object 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
nocache_headers, private_headers, smax_age
 
Fields inherited from class org.apache.abdera.protocol.util.AbstractMessage
flags, max_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, Object key, Cache cache)
           
 
Method Summary
 Cache getCache()
           
 long getCachedTime()
           
 long getCurrentAge()
           
 long getFreshnessLifetime()
           
 long getHowStale()
           
 long getInitialAge()
           
 Object getKey()
           
 long getResidentAge()
           
 boolean isFresh()
           
 void release()
          Release the resources associated with this response
 
Methods inherited from class org.apache.abdera.protocol.client.AbstractClientResponse
getCharacterEncoding, getDateHeader, getDocument, getDocument, getDocument, getDocument, getInputStream, getParser, getReader, getReader, getServerDate, initResponseDate, parse_cc, setInputStream
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractResponse
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic, setMaxAge, setMustRevalidate, setNoCache, setNoCacheHeaders, setNoStore, setNoTransform, setPrivate, setPrivateHeaders, setProxyRevalidate, setPublic
 
Methods inherited from class org.apache.abdera.protocol.util.AbstractMessage
check, getCacheControl, getContentLanguage, getContentLocation, getContentType, getDecodedHeader, getDecodedHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform, toggle
 
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
getCharacterEncoding, getDocument, getDocument, getDocument, getDocument, getInputStream, getMethod, getReader, getReader, getServerDate, getUri, setInputStream
 
Methods inherited from interface org.apache.abdera.protocol.Response
getAge, getAllow, getContentLength, getEntityTag, getExpires, getLastModified, getLocation, getNoCacheHeaders, getPrivateHeaders, getSMaxAge, getStatus, getStatusText, getType, isMustRevalidate, isPrivate, isProxyRevalidate, isPublic
 
Methods inherited from interface org.apache.abdera.protocol.Message
getCacheControl, getContentLanguage, getContentLocation, getContentType, getDateHeader, getDecodedHeader, getDecodedHeaders, getHeader, getHeaderNames, getHeaders, getMaxAge, getSlug, isNoCache, isNoStore, isNoTransform
 

Field Detail

key

protected final Object key

cache

protected final Cache cache

initial_age

protected long initial_age
Constructor Detail

CachedResponseBase

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

getKey

public Object getKey()
Specified by:
getKey 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

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


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