Class ManagedCacheSupport
- java.lang.Object
-
- com.atlassian.bamboo.cluster.atlassiancache.ManagedCacheSupport
-
- All Implemented Interfaces:
com.atlassian.cache.ManagedCache
- Direct Known Subclasses:
GrpcBackedCache,GrpcBackedCachedReference
public abstract class ManagedCacheSupport extends Object implements com.atlassian.cache.ManagedCache
Common implementation ofManagedCachefor gRPC backed caches.- Since:
- 9.5
-
-
Field Summary
Fields Modifier and Type Field Description protected GrpcBackedCacheManagercacheManagerprotected Stringname
-
Constructor Summary
Constructors Modifier Constructor Description protectedManagedCacheSupport(String name, GrpcBackedCacheManager cacheManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable LongcurrentExpireAfterAccessMillis()@Nullable LongcurrentExpireAfterWriteMillis()@Nullable IntegercurrentMaxEntries()protected @NotNull Optional<com.atlassian.cache.CacheSettings>getCacheSettings()@NotNull StringgetName()@NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>>getStatistics()booleanisFlushable()booleanisLocal()booleanisReplicateAsynchronously()booleanisReplicateViaCopy()booleanisStatisticsEnabled()voidsetStatistics(boolean enabled)booleanupdateExpireAfterAccess(long expireAfter, @NotNull TimeUnit timeUnit)booleanupdateExpireAfterWrite(long expireAfter, @NotNull TimeUnit timeUnit)booleanupdateMaxEntries(int newValue)
-
-
-
Field Detail
-
name
protected final String name
-
cacheManager
protected final GrpcBackedCacheManager cacheManager
-
-
Constructor Detail
-
ManagedCacheSupport
protected ManagedCacheSupport(String name, GrpcBackedCacheManager cacheManager)
-
-
Method Detail
-
currentExpireAfterAccessMillis
@Nullable public @Nullable Long currentExpireAfterAccessMillis()
- Specified by:
currentExpireAfterAccessMillisin interfacecom.atlassian.cache.ManagedCache
-
currentExpireAfterWriteMillis
@Nullable public @Nullable Long currentExpireAfterWriteMillis()
- Specified by:
currentExpireAfterWriteMillisin interfacecom.atlassian.cache.ManagedCache
-
currentMaxEntries
@Nullable public @Nullable Integer currentMaxEntries()
- Specified by:
currentMaxEntriesin interfacecom.atlassian.cache.ManagedCache
-
isReplicateViaCopy
public boolean isReplicateViaCopy()
- Specified by:
isReplicateViaCopyin interfacecom.atlassian.cache.ManagedCache
-
getName
@NotNull public @NotNull String getName()
- Specified by:
getNamein 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
-
updateExpireAfterAccess
public boolean updateExpireAfterAccess(long expireAfter, @NotNull @NotNull TimeUnit timeUnit)- Specified by:
updateExpireAfterAccessin interfacecom.atlassian.cache.ManagedCache
-
updateExpireAfterWrite
public boolean updateExpireAfterWrite(long expireAfter, @NotNull @NotNull TimeUnit timeUnit)- Specified by:
updateExpireAfterWritein interfacecom.atlassian.cache.ManagedCache
-
updateMaxEntries
public boolean updateMaxEntries(int newValue)
- Specified by:
updateMaxEntriesin interfacecom.atlassian.cache.ManagedCache
-
getStatistics
@NotNull public @NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
- Specified by:
getStatisticsin interfacecom.atlassian.cache.ManagedCache
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
isStatisticsEnabledin interfacecom.atlassian.cache.ManagedCache
-
setStatistics
public void setStatistics(boolean enabled)
- Specified by:
setStatisticsin interfacecom.atlassian.cache.ManagedCache
-
isFlushable
public boolean isFlushable()
- Specified by:
isFlushablein interfacecom.atlassian.cache.ManagedCache
-
getCacheSettings
@NotNull protected @NotNull Optional<com.atlassian.cache.CacheSettings> getCacheSettings()
-
-