java.lang.Object
io.ebean.cache.TenantAwareCache
- All Implemented Interfaces:
ServerCache
A ServerCache proxy that is tenant aware.
-
Constructor Summary
ConstructorDescriptionTenantAwareCache
(ServerCache delegate, TenantAwareKey tenantAwareKey) Create given the TenantAwareKey and delegate cache to proxy to. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all entries from the cache.Return the value given the key.Get values for many keys.int
hitRatio()
Return the hit ratio the cache is currently getting.void
Put the value in the cache with a given id.void
Put all the values in the cache.void
Remove a entry from the cache given its id.void
Remove the entries from the cache given the id values.int
size()
Return the number of entries in the cache.statistics
(boolean reset) Return statistics for the cache.<T> T
Return the underlying ServerCache that is being delegated to.void
visit
(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:
unwrap
in interfaceServerCache
-
visit
Description copied from interface:ServerCache
Visit the metrics for the cache.- Specified by:
visit
in interfaceServerCache
-
get
Description copied from interface:ServerCache
Return the value given the key.- Specified by:
get
in interfaceServerCache
-
put
Description copied from interface:ServerCache
Put the value in the cache with a given id.- Specified by:
put
in interfaceServerCache
-
remove
Description copied from interface:ServerCache
Remove a entry from the cache given its id.- Specified by:
remove
in interfaceServerCache
-
clear
public void clear()Description copied from interface:ServerCache
Clear all entries from the cache.- Specified by:
clear
in interfaceServerCache
-
size
public int size()Description copied from interface:ServerCache
Return the number of entries in the cache.- Specified by:
size
in interfaceServerCache
-
hitRatio
public int hitRatio()Description copied from interface:ServerCache
Return the hit ratio the cache is currently getting.- Specified by:
hitRatio
in interfaceServerCache
-
statistics
Description copied from interface:ServerCache
Return statistics for the cache.- Specified by:
statistics
in interfaceServerCache
- Parameters:
reset
- if true the statistics are reset.
-
getAll
Description copied from interface:ServerCache
Get values for many keys.- Specified by:
getAll
in interfaceServerCache
-
putAll
Description copied from interface:ServerCache
Put all the values in the cache.- Specified by:
putAll
in interfaceServerCache
-
removeAll
Description copied from interface:ServerCache
Remove the entries from the cache given the id values.- Specified by:
removeAll
in interfaceServerCache
-