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.ManagedHybridCacheSupport
An implementation ofCache
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
-
-
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 void
addListener(com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)
void
clear()
boolean
containsKey(K key)
@Nullable V
get(K key)
V
get(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.ManagedCache
getLocalCache()
boolean
isFlushable()
boolean
isLocal()
boolean
isReplicateAsynchronously()
boolean
isReplicateViaCopy()
protected void
onClear()
protected void
onPut(K key, V value)
protected void
onRemove(K key)
void
put(K key, V value)
@Nullable V
putIfAbsent(K key, V value)
void
remove(K key)
boolean
remove(K key, V value)
void
removeAll()
void
removeListener(com.atlassian.cache.CacheEntryListener<K,V> listener)
boolean
replace(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:
isReplicateViaCopy
in interfacecom.atlassian.cache.ManagedCache
- Overrides:
isReplicateViaCopy
in classcom.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
onRemove
protected void onRemove(K key)
-
onClear
protected void onClear()
-
clear
public void clear()
- Specified by:
clear
in interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public final boolean isReplicateAsynchronously()
-
put
public void put(K key, V value)
- Specified by:
put
in interfacecom.atlassian.cache.Cache<K,V>
-
putIfAbsent
public @Nullable V putIfAbsent(K key, V value)
- Specified by:
putIfAbsent
in interfacecom.atlassian.cache.Cache<K,V>
-
remove
public void remove(K key)
- Specified by:
remove
in interfacecom.atlassian.cache.Cache<K,V>
-
remove
public boolean remove(K key, V value)
- Specified by:
remove
in interfacecom.atlassian.cache.Cache<K,V>
-
removeAll
public void removeAll()
- Specified by:
removeAll
in interfacecom.atlassian.cache.Cache<K,V>
-
replace
public boolean replace(K key, V oldValue, V newValue)
- Specified by:
replace
in interfacecom.atlassian.cache.Cache<K,V>
-
isLocal
public boolean isLocal()
- Specified by:
isLocal
in interfacecom.atlassian.cache.ManagedCache
- Overrides:
isLocal
in classcom.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
getLocalCache
protected com.atlassian.cache.ManagedCache getLocalCache()
- Specified by:
getLocalCache
in classcom.atlassian.cache.hazelcast.ManagedHybridCacheSupport
-
isFlushable
public boolean isFlushable()
- Specified by:
isFlushable
in interfacecom.atlassian.cache.ManagedCache
-
containsKey
public boolean containsKey(K key)
- Specified by:
containsKey
in interfacecom.atlassian.cache.Cache<K,V>
-
getKeys
public Collection<K> getKeys()
- Specified by:
getKeys
in interfacecom.atlassian.cache.Cache<K,V>
-
get
public @Nullable V get(K key)
- Specified by:
get
in interfacecom.atlassian.cache.Cache<K,V>
-
get
public V get(K key, com.atlassian.cache.Supplier<? extends V> valueSupplier)
- Specified by:
get
in interfacecom.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 interfacecom.atlassian.cache.Cache<K,V>
-
addListener
public void addListener(com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)
- Specified by:
addListener
in interfacecom.atlassian.cache.Cache<K,V>
-
removeListener
public void removeListener(com.atlassian.cache.CacheEntryListener<K,V> listener)
- Specified by:
removeListener
in interfacecom.atlassian.cache.Cache<K,V>
-
-