Package app.ductape.sdk.cache
Class CacheService
java.lang.Object
app.ductape.sdk.cache.CacheService
TS
cache.service.ts: remote cache via ProcessorApiService, optional local Redis (Lettuce) for reads/writes.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCacheService(EnvType env, RequestContext auth) CacheService(EnvType env, RequestContext auth, ProductsService productsService, ProcessorApiService processorApi) CacheService(RequestContext auth) Backward-compatible constructor for pre-env wiring. -
Method Summary
Modifier and TypeMethodDescriptionauth()booleanclear(CacheTypes.ClearKeyOptions options) TSclear.clearAll(CacheTypes.ClearAllOptions options) TSclearAll.voidconnectRedis(String url) TSconnectRedis: local Redis for two-tier caching (Lettuce client).booleandelete(CacheTypes.ClearKeyOptions options) Legacy alias for clear-by-key.deleteAll(CacheTypes.ClearAllOptions options) Legacy alias for clearing cache values in batch.voidTSdisconnectRedis.voidEnable lightweight API-backed cache logging.env()TSfetchDashboard.fetchValues(CacheTypes.FetchValuesOptions options) TSfetchValues.get(CacheTypes.GetValueOptions options) TSget: Redis hash first, then remoteProcessorApiService.fetchRemoteCacheByKey(java.lang.String, app.ductape.sdk.core.RequestContext).booleanTSisRedisConnected.booleanset(CacheTypes.SetValueOptions options) TSset: local Redis + fire-and-forget remote persist.voidProvide a non-blocking cache event sink (disabled when null).voidsetRuntimeDefaults(RuntimeDefaults runtimeDefaults) voidupdateAuth(RequestContext next) TSupdateConfig: replace credentials (typically after auth refresh).voidTS-style config refresh helper for token/key rotation.voidupdateConfig(Map<String, Object> config) TS parity overload for partial config updates.
-
Constructor Details
-
CacheService
Backward-compatible constructor for pre-env wiring. Defaults toEnvType.PRODUCTIONbase URLs. -
CacheService
-
CacheService
public CacheService(EnvType env, RequestContext auth, ProductsService productsService, ProcessorApiService processorApi)
-
-
Method Details
-
env
-
auth
-
updateAuth
TSupdateConfig: replace credentials (typically after auth refresh). -
updateConfig
public void updateConfig(String workspaceId, String userId, String publicKey, String token, String accessKey) TS-style config refresh helper for token/key rotation. Any null override keeps the existing auth value. -
updateConfig
TS parity overload for partial config updates. Supported keys: workspace_id, user_id, public_key, token, access_key. -
setRuntimeDefaults
-
setLogSink
Provide a non-blocking cache event sink (disabled when null). -
enableApiLogging
public void enableApiLogging()Enable lightweight API-backed cache logging. Logging failures are swallowed (cache operations remain non-blocking). -
connectRedis
TSconnectRedis: local Redis for two-tier caching (Lettuce client). -
disconnectRedis
public void disconnectRedis()TSdisconnectRedis. -
isRedisConnected
public boolean isRedisConnected()TSisRedisConnected. -
fetchValues
TSfetchValues. -
fetchDashboard
TSfetchDashboard. -
get
TSget: Redis hash first, then remoteProcessorApiService.fetchRemoteCacheByKey(java.lang.String, app.ductape.sdk.core.RequestContext). -
set
TSset: local Redis + fire-and-forget remote persist. -
clear
TSclear. -
delete
Legacy alias for clear-by-key. -
clearAll
TSclearAll. -
deleteAll
Legacy alias for clearing cache values in batch.
-