Class CachedMapFacade<V extends Cacheable>
- java.lang.Object
- 
- edu.uiuc.ncsa.security.core.cache.CachedMapFacade<V>
 
- 
- All Implemented Interfaces:
- Store<V>,- Map<Identifier,V>
 
 public abstract class CachedMapFacade<V extends Cacheable> extends Object implements Store<V> A Facade for a map that is backed by a cache. Since all stores are logically maps as well, this can be used to cache any store.
 Note: This persists immediately on put, so there are lazy reads but not writes. Gets to this are checked against the cache. If found, then that is returned, if not, the store is checked. Invoking put will either add a new item to the store or over-write an existing one with the same identifier. There is consequently a save operation implied with it.UsageExtend this to the correct parameters. Implement any interfaces you need for storage then set the backing store to be your real store and use this class everyplace you would normally have your store.
 This will remove from the store immediately as well.Created by Jeff Gaynor 
 on Nov 12, 2010 at 11:31:47 AM
- 
- 
Field Summary- 
Fields inherited from interface edu.uiuc.ncsa.security.core.StoreVERSION_TAG
 
- 
 - 
Constructor SummaryConstructors Constructor Description CachedMapFacade()CachedMapFacade(Store<V> theStore)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(Object key)booleancontainsValue(Object value)Set<Map.Entry<Identifier,V>>entrySet()Vget(Object key)CachegetCache()Store<V>getTheStore()booleanhasStore()booleanisEmpty()Set<Identifier>keySet()Vput(Identifier key, V cacheable)voidputAll(Map<? extends Identifier,? extends V> m)Vremove(Object key)voidsetCache(Cache cache)voidsetTheStore(Store<V> theStore)intsize()Collection<V>values()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.util.Mapcompute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
 
- 
 
- 
- 
- 
Method Detail- 
getCachepublic Cache getCache() 
 - 
setCachepublic void setCache(Cache cache) 
 - 
hasStorepublic boolean hasStore() 
 - 
clearpublic void clear() - Specified by:
- clearin interface- Map<Identifier,V extends Cacheable>
 
 - 
isEmptypublic boolean isEmpty() - Specified by:
- isEmptyin interface- Map<Identifier,V extends Cacheable>
 
 - 
containsKeypublic boolean containsKey(Object key) - Specified by:
- containsKeyin interface- Map<Identifier,V extends Cacheable>
 
 - 
containsValuepublic boolean containsValue(Object value) - Specified by:
- containsValuein interface- Map<Identifier,V extends Cacheable>
 
 - 
putpublic V put(Identifier key, V cacheable) - Specified by:
- putin interface- Map<Identifier,V extends Cacheable>
 
 - 
removepublic V remove(Object key) - Specified by:
- removein interface- Map<Identifier,V extends Cacheable>
 
 - 
putAllpublic void putAll(Map<? extends Identifier,? extends V> m) - Specified by:
- putAllin interface- Map<Identifier,V extends Cacheable>
 
 - 
entrySetpublic Set<Map.Entry<Identifier,V>> entrySet() - Specified by:
- entrySetin interface- Map<Identifier,V extends Cacheable>
 
 - 
sizepublic int size() - Specified by:
- sizein interface- Map<Identifier,V extends Cacheable>
 
 - 
keySetpublic Set<Identifier> keySet() - Specified by:
- keySetin interface- Map<Identifier,V extends Cacheable>
 
 - 
valuespublic Collection<V> values() - Specified by:
- valuesin interface- Map<Identifier,V extends Cacheable>
 
 
- 
 
-