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 ofManagedCache
for gRPC backed caches.- Since:
- 9.5
-
-
Field Summary
Fields Modifier and Type Field Description protected GrpcBackedCacheManager
cacheManager
protected String
name
-
Constructor Summary
Constructors Modifier Constructor Description protected
ManagedCacheSupport(String name, GrpcBackedCacheManager cacheManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Long
currentExpireAfterAccessMillis()
@Nullable Long
currentExpireAfterWriteMillis()
@Nullable Integer
currentMaxEntries()
protected @NotNull Optional<com.atlassian.cache.CacheSettings>
getCacheSettings()
@NotNull String
getName()
@NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>>
getStatistics()
boolean
isFlushable()
boolean
isLocal()
boolean
isReplicateAsynchronously()
boolean
isReplicateViaCopy()
boolean
isStatisticsEnabled()
void
setStatistics(boolean enabled)
boolean
updateExpireAfterAccess(long expireAfter, @NotNull TimeUnit timeUnit)
boolean
updateExpireAfterWrite(long expireAfter, @NotNull TimeUnit timeUnit)
boolean
updateMaxEntries(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:
currentExpireAfterAccessMillis
in interfacecom.atlassian.cache.ManagedCache
-
currentExpireAfterWriteMillis
@Nullable public @Nullable Long currentExpireAfterWriteMillis()
- Specified by:
currentExpireAfterWriteMillis
in interfacecom.atlassian.cache.ManagedCache
-
currentMaxEntries
@Nullable public @Nullable Integer currentMaxEntries()
- Specified by:
currentMaxEntries
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateViaCopy
public boolean isReplicateViaCopy()
- Specified by:
isReplicateViaCopy
in interfacecom.atlassian.cache.ManagedCache
-
getName
@NotNull public @NotNull String getName()
- Specified by:
getName
in interfacecom.atlassian.cache.ManagedCache
-
isLocal
public boolean isLocal()
- Specified by:
isLocal
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public boolean isReplicateAsynchronously()
- Specified by:
isReplicateAsynchronously
in interfacecom.atlassian.cache.ManagedCache
-
updateExpireAfterAccess
public boolean updateExpireAfterAccess(long expireAfter, @NotNull @NotNull TimeUnit timeUnit)
- Specified by:
updateExpireAfterAccess
in interfacecom.atlassian.cache.ManagedCache
-
updateExpireAfterWrite
public boolean updateExpireAfterWrite(long expireAfter, @NotNull @NotNull TimeUnit timeUnit)
- Specified by:
updateExpireAfterWrite
in interfacecom.atlassian.cache.ManagedCache
-
updateMaxEntries
public boolean updateMaxEntries(int newValue)
- Specified by:
updateMaxEntries
in interfacecom.atlassian.cache.ManagedCache
-
getStatistics
@NotNull public @NotNull SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
- Specified by:
getStatistics
in interfacecom.atlassian.cache.ManagedCache
-
isStatisticsEnabled
public boolean isStatisticsEnabled()
- Specified by:
isStatisticsEnabled
in interfacecom.atlassian.cache.ManagedCache
-
setStatistics
public void setStatistics(boolean enabled)
- Specified by:
setStatistics
in interfacecom.atlassian.cache.ManagedCache
-
isFlushable
public boolean isFlushable()
- Specified by:
isFlushable
in interfacecom.atlassian.cache.ManagedCache
-
getCacheSettings
@NotNull protected @NotNull Optional<com.atlassian.cache.CacheSettings> getCacheSettings()
-
-