|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tinkerpop.rexster.extension.ExtensionResponse
public class ExtensionResponse
Wraps the Jersey response object with some simple response builder methods.
Constructor Summary | |
---|---|
ExtensionResponse(javax.ws.rs.core.Response response)
Create a non-error ExtensionResponse object. |
|
ExtensionResponse(javax.ws.rs.core.Response response,
boolean errorResponse)
Create an ExtensionResponse object. |
Method Summary | |
---|---|
static ExtensionResponse |
availableOptions(String... methods)
|
static ExtensionResponse |
error(Exception source)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(Exception source,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(Exception source,
String appendKey,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(String message)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(String message,
Exception source)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(String message,
Exception source,
int statusCode)
Generates standard Rexster JSON error with a specified server error response code. |
static ExtensionResponse |
error(String message,
Exception source,
int statusCode,
String appendKey,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with a specified server error response code. |
static ExtensionResponse |
error(String message,
Exception source,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(String message,
Exception source,
String appendKey,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(String message,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with an internal server error response code. |
static ExtensionResponse |
error(String message,
String appendKey,
org.codehaus.jettison.json.JSONObject appendJson)
Generates standard Rexster JSON error with an internal server error response code. |
javax.ws.rs.core.Response |
getJerseyResponse()
|
boolean |
isErrorResponse()
|
static ExtensionResponse |
noContent()
Generates a response with no content and matching status code. |
static ExtensionResponse |
ok(org.codehaus.jettison.json.JSONObject result)
Generates an response with an OK status code. |
static ExtensionResponse |
ok(Map result)
Generates an response with an OK status code. |
static ExtensionResponse |
override(javax.ws.rs.core.Response response)
Override the builder and literally construct the Jersey response. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensionResponse(javax.ws.rs.core.Response response)
public ExtensionResponse(javax.ws.rs.core.Response response, boolean errorResponse)
Method Detail |
---|
public static ExtensionResponse override(javax.ws.rs.core.Response response)
public static ExtensionResponse error(String message)
public static ExtensionResponse error(String message, String appendKey, org.codehaus.jettison.json.JSONObject appendJson)
public static ExtensionResponse error(String message, org.codehaus.jettison.json.JSONObject appendJson)
appendJson
- Additional JSON to push into the response. The root of the key values from this object
will be merged into the root of the resulting JSON.public static ExtensionResponse error(Exception source)
public static ExtensionResponse error(Exception source, String appendKey, org.codehaus.jettison.json.JSONObject appendJson)
public static ExtensionResponse error(Exception source, org.codehaus.jettison.json.JSONObject appendJson)
appendJson
- Additional JSON to push into the response. The root of the key values from this object
will be merged into the root of the resulting JSON.public static ExtensionResponse error(String message, Exception source)
public static ExtensionResponse error(String message, Exception source, String appendKey, org.codehaus.jettison.json.JSONObject appendJson)
appendKey
- This parameter is only relevant if the appendJson parameter is passed. If this value
is not null or non-empty the value of appendJson will be assigned to this key value in
the response object. If the key is null or empty the appendJson parameter will be
written at the root of the response object.appendJson
- Additional JSON to push into the response.public static ExtensionResponse error(String message, Exception source, org.codehaus.jettison.json.JSONObject appendJson)
appendJson
- Additional JSON to push into the response. The root of the key values from this object
will be merged into the root of the resulting JSON.public static ExtensionResponse error(String message, Exception source, int statusCode)
public static ExtensionResponse error(String message, Exception source, int statusCode, String appendKey, org.codehaus.jettison.json.JSONObject appendJson)
appendKey
- This parameter is only relevant if the appendJson parameter is passed. If this value
is not null or non-empty the value of appendJson will be assigned to this key value in
the response object. If the key is null or empty the appendJson parameter will be
written at the root of the response object.appendJson
- Additional JSON to push into the response.public static ExtensionResponse noContent()
public static ExtensionResponse ok(Map result)
public static ExtensionResponse availableOptions(String... methods)
public static ExtensionResponse ok(org.codehaus.jettison.json.JSONObject result)
public javax.ws.rs.core.Response getJerseyResponse()
public boolean isErrorResponse()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |