public class CacheController
extends org.sonatype.goodies.common.ComponentSupport
Constructor and Description |
---|
CacheController(int contentMaxAgeSeconds,
String cacheToken) |
Modifier and Type | Method and Description |
---|---|
CacheInfo |
current()
Returns the currently effective
CacheInfo with "now" timestamp. |
int |
getContentMaxAgeSeconds() |
void |
invalidateCache()
After invoking this method, all
isStale(CacheInfo) checks will return true that has CacheInfo not
carrying same token as created in this method. |
boolean |
isStale(CacheInfo cacheInfo)
Returns
true if passed in cache info carries stale information, detected either by cache token or
age of the info. |
static String |
newCacheToken() |
public static String newCacheToken()
public void invalidateCache()
isStale(CacheInfo)
checks will return true that has CacheInfo
not
carrying same token as created in this method.public boolean isStale(CacheInfo cacheInfo)
true
if passed in cache info carries stale information, detected either by cache token or
age of the info.public int getContentMaxAgeSeconds()
Copyright © 2008–2021 Sonatype, Inc.. All rights reserved.