ch.hsr.bieridee.resourcehandler
Class RatingResource

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.RatingResource

public class RatingResource
extends org.restlet.resource.ServerResource

Server resource to provide access to users.


Constructor Summary
RatingResource()
           
 
Method Summary
 void doInit()
           
 org.restlet.representation.Representation retrieve()
          Retrieve a rating.
 org.restlet.representation.Representation store(org.restlet.representation.Representation rating)
          Creates a new rating.
 
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

RatingResource

public RatingResource()
Method Detail

doInit

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

retrieve

@Get
public org.restlet.representation.Representation retrieve()
                                                   throws WrongNodeTypeException,
                                                          org.neo4j.server.rest.web.NodeNotFoundException
Retrieve a rating.

Returns:
Representation of the Rating
Throws:
WrongNodeTypeException - Thrown if wrong node type
org.neo4j.server.rest.web.NodeNotFoundException - Thrown if a node was not found

store

@Post
public org.restlet.representation.Representation store(org.restlet.representation.Representation rating)
                                                throws org.json.JSONException,
                                                       java.io.IOException,
                                                       org.neo4j.graphdb.NotFoundException,
                                                       WrongNodeTypeException
Creates a new rating.

Parameters:
rating - The new raing
Returns:
The new average rating of the beer
Throws:
org.json.JSONException - We got json problem
java.io.IOException - We got io problem
org.neo4j.graphdb.NotFoundException - We got node finding problem
WrongNodeTypeException - We got type problem