java.lang.Object
io.ebean.cache.TenantAwareCache
- All Implemented Interfaces:
ServerCache
A ServerCache proxy that is tenant aware.
-
Constructor Summary
ConstructorsConstructorDescriptionTenantAwareCache(ServerCache delegate, TenantAwareKey tenantAwareKey) Create given the TenantAwareKey and delegate cache to proxy to. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all entries from the cache.Return the value given the key.Get values for many keys.inthitRatio()Return the hit ratio the cache is currently getting.voidPut the value in the cache with a given id.voidPut all the values in the cache.voidRemove a entry from the cache given its id.voidRemove the entries from the cache given the id values.intsize()Return the number of entries in the cache.statistics(boolean reset) Return statistics for the cache.<T> TReturn the underlying ServerCache that is being delegated to.voidvisit(MetricVisitor visitor) Visit the metrics for the cache.
-
Constructor Details
-
TenantAwareCache
Create given the TenantAwareKey and delegate cache to proxy to.- Parameters:
delegate- The cache to proxy totenantAwareKey- Provides tenant aware keys to use in the cache
-
-
Method Details
-
unwrap
Return the underlying ServerCache that is being delegated to.- Specified by:
unwrapin interfaceServerCache
-
visit
Description copied from interface:ServerCacheVisit the metrics for the cache.- Specified by:
visitin interfaceServerCache
-
get
Description copied from interface:ServerCacheReturn the value given the key.- Specified by:
getin interfaceServerCache
-
put
Description copied from interface:ServerCachePut the value in the cache with a given id.- Specified by:
putin interfaceServerCache
-
remove
Description copied from interface:ServerCacheRemove a entry from the cache given its id.- Specified by:
removein interfaceServerCache
-
clear
public void clear()Description copied from interface:ServerCacheClear all entries from the cache.- Specified by:
clearin interfaceServerCache
-
size
public int size()Description copied from interface:ServerCacheReturn the number of entries in the cache.- Specified by:
sizein interfaceServerCache
-
hitRatio
public int hitRatio()Description copied from interface:ServerCacheReturn the hit ratio the cache is currently getting.- Specified by:
hitRatioin interfaceServerCache
-
statistics
Description copied from interface:ServerCacheReturn statistics for the cache.- Specified by:
statisticsin interfaceServerCache- Parameters:
reset- if true the statistics are reset.
-
getAll
Description copied from interface:ServerCacheGet values for many keys.- Specified by:
getAllin interfaceServerCache
-
putAll
Description copied from interface:ServerCachePut all the values in the cache.- Specified by:
putAllin interfaceServerCache
-
removeAll
Description copied from interface:ServerCacheRemove the entries from the cache given the id values.- Specified by:
removeAllin interfaceServerCache
-