IGridJsJsonCache

public interface IGridJsJsonCache

JSON cache interface - customers implement specific storage and invalidation strategies

Methods

MethodDescription
clearAll()Clear all caches
getCacheKey(String uid, String fileName)Generate a cache key.
invalidate(String cacheKey)Invalidate the specified cache entry.
invalidateAllForUid(String uid)Invalidate all cache entries containing the specified uid.
setJson(String cacheKey, String json)Write JSON into cache.
tryGetJson(String cacheKey)Attempt to retrieve JSON from cache.

clearAll()

public abstract void clearAll()

Clear all caches

getCacheKey(String uid, String fileName)

public abstract String getCacheKey(String uid, String fileName)

Generate a cache key. Customers can decide whether to include the uid based on business requirements. - If only the file name matters: ignore uid and use fileName only (recommended, allows sharing cache across same file). - If distinguishing files with the same name is required: use uid (strict mode).

Parameters:

ParameterTypeDescription
uidjava.lang.StringUnique identifier of the file (may differ per load)
fileNamejava.lang.StringOriginal file name

Returns: java.lang.String - Cache key

invalidate(String cacheKey)

public abstract void invalidate(String cacheKey)

Invalidate the specified cache entry.

Parameters:

ParameterTypeDescription
cacheKeyjava.lang.StringCache key

invalidateAllForUid(String uid)

public abstract void invalidateAllForUid(String uid)

Invalidate all cache entries containing the specified uid. This is useful when you don’t know the exact fileName used for caching.

Parameters:

ParameterTypeDescription
uidjava.lang.StringUnique identifier to match in cache keys

setJson(String cacheKey, String json)

public abstract void setJson(String cacheKey, String json)

Write JSON into cache.

Parameters:

ParameterTypeDescription
cacheKeyjava.lang.StringCache key
jsonjava.lang.StringJSON string

tryGetJson(String cacheKey)

public abstract String tryGetJson(String cacheKey)

Attempt to retrieve JSON from cache.

Parameters:

ParameterTypeDescription
cacheKeyjava.lang.StringCache key

Returns: java.lang.String - JSON string if cache hit, null otherwise