ch.hsr.bieridee.resourcehandler
Class UserResource

java.lang.Object
  extended by org.restlet.resource.Resource
      extended by org.restlet.resource.UniformResource
          extended by org.restlet.resource.ServerResource
              extended by ch.hsr.bieridee.resourcehandler.UserResource
All Implemented Interfaces:
IStoreResource

public class UserResource
extends org.restlet.resource.ServerResource
implements IStoreResource

Server resource to provide access to users. Important: This resource is not behind the guard, don't forget to manually check authentication! Authentication works as follows: - If the request is signed, treat PUT as "update". - If it's unsigned, treat PUT as "create".


Constructor Summary
UserResource()
           
 
Method Summary
 void doInit()
           
 void remove(org.restlet.representation.Representation rep)
          Delete a store item.
 org.restlet.representation.Representation retrieve()
          Retrieve a store item.
 void store(org.restlet.representation.Representation user)
          Update or create a store item.
 
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, getOnSent, getVariants, handle, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, setNegotiated, setOnSent, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods
 
Methods inherited from class org.restlet.resource.Resource
getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getQuery, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setRequest, setResponse, toObject, toRepresentation, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserResource

public UserResource()
Method Detail

doInit

public void doInit()
Overrides:
doInit in class org.restlet.resource.Resource

retrieve

public org.restlet.representation.Representation retrieve()
                                                   throws WrongNodeTypeException,
                                                          org.neo4j.server.rest.web.NodeNotFoundException,
                                                          org.json.JSONException
Description copied from interface: IStoreResource
Retrieve a store item.

Specified by:
retrieve in interface IStoreResource
Returns:
The store item representation.
Throws:
WrongNodeTypeException
org.neo4j.server.rest.web.NodeNotFoundException
org.json.JSONException

store

public void store(org.restlet.representation.Representation user)
           throws org.json.JSONException,
                  java.io.IOException
Description copied from interface: IStoreResource
Update or create a store item.

Specified by:
store in interface IStoreResource
Parameters:
user - Representation of the store item to store.
Throws:
org.json.JSONException
java.io.IOException

remove

public void remove(org.restlet.representation.Representation rep)
            throws org.json.JSONException
Description copied from interface: IStoreResource
Delete a store item.

Specified by:
remove in interface IStoreResource
Parameters:
rep - Representation of the store item to delete.
Throws:
org.json.JSONException