org.hackystat.telemetry.service.resource.cache
Class CacheResource

java.lang.Object
  extended by org.restlet.Handler
      extended by org.restlet.resource.Resource
          extended by org.hackystat.telemetry.service.resource.telemetry.TelemetryResource
              extended by org.hackystat.telemetry.service.resource.cache.CacheResource

public class CacheResource
extends TelemetryResource

This resource responds to requests of form: DELETE {host}/cache/{user} DELETE {host}/cache/{user}/{project} The DELETE requests clear the caches for the user, dpdtype, or individual entry. The UriUser must always be the same as the authenticated user.

Author:
Philip Johnson

Field Summary
 
Fields inherited from class org.hackystat.telemetry.service.resource.telemetry.TelemetryResource
authUser, badAuth, chart, dpdHost, end, granularity, params, projectName, requestStartTime, sensorBaseHost, start, telemetryServer, uriUser
 
Constructor Summary
CacheResource(org.restlet.Context context, org.restlet.data.Request request, org.restlet.data.Response response)
          The standard constructor.
 
Method Summary
 boolean allowDelete()
          Indicate the DELETE method is supported.
 boolean allowGet()
          Indicate that GET is not supported.
 void removeRepresentations()
          Responds to DELETE requests for clearing the cache.
 org.restlet.resource.Representation represent(org.restlet.resource.Variant variant)
          Get is not supported, but the method must be implemented.
 
Methods inherited from class org.hackystat.telemetry.service.resource.telemetry.TelemetryResource
getDailyProjectDataClient, getSensorBaseClient, getStringRepresentation, getTelemetryDefinitions, logRequest, logRequest, setStatusError, setStatusError, setStatusInternalError
 
Methods inherited from class org.restlet.resource.Resource
acceptRepresentation, allowPost, allowPut, delete, getPreferredRepresentation, getPreferredVariant, getRepresentation, getVariants, handleDelete, handleGet, handlePost, handlePut, init, isAvailable, isModifiable, isNegotiateContent, isReadable, post, put, represent, setAvailable, setModifiable, setNegotiateContent, setReadable, setVariants, storeRepresentation
 
Methods inherited from class org.restlet.Handler
allowHead, allowOptions, generateRef, getAllowedMethods, getApplication, getContext, getLogger, getMatrix, getQuery, getRequest, getResponse, handleHead, handleOptions, setContext, setRequest, setResponse, updateAllowedMethods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheResource

public CacheResource(org.restlet.Context context,
                     org.restlet.data.Request request,
                     org.restlet.data.Response response)
The standard constructor.

Parameters:
context - The context.
request - The request object.
response - The response object.
Method Detail

allowGet

public boolean allowGet()
Indicate that GET is not supported.

Overrides:
allowGet in class org.restlet.resource.Resource
Returns:
False.

represent

public org.restlet.resource.Representation represent(org.restlet.resource.Variant variant)
Get is not supported, but the method must be implemented.

Specified by:
represent in class TelemetryResource
Parameters:
variant - Ignored.
Returns:
Null.

allowDelete

public boolean allowDelete()
Indicate the DELETE method is supported.

Overrides:
allowDelete in class org.restlet.resource.Resource
Returns:
True.

removeRepresentations

public void removeRepresentations()
Responds to DELETE requests for clearing the cache. Includes: Returns 200 if cache delete command succeeded. The authorized user must be the same as the user specified in the URI.

Overrides:
removeRepresentations in class org.restlet.resource.Resource