Class ReadThroughCachingBandanaPersister
java.lang.Object
com.atlassian.confluence.impl.bandana.ReadThroughCachingBandanaPersister
- All Implemented Interfaces:
BandanaPersister
@ParametersAreNonnullByDefault
public class ReadThroughCachingBandanaPersister
extends Object
implements BandanaPersister
An implementation of
BandanaPersister which caches the data from another BandanaPersister.- Since:
- 7.5
-
Method Summary
Modifier and TypeMethodDescriptioncreate(BandanaPersister persister, com.atlassian.cache.CacheFactory cacheFactory) voidFlush all caches of this persister.voidremove(BandanaContext context) Remove the storage of data associated with this contextvoidremove(BandanaContext context, String key) Remove the storage of data associated with this context, under the keyretrieve(BandanaContext context) This implementation is extremely processor intensive but correct.@Nullable Objectretrieve(BandanaContext context, String key) Retrieves the value associated with the key from the given context.retrieveKeys(BandanaContext bandanaContext) Bypass the cachevoidstore(BandanaContext context, String key, @Nullable Object value) Store a context/key/value triplet.
-
Method Details
-
create
public static ReadThroughCachingBandanaPersister create(BandanaPersister persister, com.atlassian.cache.CacheFactory cacheFactory) -
retrieve
Retrieves the value associated with the key from the given context. If the context does not exist, or the key is not found in the context, this method returns null.Assumes that any BandanaContext we are passed is a KeyedBandanaContext because that's how Confluence uses Bandana.
- Specified by:
retrievein interfaceBandanaPersister
-
retrieve
This implementation is extremely processor intensive but correct. The assumption is that this method NEVER gets called.- Specified by:
retrievein interfaceBandanaPersister- Parameters:
context- context to retrieve content for.- Returns:
- a Map from
Stringkey toObjectvalue
-
retrieveKeys
Bypass the cache- Specified by:
retrieveKeysin interfaceBandanaPersister- Parameters:
bandanaContext- the context for which to get keys- Returns:
- the keys for the given context
-
store
Description copied from interface:BandanaPersisterStore a context/key/value triplet.- Specified by:
storein interfaceBandanaPersister
-
flushCaches
public void flushCaches()Description copied from interface:BandanaPersisterFlush all caches of this persister.- Specified by:
flushCachesin interfaceBandanaPersister
-
remove
Description copied from interface:BandanaPersisterRemove the storage of data associated with this context- Specified by:
removein interfaceBandanaPersister
-
remove
Description copied from interface:BandanaPersisterRemove the storage of data associated with this context, under the key- Specified by:
removein interfaceBandanaPersister
-