com.tinkerpop.rexster
Class BaseResource

java.lang.Object
  extended by com.tinkerpop.rexster.BaseResource
Direct Known Subclasses:
AbstractSubResource, RexsterResource, RootResource

public abstract class BaseResource
extends Object


Field Summary
protected  javax.servlet.http.HttpServletRequest httpServletRequest
           
protected  List<javax.ws.rs.core.Variant> producesVariantList
           
protected  org.codehaus.jettison.json.JSONObject resultObject
           
protected  javax.ws.rs.core.SecurityContext securityContext
           
protected  javax.servlet.ServletContext servletContext
           
protected  StatisticsHelper sh
           
protected  javax.ws.rs.core.UriInfo uriInfo
           
 
Constructor Summary
BaseResource(RexsterApplication rexsterApplication)
           
 
Method Summary
protected  javax.ws.rs.core.Response buildOptionsResponse()
          Includes all HTTP Methods in allowable options.
protected  javax.ws.rs.core.Response buildOptionsResponse(String... methods)
           
 org.codehaus.jettison.json.JSONObject generateErrorObject(String message)
           
 org.codehaus.jettison.json.JSONObject generateErrorObject(String message, Throwable source)
           
 org.codehaus.jettison.json.JSONObject generateErrorObjectJsonFail(Throwable source)
           
protected  org.codehaus.jettison.json.JSONObject getNonRexsterRequest()
           
protected  List<String> getNonRexsterRequestKeys()
           
 org.codehaus.jettison.json.JSONObject getRequestObject()
           
 org.codehaus.jettison.json.JSONObject getRequestObject(boolean parseToJson)
          Gets the request object.
 org.codehaus.jettison.json.JSONObject getRequestObjectFlat()
           
protected  RexsterApplication getRexsterApplication()
           
protected  String getTimeAlive()
           
protected  String getUriPath()
           
protected  void setRequestObject(org.codehaus.jettison.json.JSONObject jsonObject)
          Sets the request object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

producesVariantList

protected final List<javax.ws.rs.core.Variant> producesVariantList

sh

protected final StatisticsHelper sh

resultObject

protected org.codehaus.jettison.json.JSONObject resultObject

httpServletRequest

@Context
protected javax.servlet.http.HttpServletRequest httpServletRequest

uriInfo

@Context
protected javax.ws.rs.core.UriInfo uriInfo

servletContext

@Context
protected javax.servlet.ServletContext servletContext

securityContext

@Context
protected javax.ws.rs.core.SecurityContext securityContext
Constructor Detail

BaseResource

public BaseResource(RexsterApplication rexsterApplication)
Method Detail

generateErrorObject

public org.codehaus.jettison.json.JSONObject generateErrorObject(String message)

generateErrorObjectJsonFail

public org.codehaus.jettison.json.JSONObject generateErrorObjectJsonFail(Throwable source)

generateErrorObject

public org.codehaus.jettison.json.JSONObject generateErrorObject(String message,
                                                                 Throwable source)

getRexsterApplication

protected RexsterApplication getRexsterApplication()

getUriPath

protected String getUriPath()

setRequestObject

protected void setRequestObject(org.codehaus.jettison.json.JSONObject jsonObject)
Sets the request object.

If this is set then the any previous call to getRequestObject which instantiated the request object from the URI parameters will be overriden.

Parameters:
jsonObject - The JSON Object.

getRequestObject

public org.codehaus.jettison.json.JSONObject getRequestObject()

getRequestObjectFlat

public org.codehaus.jettison.json.JSONObject getRequestObjectFlat()

getRequestObject

public org.codehaus.jettison.json.JSONObject getRequestObject(boolean parseToJson)
Gets the request object.

If it does not exist then an attempt is made to parse the parameter list on the URI into a JSON object.

Returns:
The request object.

getNonRexsterRequest

protected org.codehaus.jettison.json.JSONObject getNonRexsterRequest()
                                                              throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

getNonRexsterRequestKeys

protected List<String> getNonRexsterRequestKeys()
                                         throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

getTimeAlive

protected String getTimeAlive()

buildOptionsResponse

protected javax.ws.rs.core.Response buildOptionsResponse()
Includes all HTTP Methods in allowable options.


buildOptionsResponse

protected javax.ws.rs.core.Response buildOptionsResponse(String... methods)


Copyright © 2009-2012. All Rights Reserved.