Class AsyncReplicationCache<K,​V>

  • All Implemented Interfaces:
    com.atlassian.cache.Cache<K,​V>, com.atlassian.cache.ManagedCache

    public final class AsyncReplicationCache<K,​V>
    extends com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
    An implementation of Cache that is backed by a local cache, and which publishes changes to the cache entries via invalidations and replications.
    Since:
    8.4
    See Also:
    AsyncInvalidationCache
    • Field Summary

      • Fields inherited from class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport

        cacheManager, name
    • Constructor Detail

      • AsyncReplicationCache

        public AsyncReplicationCache​(com.atlassian.cache.Cache<K,​V> localCache,
                                     com.atlassian.cache.ManagedCache localManagedCache,
                                     CacheInvalidator<K> invalidator,
                                     CacheReplicator<K,​V> replicator)
    • Method Detail

      • isReplicateViaCopy

        public boolean isReplicateViaCopy()
        Specified by:
        isReplicateViaCopy in interface com.atlassian.cache.ManagedCache
        Overrides:
        isReplicateViaCopy in class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
      • onPut

        protected void onPut​(K key,
                             V value)
      • onRemove

        protected void onRemove​(K key)
      • onClear

        protected void onClear()
      • clear

        public void clear()
        Specified by:
        clear in interface com.atlassian.cache.ManagedCache
      • isReplicateAsynchronously

        public final boolean isReplicateAsynchronously()
      • put

        public void put​(K key,
                        V value)
        Specified by:
        put in interface com.atlassian.cache.Cache<K,​V>
      • putIfAbsent

        public @Nullable V putIfAbsent​(K key,
                                       V value)
        Specified by:
        putIfAbsent in interface com.atlassian.cache.Cache<K,​V>
      • remove

        public void remove​(K key)
        Specified by:
        remove in interface com.atlassian.cache.Cache<K,​V>
      • remove

        public boolean remove​(K key,
                              V value)
        Specified by:
        remove in interface com.atlassian.cache.Cache<K,​V>
      • removeAll

        public void removeAll()
        Specified by:
        removeAll in interface com.atlassian.cache.Cache<K,​V>
      • replace

        public boolean replace​(K key,
                               V oldValue,
                               V newValue)
        Specified by:
        replace in interface com.atlassian.cache.Cache<K,​V>
      • isLocal

        public boolean isLocal()
        Specified by:
        isLocal in interface com.atlassian.cache.ManagedCache
        Overrides:
        isLocal in class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
      • getLocalCache

        protected com.atlassian.cache.ManagedCache getLocalCache()
        Specified by:
        getLocalCache in class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
      • isFlushable

        public boolean isFlushable()
        Specified by:
        isFlushable in interface com.atlassian.cache.ManagedCache
      • containsKey

        public boolean containsKey​(K key)
        Specified by:
        containsKey in interface com.atlassian.cache.Cache<K,​V>
      • getKeys

        public Collection<K> getKeys()
        Specified by:
        getKeys in interface com.atlassian.cache.Cache<K,​V>
      • get

        public @Nullable V get​(K key)
        Specified by:
        get in interface com.atlassian.cache.Cache<K,​V>
      • get

        public V get​(K key,
                     com.atlassian.cache.Supplier<? extends V> valueSupplier)
        Specified by:
        get in interface com.atlassian.cache.Cache<K,​V>
      • getBulk

        public Map<K,​V> getBulk​(Set<K> keys,
                                      Function<Set<K>,​Map<K,​V>> valuesSupplier)
        Specified by:
        getBulk in interface com.atlassian.cache.Cache<K,​V>
      • addListener

        public void addListener​(com.atlassian.cache.CacheEntryListener<K,​V> listener,
                                boolean includeValues)
        Specified by:
        addListener in interface com.atlassian.cache.Cache<K,​V>
      • removeListener

        public void removeListener​(com.atlassian.cache.CacheEntryListener<K,​V> listener)
        Specified by:
        removeListener in interface com.atlassian.cache.Cache<K,​V>