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) void
Flush all caches of this persister.void
remove
(BandanaContext context) Remove the storage of data associated with this contextvoid
remove
(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 Object
retrieve
(BandanaContext context, String key) Retrieves the value associated with the key from the given context.retrieveKeys
(BandanaContext bandanaContext) Bypass the cachevoid
store
(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:
retrieve
in interfaceBandanaPersister
-
retrieve
This implementation is extremely processor intensive but correct. The assumption is that this method NEVER gets called.- Specified by:
retrieve
in interfaceBandanaPersister
- Parameters:
context
- context to retrieve content for.- Returns:
- a Map from
String
key toObject
value
-
retrieveKeys
Bypass the cache- Specified by:
retrieveKeys
in interfaceBandanaPersister
- Parameters:
bandanaContext
- the context for which to get keys- Returns:
- the keys for the given context
-
store
Description copied from interface:BandanaPersister
Store a context/key/value triplet.- Specified by:
store
in interfaceBandanaPersister
-
flushCaches
public void flushCaches()Description copied from interface:BandanaPersister
Flush all caches of this persister.- Specified by:
flushCaches
in interfaceBandanaPersister
-
remove
Description copied from interface:BandanaPersister
Remove the storage of data associated with this context- Specified by:
remove
in interfaceBandanaPersister
-
remove
Description copied from interface:BandanaPersister
Remove the storage of data associated with this context, under the key- Specified by:
remove
in interfaceBandanaPersister
-