Package com.atlassian.confluence.cache
Class DefaultConfluenceCache<K,V>
- java.lang.Object
 - 
- com.atlassian.confluence.cache.DefaultConfluenceCache<K,V>
 
 
- 
- All Implemented Interfaces:
 com.atlassian.cache.Cache<K,V>,com.atlassian.cache.ManagedCache,ConfluenceCache<K,V>
- Direct Known Subclasses:
 DeferredOperationsCache
@Internal public class DefaultConfluenceCache<K,V> extends Object implements ConfluenceCache<K,V>
Default implementation of the ConfluenceCache interface. It federates theManagedCacheandCacheinterfaces, for ease of implementation within confluence. 
- 
- 
Constructor Summary
Constructors Constructor Description DefaultConfluenceCache(com.atlassian.cache.Cache<K,V> delegate) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> listener, boolean required)voidclear()booleancontainsKey(@NonNull K key)@Nullable LongcurrentExpireAfterAccessMillis()@Nullable LongcurrentExpireAfterWriteMillis()@Nullable IntegercurrentMaxEntries()@Nullable Vget(@NonNull K key)@NonNull Vget(@NonNull K key, @NonNull com.atlassian.cache.Supplier<? extends V> supplier)@Nullable com.atlassian.instrumentation.caches.CacheCollectorgetCacheCollector()protected com.atlassian.cache.Cache<K,V>getDelegate()@NonNull Collection<K>getKeys()protected com.atlassian.cache.ManagedCachegetManagedDelegate()@NonNull StringgetName()@NonNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>>getStatistics()booleanisFlushable()booleanisLocal()booleanisReplicateAsynchronously()booleanisReplicateViaCopy()booleanisStatisticsEnabled()voidput(@NonNull K key, @NonNull V value)@Nullable VputIfAbsent(@NonNull K key, @NonNull V value)voidremove(@NonNull K key)booleanremove(@NonNull K key, @NonNull V value)voidremoveAll()voidremoveListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> listener)booleanreplace(@NonNull K key, @NonNull V oldValue, @NonNull V newValue)voidsetStatistics(boolean b)booleanupdateExpireAfterAccess(long expireAfter, @NonNull TimeUnit timeUnit)booleanupdateExpireAfterWrite(long expireAfter, @NonNull TimeUnit timeUnit)booleanupdateMaxEntries(int newValue) 
 - 
 
- 
- 
Method Detail
- 
containsKey
public boolean containsKey(@NonNull K key)
 
- 
getKeys
public @NonNull Collection<K> getKeys()
 
- 
get
public @NonNull V get(@NonNull K key, @NonNull com.atlassian.cache.Supplier<? extends V> supplier)
 
- 
remove
public void remove(@NonNull K key)
 
- 
removeAll
public void removeAll()
 
- 
addListener
public void addListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> listener, boolean required)
 
- 
removeListener
public void removeListener(@NonNull com.atlassian.cache.CacheEntryListener<K,V> listener)
 
- 
clear
public void clear()
- Specified by:
 clearin interfacecom.atlassian.cache.ManagedCache
 
- 
getName
public @NonNull String getName()
 
- 
isFlushable
public boolean isFlushable()
- Specified by:
 isFlushablein interfacecom.atlassian.cache.ManagedCache
 
- 
currentMaxEntries
public @Nullable Integer currentMaxEntries()
- Specified by:
 currentMaxEntriesin interfacecom.atlassian.cache.ManagedCache
 
- 
updateMaxEntries
public boolean updateMaxEntries(int newValue)
- Specified by:
 updateMaxEntriesin interfacecom.atlassian.cache.ManagedCache
 
- 
currentExpireAfterAccessMillis
public @Nullable Long currentExpireAfterAccessMillis()
- Specified by:
 currentExpireAfterAccessMillisin interfacecom.atlassian.cache.ManagedCache
 
- 
updateExpireAfterAccess
public boolean updateExpireAfterAccess(long expireAfter, @NonNull TimeUnit timeUnit)- Specified by:
 updateExpireAfterAccessin interfacecom.atlassian.cache.ManagedCache
 
- 
currentExpireAfterWriteMillis
public @Nullable Long currentExpireAfterWriteMillis()
- Specified by:
 currentExpireAfterWriteMillisin interfacecom.atlassian.cache.ManagedCache
 
- 
updateExpireAfterWrite
public boolean updateExpireAfterWrite(long expireAfter, @NonNull TimeUnit timeUnit)- Specified by:
 updateExpireAfterWritein interfacecom.atlassian.cache.ManagedCache
 
- 
isLocal
public boolean isLocal()
- Specified by:
 isLocalin interfacecom.atlassian.cache.ManagedCache
 
- 
isReplicateAsynchronously
public boolean isReplicateAsynchronously()
- Specified by:
 isReplicateAsynchronouslyin interfacecom.atlassian.cache.ManagedCache
 
- 
isReplicateViaCopy
public boolean isReplicateViaCopy()
- Specified by:
 isReplicateViaCopyin interfacecom.atlassian.cache.ManagedCache
 
- 
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
 isStatisticsEnabledin interfacecom.atlassian.cache.ManagedCache
 
- 
setStatistics
public void setStatistics(boolean b)
- Specified by:
 setStatisticsin interfacecom.atlassian.cache.ManagedCache
 
- 
getStatistics
public @NonNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
- Specified by:
 getStatisticsin interfacecom.atlassian.cache.ManagedCache
 
- 
getCacheCollector
public @Nullable com.atlassian.instrumentation.caches.CacheCollector getCacheCollector()
- Specified by:
 getCacheCollectorin interfacecom.atlassian.cache.ManagedCache
 
- 
getManagedDelegate
protected com.atlassian.cache.ManagedCache getManagedDelegate()
 
 - 
 
 -