Class CachesEndpoint
- java.lang.Object
- org.springframework.boot.actuate.cache.CachesEndpoint
@Endpoint(id="caches") public class CachesEndpoint extends Object
Endpointto expose availablecaches.- Since:
- 2.1.0
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCachesEndpoint.CacheDescriptorBasic description of aCache, primarily intended for serialization to JSON.static classCachesEndpoint.CacheEntryDescription of aCache, primarily intended for serialization to JSON.static classCachesEndpoint.CacheManagerDescriptorDescription of aCacheManager, primarily intended for serialization to JSON.static classCachesEndpoint.CachesReportA report of availablecaches, primarily intended for serialization to JSON.
Constructor Summary
Constructors Constructor Description CachesEndpoint(Map<String,org.springframework.cache.CacheManager> cacheManagers)Create a new endpoint with theCacheManagerinstances to use.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachesEndpoint.CacheEntrycache(String cache, String cacheManager)Return aCachesEndpoint.CacheDescriptorfor the specified cache.CachesEndpoint.CachesReportcaches()Return aCachesEndpoint.CachesReportof all availablecaches.booleanclearCache(String cache, String cacheManager)Clear the specificCache.voidclearCaches()Clear all the availablecaches.
Constructor Detail
CachesEndpoint
public CachesEndpoint(Map<String,org.springframework.cache.CacheManager> cacheManagers)
Create a new endpoint with theCacheManagerinstances to use.- Parameters:
cacheManagers- the cache managers to use, indexed by name
Method Detail
caches
@ReadOperation public CachesEndpoint.CachesReport caches()
Return aCachesEndpoint.CachesReportof all availablecaches.- Returns:
- a caches reports
cache
@ReadOperation public CachesEndpoint.CacheEntry cache(@Selector String cache, @Nullable String cacheManager)
Return aCachesEndpoint.CacheDescriptorfor the specified cache.- Parameters:
cache- the name of the cachecacheManager- the name of the cacheManager (can benull- Returns:
- the descriptor of the cache or
nullif no such cache exists - Throws:
NonUniqueCacheException- if more than one cache with that name exists and nocacheManagerwas provided to identify a unique candidate
clearCaches
@DeleteOperation public void clearCaches()
Clear all the availablecaches.
clearCache
@DeleteOperation public boolean clearCache(@Selector String cache, @Nullable String cacheManager)
Clear the specificCache.- Parameters:
cache- the name of the cachecacheManager- the name of the cacheManager (can benullto match all)- Returns:
trueif the cache was cleared orfalseif no such cache exists- Throws:
NonUniqueCacheException- if more than one cache with that name exists and nocacheManagerwas provided to identify a unique candidate