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

java.lang.Object
  extended by org.apache.abdera.protocol.client.cache.CacheBase
All Implemented Interfaces:
Cache
Direct Known Subclasses:
InMemoryCache

public abstract class CacheBase
extends java.lang.Object
implements Cache


Field Summary
protected  Abdera abdera
           
 
Constructor Summary
protected CacheBase(Abdera abdera)
           
 
Method Summary
protected abstract  void add(CacheKey key, CachedResponse response)
           
protected abstract  CachedResponse createCachedResponse(ClientResponse response, CacheKey key)
           
 CachedResponse get(java.lang.String uri, RequestOptions options)
           
protected abstract  CacheKey getCacheKey(java.lang.String uri, RequestOptions options, ClientResponse response)
           
 CacheDisposition getDisposition(java.lang.String uri, RequestOptions options)
           
 CachedResponse getIfFreshEnough(java.lang.String uri, RequestOptions options)
           
 void remove(java.lang.String uri, RequestOptions options)
           
 ClientResponse update(RequestOptions options, ClientResponse response, ClientResponse cached_response)
           
 
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.cache.Cache
clear, get, getCacheKey, remove
 

Field Detail

abdera

protected final Abdera abdera
Constructor Detail

CacheBase

protected CacheBase(Abdera abdera)
Method Detail

get

public CachedResponse get(java.lang.String uri,
                          RequestOptions options)
Specified by:
get in interface Cache

getDisposition

public CacheDisposition getDisposition(java.lang.String uri,
                                       RequestOptions options)
Specified by:
getDisposition in interface Cache

remove

public void remove(java.lang.String uri,
                   RequestOptions options)
Specified by:
remove in interface Cache

add

protected abstract void add(CacheKey key,
                            CachedResponse response)

createCachedResponse

protected abstract CachedResponse createCachedResponse(ClientResponse response,
                                                       CacheKey key)
                                                throws java.io.IOException
Throws:
java.io.IOException

getCacheKey

protected abstract CacheKey getCacheKey(java.lang.String uri,
                                        RequestOptions options,
                                        ClientResponse response)

getIfFreshEnough

public CachedResponse getIfFreshEnough(java.lang.String uri,
                                       RequestOptions options)
Specified by:
getIfFreshEnough in interface Cache

update

public ClientResponse update(RequestOptions options,
                             ClientResponse response,
                             ClientResponse cached_response)
Specified by:
update in interface Cache