Class CachesEndpoint
java.lang.Object
org.springframework.boot.cache.actuate.endpoint.CachesEndpoint
@Endpoint to expose available caches.- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDescription of aCache.static final classDescription of aCacheentry.static final classDescription of aCacheManager.static final classDescription of the caches. -
Constructor Summary
ConstructorsConstructorDescriptionCachesEndpoint(Map<String, org.springframework.cache.CacheManager> cacheManagers) Create a new endpoint with theCacheManagerinstances to use. -
Method Summary
Modifier and TypeMethodDescription@Nullable CachesEndpoint.CacheEntryDescriptorReturn aCachesEndpoint.CacheDescriptorfor the specified cache.caches()Return aCachesEndpoint.CachesDescriptorof all availablecaches.booleanclearCache(String cache, @Nullable String cacheManager) Clear the specificCache.voidClear all the availablecaches.
-
Constructor Details
-
CachesEndpoint
-
-
Method Details
-
caches
Return aCachesEndpoint.CachesDescriptorof all availablecaches.- Returns:
- a caches reports
-
cache
@ReadOperation public @Nullable CachesEndpoint.CacheEntryDescriptor 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
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
-