Class CacheQueryHandler

java.lang.Object
net.targetr.rc.monitoring.health.CacheQueryHandler

public class CacheQueryHandler extends Object
Returns the current state of the supplied caches as JSON.
Author:
Dr Michael Gardiner
  • Constructor Details

    • CacheQueryHandler

      public CacheQueryHandler(HttpRequest httpReq, ProxyCache proxyCache, ResourceCache cache)
      Constructs a CacheQueryHandler for the given request and caches. Starts the Health monitor if not already started.
      Parameters:
      httpReq - the incoming request
      proxyCache - the proxy response cache whose state is reported
      cache - the common resource cache whose state is reported
  • Method Details

    • generateResponse

      public HttpResponse generateResponse() throws IOException
      Returns cache states as JSON for GET requests.
      Returns:
      the generated HTTP response
      Throws:
      IOException - if an error occurs generating the response