Class DefaultHalResourceCache
- java.lang.Object
 - 
- org.camunda.bpm.engine.rest.hal.cache.DefaultHalResourceCache
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected Map<String,HalResourceCacheEntry>cacheprotected intcapacitystatic Comparator<HalResourceCacheEntry>COMPARATORprotected longsecondsToLive 
- 
Constructor Summary
Constructors Constructor Description DefaultHalResourceCache()DefaultHalResourceCache(int capacity, long secondsToLive) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy cache.protected voidensureCapacityLimit()protected booleanexpired(HalResourceCacheEntry entry)Objectget(String id)Get a resource by id.intgetCapacity()longgetSecondsToLive()voidput(String id, Object resource)Put a resource into the cache.voidremove(String id)voidsetCapacity(int capacity)voidsetSecondsToLive(long secondsToLive)intsize() 
 - 
 
- 
- 
Field Detail
- 
COMPARATOR
public static final Comparator<HalResourceCacheEntry> COMPARATOR
 
- 
capacity
protected int capacity
 
- 
secondsToLive
protected long secondsToLive
 
- 
cache
protected Map<String,HalResourceCacheEntry> cache
 
 - 
 
- 
Method Detail
- 
getCapacity
public int getCapacity()
 
- 
setCapacity
public void setCapacity(int capacity)
 
- 
getSecondsToLive
public long getSecondsToLive()
 
- 
setSecondsToLive
public void setSecondsToLive(long secondsToLive)
 
- 
size
public int size()
 
- 
put
public void put(String id, Object resource)
Description copied from interface:CachePut a resource into the cache. 
- 
remove
public void remove(String id)
 
- 
destroy
public void destroy()
Description copied from interface:CacheDestroy cache. 
- 
ensureCapacityLimit
protected void ensureCapacityLimit()
 
- 
expired
protected boolean expired(HalResourceCacheEntry entry)
 
 - 
 
 -