public class ResponseCacheImpl extends java.lang.Object implements ResponseCache
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 |
|---|---|
class |
ResponseCacheImpl.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(Key key)
Get the cached information about applications.
|
int |
getCurrentSize()
Get the number of items in the response cache.
|
byte[] |
getGZIP(Key key)
Get the compressed information about the applications.
|
java.util.concurrent.atomic.AtomicLong |
getVersionDelta()
Gets the version number of the cached data.
|
static java.util.concurrent.atomic.AtomicLong |
getVersionDeltaStatic()
Deprecated.
use instance method
getVersionDelta()
Gets the version number of the cached data. |
java.util.concurrent.atomic.AtomicLong |
getVersionDeltaWithRegions()
Gets the version number of the cached data with remote regions.
|
static java.util.concurrent.atomic.AtomicLong |
getVersionDeltaWithRegionsLegacy()
Deprecated.
use instance method
getVersionDeltaWithRegions()
Gets the version number of the cached data with remote regions. |
void |
invalidate(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 java.lang.String get(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.
get in interface ResponseCachekey - the key for which the cached information needs to be obtained.public byte[] getGZIP(Key key)
getGZIP in interface ResponseCachekey - 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)
invalidate in interface ResponseCacheappName - the application name of the application.public void invalidate(Key... keys)
keys - the list of keys for which the cache information needs to be invalidated.public java.util.concurrent.atomic.AtomicLong getVersionDelta()
getVersionDelta in interface ResponseCachepublic java.util.concurrent.atomic.AtomicLong getVersionDeltaWithRegions()
getVersionDeltaWithRegions in interface ResponseCache@Deprecated public static java.util.concurrent.atomic.AtomicLong getVersionDeltaStatic()
getVersionDelta()
Gets the version number of the cached data.@Deprecated public static java.util.concurrent.atomic.AtomicLong getVersionDeltaWithRegionsLegacy()
getVersionDeltaWithRegions()
Gets the version number of the cached data with remote regions.@Monitor(name="responseCacheSize",
type=GAUGE)
public int getCurrentSize()