org.hackystat.sensorbase.resource.registration
Class RegistrationResource

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.registration.RegistrationResource

public class RegistrationResource
extends SensorBaseResource

Provides registration services for this SensorBase. Implements a simple web page for accepting a POSTed form containing an email address to register. Sends email with the password to this user. Note that the email address is always lower-cased regardless of how the user typed it in.

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
RegistrationResource(org.restlet.Context context, org.restlet.data.Request request, org.restlet.data.Response response)
          The standard constructor.
 
Method Summary
 void acceptRepresentation(org.restlet.resource.Representation entity)
          Implement the POST method that registers a new user.
 boolean allowPost()
          Indicate the POST method is supported.
 org.restlet.resource.Representation represent(org.restlet.resource.Variant variant)
          Returns a page providing a registration form.
 
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
allowDelete, allowGet, allowPut, delete, getPreferredRepresentation, getPreferredVariant, getRepresentation, getVariants, handleDelete, handleGet, handlePost, handlePut, init, isAvailable, isModifiable, isNegotiateContent, isReadable, post, put, removeRepresentations, 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

RegistrationResource

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

represent

public org.restlet.resource.Representation represent(org.restlet.resource.Variant variant)
Returns a page providing a registration form. This requires no authorization.

Specified by:
represent in class SensorBaseResource
Parameters:
variant - The representational variant requested.
Returns:
The representation.

allowPost

public boolean allowPost()
Indicate the POST method is supported.

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

acceptRepresentation

public void acceptRepresentation(org.restlet.resource.Representation entity)
Implement the POST method that registers a new user. We lower case the email address automatically.

Overrides:
acceptRepresentation in class org.restlet.resource.Resource
Parameters:
entity - The email address to be registered.