Class ManagedHybridCacheSupport

java.lang.Object
com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
All Implemented Interfaces:
com.atlassian.cache.ManagedCache
Direct Known Subclasses:
HazelcastAsyncHybridCache, HazelcastAsyncHybridCachedReference, HazelcastHybridCache, HazelcastHybridCachedReference

public abstract class ManagedHybridCacheSupport extends Object implements com.atlassian.cache.ManagedCache
Common implementation of ManagedCache methods for hybrid caches and cached references.
Since:
2.4.0
  • Field Details

  • Constructor Details

  • Method Details

    • currentExpireAfterAccessMillis

      public Long currentExpireAfterAccessMillis()
      Specified by:
      currentExpireAfterAccessMillis in interface com.atlassian.cache.ManagedCache
    • currentExpireAfterWriteMillis

      public Long currentExpireAfterWriteMillis()
      Specified by:
      currentExpireAfterWriteMillis in interface com.atlassian.cache.ManagedCache
    • currentMaxEntries

      public Integer currentMaxEntries()
      Specified by:
      currentMaxEntries in interface com.atlassian.cache.ManagedCache
    • getName

      @Nonnull public String getName()
      Specified by:
      getName in interface com.atlassian.cache.ManagedCache
    • isLocal

      public boolean isLocal()
      Specified by:
      isLocal in interface com.atlassian.cache.ManagedCache
    • isReplicateViaCopy

      public boolean isReplicateViaCopy()
      Specified by:
      isReplicateViaCopy in interface com.atlassian.cache.ManagedCache
    • updateExpireAfterAccess

      public boolean updateExpireAfterAccess(long expireAfter, @Nonnull TimeUnit timeUnit)
      Specified by:
      updateExpireAfterAccess in interface com.atlassian.cache.ManagedCache
    • updateExpireAfterWrite

      public boolean updateExpireAfterWrite(long expireAfter, @Nonnull TimeUnit timeUnit)
      Specified by:
      updateExpireAfterWrite in interface com.atlassian.cache.ManagedCache
    • updateMaxEntries

      public boolean updateMaxEntries(int newValue)
      Specified by:
      updateMaxEntries in interface com.atlassian.cache.ManagedCache
    • getLocalCache

      protected abstract com.atlassian.cache.ManagedCache getLocalCache()
    • getStatistics

      @Nonnull public SortedMap<com.atlassian.cache.CacheStatisticsKey,Supplier<Long>> getStatistics()
      For hybrid caches, we can just get the cache stats from the underlying local cache.
      Specified by:
      getStatistics in interface com.atlassian.cache.ManagedCache
    • isStatisticsEnabled

      public boolean isStatisticsEnabled()
      Specified by:
      isStatisticsEnabled in interface com.atlassian.cache.ManagedCache
    • setStatistics

      public void setStatistics(boolean enabled)
      Specified by:
      setStatistics in interface com.atlassian.cache.ManagedCache