Class CachesEndpoint

java.lang.Object
org.springframework.boot.cache.actuate.endpoint.CachesEndpoint

@Endpoint(id="caches") public class CachesEndpoint extends Object
@Endpoint to expose available caches.
Since:
4.0.0
  • Constructor Details

    • CachesEndpoint

      public CachesEndpoint(Map<String, org.springframework.cache.CacheManager> cacheManagers)
      Create a new endpoint with the CacheManager instances to use.
      Parameters:
      cacheManagers - the cache managers to use, indexed by name
  • Method Details

    • caches

      @ReadOperation public CachesEndpoint.CachesDescriptor caches()
      Return a CachesEndpoint.CachesDescriptor of all available caches.
      Returns:
      a caches reports
    • cache

      @ReadOperation public @Nullable CachesEndpoint.CacheEntryDescriptor cache(@Selector String cache, @Nullable String cacheManager)
      Return a CachesEndpoint.CacheDescriptor for the specified cache.
      Parameters:
      cache - the name of the cache
      cacheManager - the name of the cacheManager (can be null
      Returns:
      the descriptor of the cache or null if no such cache exists
      Throws:
      NonUniqueCacheException - if more than one cache with that name exists and no cacheManager was provided to identify a unique candidate
    • clearCaches

      @DeleteOperation public void clearCaches()
      Clear all the available caches.
    • clearCache

      @DeleteOperation public boolean clearCache(@Selector String cache, @Nullable String cacheManager)
      Clear the specific Cache.
      Parameters:
      cache - the name of the cache
      cacheManager - the name of the cacheManager (can be null to match all)
      Returns:
      true if the cache was cleared or false if no such cache exists
      Throws:
      NonUniqueCacheException - if more than one cache with that name exists and no cacheManager was provided to identify a unique candidate