public class Default extends Object implements CachePolicy
DefaultCacheKey
to identify each cache entry.Modifier and Type | Field and Description |
---|---|
static String |
UUID_KEY_MAP_KEY |
Constructor and Description |
---|
Default()
Deprecated.
since 5.4. Use
Default(CacheModule) instead, |
Default(CacheModule cacheModule) |
Modifier and Type | Method and Description |
---|---|
CacheKeyGenerator<?> |
getCacheKeyGenerator() |
info.magnolia.voting.voters.VoterSet |
getShouldBypassVoters() |
info.magnolia.voting.voters.VoterSet<CacheResponseWrapper> |
getTtlVoters() |
info.magnolia.voting.voters.VoterSet |
getVoters()
Deprecated.
since 5.4. Use
getShouldBypassVoters() instead. |
boolean |
isRefreshOnNoCacheRequests() |
void |
persistCacheKey(String repo,
String uuid,
Object key)
Persists mapping between uuid and cache key in case the given cache policy implementation cares about such details.
|
Object[] |
removeCacheKeys(String uuid,
String repository)
Returns cache keys for the given item or null if such keys can't be obtained or policy doesn't want to share it.
|
Object |
retrieveCacheKey(info.magnolia.cms.core.AggregationState aggregationState)
Returns cache key for the given item or null if such key can't be obtained or policy doesn't want to share it.
|
Object[] |
retrieveCacheKeys(String uuid,
String repository)
Returns cache keys for the given item or null if such keys can't be obtained or policy doesn't want to share it.
|
void |
setCacheKeyGenerator(CacheKeyGenerator<?> cacheKeyGenerator) |
void |
setRefreshOnNoCacheRequests(boolean allowNoCacheHeader) |
void |
setShouldBypassVoters(info.magnolia.voting.voters.VoterSet shouldBypassVoters) |
void |
setTtlVoters(info.magnolia.voting.voters.VoterSet<CacheResponseWrapper> ttlVoters) |
void |
setVoters(info.magnolia.voting.voters.VoterSet voters)
Deprecated.
since 5.4. Use
setShouldBypassVoters(info.magnolia.voting.voters.VoterSet) ()} instead. |
protected boolean |
shouldBypass(info.magnolia.cms.core.AggregationState aggregationState,
Object key) |
CachePolicyResult |
shouldCache(Cache cache,
info.magnolia.cms.core.AggregationState aggregationState,
FlushPolicy flushPolicy)
Implementations can chose whether to cache or not - but note that the
aggregationState might not be completely populated.
|
protected boolean |
shouldRefresh(info.magnolia.cms.core.AggregationState aggregationState,
Object key)
Checks whether requested content should be served from cache or refreshed instead.
|
public static final String UUID_KEY_MAP_KEY
public Default()
Default(CacheModule)
instead,@Inject public Default(CacheModule cacheModule)
public CachePolicyResult shouldCache(Cache cache, info.magnolia.cms.core.AggregationState aggregationState, FlushPolicy flushPolicy)
CachePolicy
shouldCache
in interface CachePolicy
protected boolean shouldRefresh(info.magnolia.cms.core.AggregationState aggregationState, Object key)
protected boolean shouldBypass(info.magnolia.cms.core.AggregationState aggregationState, Object key)
public Object retrieveCacheKey(info.magnolia.cms.core.AggregationState aggregationState)
CachePolicy
retrieveCacheKey
in interface CachePolicy
public Object[] retrieveCacheKeys(String uuid, String repository)
CachePolicy
retrieveCacheKeys
in interface CachePolicy
public void persistCacheKey(String repo, String uuid, Object key)
CachePolicy
persistCacheKey
in interface CachePolicy
public Object[] removeCacheKeys(String uuid, String repository)
CachePolicy
removeCacheKeys
in interface CachePolicy
public boolean isRefreshOnNoCacheRequests()
public void setRefreshOnNoCacheRequests(boolean allowNoCacheHeader)
public info.magnolia.voting.voters.VoterSet<CacheResponseWrapper> getTtlVoters()
getTtlVoters
in interface CachePolicy
public void setTtlVoters(info.magnolia.voting.voters.VoterSet<CacheResponseWrapper> ttlVoters)
public info.magnolia.voting.voters.VoterSet getShouldBypassVoters()
public void setShouldBypassVoters(info.magnolia.voting.voters.VoterSet shouldBypassVoters)
public CacheKeyGenerator<?> getCacheKeyGenerator()
public void setCacheKeyGenerator(CacheKeyGenerator<?> cacheKeyGenerator)
@Deprecated public info.magnolia.voting.voters.VoterSet getVoters()
getShouldBypassVoters()
instead.@Deprecated public void setVoters(info.magnolia.voting.voters.VoterSet voters)
setShouldBypassVoters(info.magnolia.voting.voters.VoterSet)
()} instead.Copyright © 2015 Magnolia International Ltd.. All rights reserved.