java.lang.Object
software.amazon.lambda.powertools.parameters.cache.CacheManager

public class CacheManager extends Object
Manages caching of parameter values with configurable expiration times.

This class is thread-safe. The cache storage is shared across all threads, while expiration time configuration is thread-local to support concurrent requests with different cache TTL requirements.

  • Constructor Details

    • CacheManager

      public CacheManager()
  • Method Details

    • getIfNotExpired

      public <T> Optional<T> getIfNotExpired(String key, Instant now)
    • setExpirationTime

      public void setExpirationTime(Duration duration)
    • setDefaultExpirationTime

      public void setDefaultExpirationTime(Duration duration)
    • putInCache

      public <T> void putInCache(String key, T value)
    • resetExpirationTime

      public void resetExpirationTime()