org.hackystat.sensorbase.resource.db
Class IndexResource

java.lang.Object
  extended by org.restlet.Handler
      extended by org.restlet.resource.Resource
          extended by org.hackystat.sensorbase.resource.sensorbase.SensorBaseResource
              extended by org.hackystat.sensorbase.resource.db.IndexResource

public class IndexResource
extends SensorBaseResource

Implements the Resource for processing PUT {host}/db/table/index requests. Requires the admin user.

Author:
Philip Johnson

Field Summary
 
Fields inherited from class org.hackystat.sensorbase.resource.sensorbase.SensorBaseResource
authUser, project, projectManager, projectName, responseMsg, sdtManager, sensorDataManager, server, uriUser, user, userManager
 
Constructor Summary
IndexResource(org.restlet.Context context, org.restlet.data.Request request, org.restlet.data.Response response)
          The standard constructor.
 
Method Summary
 boolean allowGet()
          Indicate that GET is not supported.
 boolean allowPut()
          Indicate the PUT method is supported.
 org.restlet.resource.Representation represent(org.restlet.resource.Variant variant)
          Get is not supported, but the method must be implemented.
 void storeRepresentation(org.restlet.resource.Representation variant)
          Returns 200 if index command succeeded.
 
Methods inherited from class org.hackystat.sensorbase.resource.sensorbase.SensorBaseResource
getStringRepresentation, setStatusBadTimestamp, setStatusInternalError, setStatusMiscError, validateAuthUserIsAdmin, validateAuthUserIsAdminOrUriUser, validateProjectOwner, validateProjectViewer, validateUriProjectName, validateUriUserIsUser
 
Methods inherited from class org.restlet.resource.Resource
acceptRepresentation, allowDelete, allowPost, delete, getPreferredRepresentation, getPreferredVariant, getRepresentation, getVariants, handleDelete, handleGet, handlePost, handlePut, init, isAvailable, isModifiable, isNegotiateContent, isReadable, post, put, removeRepresentations, represent, setAvailable, setModifiable, setNegotiateContent, setReadable, setVariants
 
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

IndexResource

public IndexResource(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

storeRepresentation

public void storeRepresentation(org.restlet.resource.Representation variant)
Returns 200 if index command succeeded. This requires admin authorization.

Overrides:
storeRepresentation in class org.restlet.resource.Resource
Parameters:
variant - Ignored.

allowPut

public boolean allowPut()
Indicate the PUT method is supported.

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

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 SensorBaseResource
Parameters:
variant - Ignored.
Returns:
Null.