@Internal
public interface ManagedCache
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the cache.
|
Long |
currentExpireAfterAccessMillis() |
Long |
currentExpireAfterWriteMillis() |
Integer |
currentMaxEntries() |
String |
getName()
The name of the cache, uniquely identifies this cache.
|
SortedMap<CacheStatisticsKey,com.atlassian.util.concurrent.Supplier<Long>> |
getStatistics()
Get usage statistics for the cache.
|
boolean |
isFlushable()
Returns true if this cache can be safely flushed any time.
|
boolean |
isLocal() |
boolean |
isReplicateAsynchronously() |
boolean |
isReplicateViaCopy() |
boolean |
isStatisticsEnabled() |
boolean |
updateExpireAfterAccess(long expireAfter,
TimeUnit timeUnit)
Attempts to update the hint regarding how long entries that should be held in the cache, after last access.
|
boolean |
updateExpireAfterWrite(long expireAfter,
TimeUnit timeUnit)
Attempts to update the hint regarding how long entries that should be held in the cache, after last write.
|
boolean |
updateMaxEntries(int newValue)
Attempts to update the hint regarding the maximum number of entries that should be cached at any time.
|
void clear()
@Nonnull String getName()
boolean isFlushable()
This method is used by CacheManager.flushCaches() to only flush
caches that can be safely flushed. clear() ignores this value.
@Nullable Integer currentMaxEntries()
boolean updateMaxEntries(int newValue)
newValue - the new hint value@Nullable Long currentExpireAfterAccessMillis()
boolean updateExpireAfterAccess(long expireAfter,
@Nonnull
TimeUnit timeUnit)
expireAfter - Time to retain entries for since their last access.timeUnit - The TimeUnit for the time@Nullable Long currentExpireAfterWriteMillis()
boolean updateExpireAfterWrite(long expireAfter,
@Nonnull
TimeUnit timeUnit)
expireAfter - Time to retain entries for since their last write.timeUnit - The TimeUnit for the timeboolean isLocal()
boolean isReplicateAsynchronously()
boolean isReplicateViaCopy()
boolean isStatisticsEnabled()
@Nonnull SortedMap<CacheStatisticsKey,com.atlassian.util.concurrent.Supplier<Long>> getStatistics()
labels.
Providing statistics is an optional feature and no assumptions should be made by the caller about
which (if any) statistics will be returned.Copyright © 2015 Atlassian. All rights reserved.