Class ReadThroughCachingBandanaPersister
- java.lang.Object
-
- com.atlassian.confluence.impl.bandana.ReadThroughCachingBandanaPersister
-
- All Implemented Interfaces:
com.atlassian.bandana.BandanaPersister
@ParametersAreNonnullByDefault public class ReadThroughCachingBandanaPersister extends Object implements com.atlassian.bandana.BandanaPersister
An implementation ofBandanaPersister
which caches the data from anotherBandanaPersister
.- Since:
- 7.5
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReadThroughCachingBandanaPersister
create(com.atlassian.bandana.BandanaPersister persister, com.atlassian.cache.CacheFactory cacheFactory)
void
flushCaches()
void
remove(com.atlassian.bandana.BandanaContext context)
void
remove(com.atlassian.bandana.BandanaContext context, String key)
Map<String,Object>
retrieve(com.atlassian.bandana.BandanaContext context)
This implementation is extremely processor intensive but correct.@Nullable Object
retrieve(com.atlassian.bandana.BandanaContext context, String key)
Retrieves the value associated with the key from the given context.Iterable<String>
retrieveKeys(com.atlassian.bandana.BandanaContext bandanaContext)
Bypass the cachevoid
store(com.atlassian.bandana.BandanaContext context, String key, @Nullable Object value)
-
-
-
Method Detail
-
create
public static ReadThroughCachingBandanaPersister create(com.atlassian.bandana.BandanaPersister persister, com.atlassian.cache.CacheFactory cacheFactory)
-
retrieve
public @Nullable Object retrieve(com.atlassian.bandana.BandanaContext context, String key)
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 interfacecom.atlassian.bandana.BandanaPersister
-
retrieve
public Map<String,Object> retrieve(com.atlassian.bandana.BandanaContext context)
This implementation is extremely processor intensive but correct. The assumption is that this method NEVER gets called.
-
retrieveKeys
public Iterable<String> retrieveKeys(com.atlassian.bandana.BandanaContext bandanaContext)
Bypass the cache- Specified by:
retrieveKeys
in interfacecom.atlassian.bandana.BandanaPersister
- Parameters:
bandanaContext
- the context for which to get keys- Returns:
- the keys for the given context
-
store
public void store(com.atlassian.bandana.BandanaContext context, String key, @Nullable Object value)
- Specified by:
store
in interfacecom.atlassian.bandana.BandanaPersister
-
flushCaches
public void flushCaches()
- Specified by:
flushCaches
in interfacecom.atlassian.bandana.BandanaPersister
-
remove
public void remove(com.atlassian.bandana.BandanaContext context)
- Specified by:
remove
in interfacecom.atlassian.bandana.BandanaPersister
-
remove
public void remove(com.atlassian.bandana.BandanaContext context, String key)
- Specified by:
remove
in interfacecom.atlassian.bandana.BandanaPersister
-
-