Class CachesEndpoint
java.lang.Object
org.springframework.boot.actuate.cache.CachesEndpoint
- Since:
- 2.1.0
- Author:
- Johannes Edmeier, Stephane Nicoll
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBasic description of aCache, primarily intended for serialization to JSON.static final classDescription of aCache, primarily intended for serialization to JSON.static final classDescription of aCacheManager, primarily intended for serialization to JSON.static final classA report of availablecaches, primarily intended for serialization to JSON. -
Constructor Summary
ConstructorsConstructorDescriptionCachesEndpoint(Map<String, CacheManager> cacheManagers) Create a new endpoint with theCacheManagerinstances to use. -
Method Summary
Modifier and TypeMethodDescriptionReturn aCachesEndpoint.CacheDescriptorfor the specified cache.caches()Return aCachesEndpoint.CachesReportof all availablecaches.booleanclearCache(String cache, String cacheManager) Clear the specificCache.voidClear all the availablecaches.
-
Constructor Details
-
CachesEndpoint
Create a new endpoint with theCacheManagerinstances to use.- Parameters:
cacheManagers- the cache managers to use, indexed by name
-
-
Method Details
-
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
Clear all the availablecaches. -
clearCache
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
-