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

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

public abstract class InMemoryCache
extends CacheBase


Field Summary
protected  java.util.Map<CacheKey,CachedResponse> cache
           
protected  java.util.Map<java.lang.String,SimpleCacheKey> keycache
           
 
Fields inherited from class org.apache.abdera.protocol.client.cache.CacheBase
abdera
 
Constructor Summary
protected InMemoryCache(Abdera abdera)
           
 
Method Summary
protected  void add(CacheKey key, CachedResponse response)
           
 void clear()
           
protected  CachedResponse createCachedResponse(ClientResponse response, CacheKey key)
           
 CachedResponse get(CacheKey key)
           
 CacheKey getCacheKey(java.lang.String uri, RequestOptions options)
           
 CacheKey getCacheKey(java.lang.String uri, RequestOptions options, ClientResponse response)
           
 void remove(CacheKey key)
           
protected  void setMap(java.util.Map<CacheKey,CachedResponse> map)
           
 
Methods inherited from class org.apache.abdera.protocol.client.cache.CacheBase
get, getDisposition, getIfFreshEnough, remove, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

protected transient java.util.Map<CacheKey,CachedResponse> cache

keycache

protected final transient java.util.Map<java.lang.String,SimpleCacheKey> keycache
Constructor Detail

InMemoryCache

protected InMemoryCache(Abdera abdera)
Method Detail

setMap

protected void setMap(java.util.Map<CacheKey,CachedResponse> map)

createCachedResponse

protected CachedResponse createCachedResponse(ClientResponse response,
                                              CacheKey key)
                                       throws java.io.IOException
Specified by:
createCachedResponse in class CacheBase
Throws:
java.io.IOException

clear

public void clear()

get

public CachedResponse get(CacheKey key)

getCacheKey

public CacheKey getCacheKey(java.lang.String uri,
                            RequestOptions options)

getCacheKey

public CacheKey getCacheKey(java.lang.String uri,
                            RequestOptions options,
                            ClientResponse response)
Specified by:
getCacheKey in class CacheBase

remove

public void remove(CacheKey key)

add

protected void add(CacheKey key,
                   CachedResponse response)
Specified by:
add in class CacheBase