@ParametersAreNonnullByDefault public class ConfluenceCachingBandanaPersister extends Object implements com.atlassian.bandana.BandanaPersister
Uses the read-through cache factory for non-transactional updates to the cache when data is read from the underlying persister.
Constructor and Description |
---|
ConfluenceCachingBandanaPersister(com.atlassian.bandana.BandanaPersister persister,
com.atlassian.vcache.VCacheFactory cacheFactory) |
Modifier and Type | Method and Description |
---|---|
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.
|
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 cache
|
void |
store(com.atlassian.bandana.BandanaContext context,
String key,
Object value) |
public ConfluenceCachingBandanaPersister(com.atlassian.bandana.BandanaPersister persister, com.atlassian.vcache.VCacheFactory cacheFactory)
@Nullable public Object retrieve(com.atlassian.bandana.BandanaContext context, String key)
Assumes that any BandanaContext we are passed is a KeyedBandanaContext because that's how Confluence uses Bandana.
retrieve
in interface com.atlassian.bandana.BandanaPersister
public Map<String,Object> retrieve(com.atlassian.bandana.BandanaContext context)
public Iterable<String> retrieveKeys(com.atlassian.bandana.BandanaContext bandanaContext)
retrieveKeys
in interface com.atlassian.bandana.BandanaPersister
bandanaContext
- the context for which to get keyspublic void store(com.atlassian.bandana.BandanaContext context, String key, @Nullable Object value)
store
in interface com.atlassian.bandana.BandanaPersister
public void flushCaches()
flushCaches
in interface com.atlassian.bandana.BandanaPersister
public void remove(com.atlassian.bandana.BandanaContext context)
remove
in interface com.atlassian.bandana.BandanaPersister
public void remove(com.atlassian.bandana.BandanaContext context, String key)
remove
in interface com.atlassian.bandana.BandanaPersister
Copyright © 2003–2017 Atlassian. All rights reserved.