Class CachedEndpointsController

java.lang.Object
edu.ucsb.cs156.diningcachingproxy.controller.ApiController
edu.ucsb.cs156.diningcachingproxy.controller.CachedEndpointsController

@RequestMapping("/api/admin/endpoints") @RestController public class CachedEndpointsController extends ApiController
Lets an admin see every API endpoint the proxy has cached so far, with a hit count for each — the observation-only groundwork for per-endpoint TTL policy (see issue #2).
  • Constructor Details

    • CachedEndpointsController

      public CachedEndpointsController()
  • Method Details

    • allEndpoints

      @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("") public List<CachedEndpointsController.CachedEndpointDTO> allEndpoints()
    • evictStaleEndpoints

      @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/evict") public edu.ucsb.cs156.jobs.entities.Job evictStaleEndpoints(@RequestParam(required=false) Integer maxAgeDays)