Class AsyncReplicationCache<K,V>
- java.lang.Object
-
- com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
- com.atlassian.cache.hazelcast.asyncinvalidation.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.ManagedHybridCacheSupportAn implementation ofCachethat is backed by a local cache, and which publishes changes to the cache entries via invalidations and replications.- Since:
- 8.4
- See Also:
AsyncInvalidationCache
-
-
Constructor Summary
Constructors Constructor Description AsyncReplicationCache(com.atlassian.cache.Cache<K,V> localCache, com.atlassian.cache.ManagedCache localManagedCache, CacheInvalidator<K> invalidator, CacheReplicator<K,V> replicator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)voidclear()booleancontainsKey(K key)@Nullable Vget(K key)Vget(K key, com.atlassian.cache.Supplier<? extends V> valueSupplier)Map<K,V>getBulk(Set<K> keys, Function<Set<K>,Map<K,V>> valuesSupplier)Collection<K>getKeys()protected com.atlassian.cache.ManagedCachegetLocalCache()booleanisFlushable()booleanisLocal()booleanisReplicateAsynchronously()booleanisReplicateViaCopy()protected voidonClear()protected voidonPut(K key, V value)protected voidonRemove(K key)voidput(K key, V value)@Nullable VputIfAbsent(K key, V value)voidremove(K key)booleanremove(K key, V value)voidremoveAll()voidremoveListener(com.atlassian.cache.CacheEntryListener<K,V> listener)booleanreplace(K key, V oldValue, V newValue)-
Methods inherited from class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getName, getStatistics, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries
-
-
-
-
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:
isReplicateViaCopyin interfacecom.atlassian.cache.ManagedCache- Overrides:
isReplicateViaCopyin classcom.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
onRemove
protected void onRemove(K key)
-
onClear
protected void onClear()
-
clear
public void clear()
- Specified by:
clearin interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public final boolean isReplicateAsynchronously()
-
put
public void put(K key, V value)- Specified by:
putin interfacecom.atlassian.cache.Cache<K,V>
-
putIfAbsent
public @Nullable V putIfAbsent(K key, V value)- Specified by:
putIfAbsentin interfacecom.atlassian.cache.Cache<K,V>
-
remove
public void remove(K key)
- Specified by:
removein interfacecom.atlassian.cache.Cache<K,V>
-
remove
public boolean remove(K key, V value)- Specified by:
removein interfacecom.atlassian.cache.Cache<K,V>
-
removeAll
public void removeAll()
- Specified by:
removeAllin interfacecom.atlassian.cache.Cache<K,V>
-
replace
public boolean replace(K key, V oldValue, V newValue)- Specified by:
replacein interfacecom.atlassian.cache.Cache<K,V>
-
isLocal
public boolean isLocal()
- Specified by:
isLocalin interfacecom.atlassian.cache.ManagedCache- Overrides:
isLocalin classcom.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
getLocalCache
protected com.atlassian.cache.ManagedCache getLocalCache()
- Specified by:
getLocalCachein classcom.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
isFlushable
public boolean isFlushable()
- Specified by:
isFlushablein interfacecom.atlassian.cache.ManagedCache
-
containsKey
public boolean containsKey(K key)
- Specified by:
containsKeyin interfacecom.atlassian.cache.Cache<K,V>
-
getKeys
public Collection<K> getKeys()
- Specified by:
getKeysin interfacecom.atlassian.cache.Cache<K,V>
-
get
public @Nullable V get(K key)
- Specified by:
getin interfacecom.atlassian.cache.Cache<K,V>
-
get
public V get(K key, com.atlassian.cache.Supplier<? extends V> valueSupplier)- Specified by:
getin interfacecom.atlassian.cache.Cache<K,V>
-
getBulk
public Map<K,V> getBulk(Set<K> keys, Function<Set<K>,Map<K,V>> valuesSupplier)
- Specified by:
getBulkin interfacecom.atlassian.cache.Cache<K,V>
-
addListener
public void addListener(com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)- Specified by:
addListenerin interfacecom.atlassian.cache.Cache<K,V>
-
removeListener
public void removeListener(com.atlassian.cache.CacheEntryListener<K,V> listener)
- Specified by:
removeListenerin interfacecom.atlassian.cache.Cache<K,V>
-
-