@Internal public class DefaultConfluenceCache<K,V> extends Object implements ConfluenceCache<K,V>
ManagedCache
and Cache
interfaces, for ease of implementation within confluence.Constructor and Description |
---|
DefaultConfluenceCache(com.atlassian.cache.Cache<K,V> delegate) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(com.atlassian.cache.CacheEntryListener<K,V> listener,
boolean required) |
void |
clear() |
boolean |
containsKey(K key) |
Long |
currentExpireAfterAccessMillis() |
Long |
currentExpireAfterWriteMillis() |
Integer |
currentMaxEntries() |
V |
get(K key) |
V |
get(K key,
com.atlassian.cache.Supplier<? extends V> supplier) |
com.atlassian.instrumentation.caches.CacheCollector |
getCacheCollector() |
protected com.atlassian.cache.Cache<K,V> |
getDelegate() |
Collection<K> |
getKeys() |
protected com.atlassian.cache.ManagedCache |
getManagedDelegate() |
String |
getName() |
SortedMap<com.atlassian.cache.CacheStatisticsKey,com.atlassian.util.concurrent.Supplier<Long>> |
getStatistics() |
boolean |
isFlushable() |
boolean |
isLocal() |
boolean |
isReplicateAsynchronously() |
boolean |
isReplicateViaCopy() |
boolean |
isStatisticsEnabled() |
void |
put(K key,
V value) |
V |
putIfAbsent(K key,
V value) |
void |
remove(K key) |
boolean |
remove(K key,
V value) |
void |
removeAll() |
void |
removeListener(com.atlassian.cache.CacheEntryListener<K,V> listener) |
boolean |
replace(K key,
V oldValue,
V newValue) |
void |
setStatistics(boolean b) |
void |
setTimeToLive(long timeToLive,
TimeUnit timeUnit)
Update the time to live.
|
boolean |
updateExpireAfterAccess(long expireAfter,
TimeUnit timeUnit) |
boolean |
updateExpireAfterWrite(long expireAfter,
TimeUnit timeUnit) |
boolean |
updateMaxEntries(int newValue) |
@Nonnull public Collection<K> getKeys()
@Nonnull public V get(@Nonnull K key, @Nonnull com.atlassian.cache.Supplier<? extends V> supplier)
public void removeAll()
public void addListener(@Nonnull com.atlassian.cache.CacheEntryListener<K,V> listener, boolean required)
public void removeListener(@Nonnull com.atlassian.cache.CacheEntryListener<K,V> listener)
public void clear()
clear
in interface com.atlassian.cache.ManagedCache
public boolean isFlushable()
isFlushable
in interface com.atlassian.cache.ManagedCache
@Nullable public Integer currentMaxEntries()
currentMaxEntries
in interface com.atlassian.cache.ManagedCache
public boolean updateMaxEntries(int newValue)
updateMaxEntries
in interface com.atlassian.cache.ManagedCache
@Nullable public Long currentExpireAfterAccessMillis()
currentExpireAfterAccessMillis
in interface com.atlassian.cache.ManagedCache
public boolean updateExpireAfterAccess(long expireAfter, @Nonnull TimeUnit timeUnit)
updateExpireAfterAccess
in interface com.atlassian.cache.ManagedCache
@Nullable public Long currentExpireAfterWriteMillis()
currentExpireAfterWriteMillis
in interface com.atlassian.cache.ManagedCache
public boolean updateExpireAfterWrite(long expireAfter, @Nonnull TimeUnit timeUnit)
updateExpireAfterWrite
in interface com.atlassian.cache.ManagedCache
public boolean isLocal()
isLocal
in interface com.atlassian.cache.ManagedCache
public boolean isReplicateAsynchronously()
isReplicateAsynchronously
in interface com.atlassian.cache.ManagedCache
public boolean isReplicateViaCopy()
isReplicateViaCopy
in interface com.atlassian.cache.ManagedCache
public boolean isStatisticsEnabled()
isStatisticsEnabled
in interface com.atlassian.cache.ManagedCache
public void setStatistics(boolean b)
setStatistics
in interface com.atlassian.cache.ManagedCache
@Nonnull public SortedMap<com.atlassian.cache.CacheStatisticsKey,com.atlassian.util.concurrent.Supplier<Long>> getStatistics()
getStatistics
in interface com.atlassian.cache.ManagedCache
@Nullable public com.atlassian.instrumentation.caches.CacheCollector getCacheCollector()
getCacheCollector
in interface com.atlassian.cache.ManagedCache
public void setTimeToLive(long timeToLive, TimeUnit timeUnit)
ConfigurableCache
TimeUnit.SECONDS
.setTimeToLive
in interface ConfigurableCache<K,V>
timeToLive
- valuetimeUnit
- unit of timeprotected com.atlassian.cache.ManagedCache getManagedDelegate()
Copyright © 2003–2017 Atlassian. All rights reserved.