|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.http.rest.RESTBase
public abstract class RESTBase
An abstract class that is the base of all RESTful services in SSWAP HTTP/JSON API. Currently, this class provides the functionality of responding to GET requests which return human-readable message about how to access this particular resource.
Field Summary | |
---|---|
private static java.net.URL |
lastForwardInTesting
|
private static org.apache.log4j.Logger |
LOGGER
Logger used by this abstract class. |
Constructor Summary | |
---|---|
RESTBase()
|
Method Summary | |
---|---|
protected void |
checkForUndefinedNS(info.sswap.api.model.SSWAPModel model)
|
static void |
clearLastForwardInTesting()
|
javax.ws.rs.core.Response |
displayDescription()
Serves the human-readable message about how to access this particular resource in response to an HTTP GET request |
javax.ws.rs.core.Response |
displayJSONSchema()
Serves the human-readable message about how to access this particular resource in response to an HTTP GET request |
protected java.util.Map<java.lang.String,java.lang.String> |
extractPrefixOverride(javax.servlet.http.HttpServletRequest request)
|
protected javax.ws.rs.core.Response |
forward(java.lang.String uploadedJson,
java.lang.String subPath,
java.util.Map<java.lang.String,java.lang.String> prefixOverride)
|
protected abstract java.lang.String |
getDescriptionResource()
Returns the name of the resource (in the classpath) that contains the human-readable description about this RESTful interface |
protected abstract java.lang.String |
getJSONSchemaResource()
Returns the name of the resource (in the classpath) that contains the JSON schema for the document acceptable by this resource |
static java.net.URL |
getLastForwardInTesting()
|
private java.lang.String |
getMIMEType(com.clarkparsia.utils.web.Response response)
|
private java.lang.String |
getOtherAPIBaseURL()
|
protected boolean |
needsForwarding(java.lang.String uploadedJson)
|
protected java.lang.String |
rebuildPrefixOverrideQueryString(java.util.Map<java.lang.String,java.lang.String> prefixOverride)
|
private static void |
recordForwardInTesting(java.net.URL url)
|
private java.lang.String |
stripErrorPrefix(java.lang.String errorMessage)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOGGER
private static java.net.URL lastForwardInTesting
Constructor Detail |
---|
public RESTBase()
Method Detail |
---|
protected abstract java.lang.String getDescriptionResource()
protected abstract java.lang.String getJSONSchemaResource()
public javax.ws.rs.core.Response displayDescription()
public javax.ws.rs.core.Response displayJSONSchema()
protected java.util.Map<java.lang.String,java.lang.String> extractPrefixOverride(javax.servlet.http.HttpServletRequest request)
protected java.lang.String rebuildPrefixOverrideQueryString(java.util.Map<java.lang.String,java.lang.String> prefixOverride)
protected void checkForUndefinedNS(info.sswap.api.model.SSWAPModel model) throws info.sswap.api.model.ValidationException
info.sswap.api.model.ValidationException
protected boolean needsForwarding(java.lang.String uploadedJson)
private java.lang.String getOtherAPIBaseURL()
private java.lang.String getMIMEType(com.clarkparsia.utils.web.Response response)
private java.lang.String stripErrorPrefix(java.lang.String errorMessage)
protected javax.ws.rs.core.Response forward(java.lang.String uploadedJson, java.lang.String subPath, java.util.Map<java.lang.String,java.lang.String> prefixOverride) throws java.net.MalformedURLException, java.io.IOException
java.net.MalformedURLException
java.io.IOException
private static void recordForwardInTesting(java.net.URL url)
public static java.net.URL getLastForwardInTesting()
public static void clearLastForwardInTesting()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |