public class ResponseCache
extends java.lang.Object
The cache is maintained in compressed and non-compressed form for three categories of requests - all applications, delta changes and for individual applications. The compressed form is probably the most efficient in terms of network traffic especially when querying all applications. The cache also maintains separate pay load for JSON and XML formats and for multiple versions too.
| Modifier and Type | Class and Description |
|---|---|
static class |
ResponseCache.Key
The key for the cached payload.
|
static class |
ResponseCache.KeyType |
class |
ResponseCache.Value
The class that stores payload in both compressed and uncompressed form.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALL_APPS |
static java.lang.String |
ALL_APPS_DELTA |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get(ResponseCache.Key key)
Get the cached information about applications.
|
int |
getCurrentSize()
Get the number of items in the response cache.
|
byte[] |
getGZIP(ResponseCache.Key key)
Get the compressed information about the applications.
|
static ResponseCache |
getInstance() |
static java.util.concurrent.atomic.AtomicLong |
getVersionDelta()
Gets the version number of the cached data.
|
static java.util.concurrent.atomic.AtomicLong |
getVersionDeltaWithRegions()
Gets the version number of the cached data with remote regions.
|
void |
invalidate(ResponseCache.Key... keys)
Invalidate the cache information given the list of keys.
|
void |
invalidate(java.lang.String appName,
java.lang.String vipAddress,
java.lang.String secureVipAddress)
Invalidate the cache of a particular application.
|
public static final java.lang.String ALL_APPS
public static final java.lang.String ALL_APPS_DELTA
public static ResponseCache getInstance()
public java.lang.String get(ResponseCache.Key key)
If the cached information is not available it is generated on the first request. After the first request, the information is then updated periodically by a background thread.
key - the key for which the cached information needs to be obtained.public byte[] getGZIP(ResponseCache.Key key)
key - the key for which the compressed cached information needs to
be obtained.public void invalidate(java.lang.String appName,
@Nullable
java.lang.String vipAddress,
@Nullable
java.lang.String secureVipAddress)
appName - the application name of the application.public void invalidate(ResponseCache.Key... keys)
keys - the list of keys for which the cache information needs to be
invalidated.public static java.util.concurrent.atomic.AtomicLong getVersionDelta()
public static java.util.concurrent.atomic.AtomicLong getVersionDeltaWithRegions()
@Monitor(name="responseCacheSize",
type=GAUGE)
public int getCurrentSize()