Description
Implement two endpoints in CacheResource.java for the Maintenance portlet Cache tab: one to list cache region names (for the flush dropdown) and one to return cache statistics (JVM memory + per-provider per-region hit/miss/size data).
Acceptance Criteria
GET /v1/caches
- API caller must receive an alphabetically sorted list of all cache region names
- Response must use standard
ResponseEntityView wrapper
- Must require backend user with Maintenance portlet access
GET /v1/caches/stats
- API caller must receive JVM memory information: maxMemory, allocatedMemory, usedMemory, freeMemory (as raw long values in bytes)
- API caller must receive a list of cache providers, each containing: providerName, column names, and per-region statistics
- Per-region statistics must include all columns from
CacheProviderStats.getStatColumns() with values from CacheStats.getStatValue(col)
- Must require backend user with Maintenance portlet access
Priority
None
Additional Context
- Region names come from
CacheLocator.getCacheIndexes() — returns Object[], cast each to String and sort
- Cache stats come from
CacheLocator.getCacheAdministrator().getCacheStatsList() — returns List<CacheProviderStats>
- Each
CacheProviderStats has getProviderName(), getStatColumns() (LinkedHashSet), and getStats() (List of CacheStats)
- JVM memory:
Runtime.getRuntime().maxMemory(), .totalMemory(), .freeMemory()
Description
Implement two endpoints in
CacheResource.javafor the Maintenance portlet Cache tab: one to list cache region names (for the flush dropdown) and one to return cache statistics (JVM memory + per-provider per-region hit/miss/size data).Acceptance Criteria
GET /v1/caches
ResponseEntityViewwrapperGET /v1/caches/stats
CacheProviderStats.getStatColumns()with values fromCacheStats.getStatValue(col)Priority
None
Additional Context
CacheLocator.getCacheIndexes()— returnsObject[], cast each to String and sortCacheLocator.getCacheAdministrator().getCacheStatsList()— returnsList<CacheProviderStats>CacheProviderStatshasgetProviderName(),getStatColumns()(LinkedHashSet), andgetStats()(List of CacheStats)Runtime.getRuntime().maxMemory(),.totalMemory(),.freeMemory()