Class SiteCacheRestController

java.lang.Object
org.craftercms.core.controller.rest.RestControllerBase
org.craftercms.engine.controller.rest.SiteCacheRestController

@CrafterRestController @RequestMapping("${crafter.core.rest.base.uri}/site/cache") public class SiteCacheRestController extends org.craftercms.core.controller.rest.RestControllerBase
REST controller for site cache operations. The controller uses a map of cache types mapped to SiteCacheRestOperations, which allows REST operation implementations for different types of caches.
Author:
avasquez
  • Field Details

  • Constructor Details

  • Method Details

    • clear

      @RequestMapping(value="/clear", method=GET) public Map<String,Object> clear(jakarta.servlet.http.HttpServletRequest request, @RequestParam String token, @RequestParam(required=false) String cacheType) throws org.craftercms.commons.exceptions.InvalidManagementTokenException
      Throws:
      org.craftercms.commons.exceptions.InvalidManagementTokenException
    • getStatistics

      @RequestMapping(value="/statistics", method=GET) public org.craftercms.core.cache.CacheStatistics getStatistics(@RequestParam String token, @RequestParam(required=false) String cacheType) throws org.craftercms.commons.exceptions.InvalidManagementTokenException
      Throws:
      org.craftercms.commons.exceptions.InvalidManagementTokenException
    • handleInvalidCacheTypeException

      @ExceptionHandler(InvalidCacheTypeException.class) public org.springframework.http.ResponseEntity<Map<String,Object>> handleInvalidCacheTypeException(InvalidCacheTypeException ex)
    • getCacheRestOperations

      protected SiteCacheRestOperations getCacheRestOperations(String cacheType)
    • validateToken

      protected final void validateToken(String requestToken) throws org.craftercms.commons.exceptions.InvalidManagementTokenException
      Throws:
      org.craftercms.commons.exceptions.InvalidManagementTokenException