public abstract class GenericRestProcessor extends GenericService implements RestProcessor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
GenericRestProcessor()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected JSONObject |
determineJSONControlParams()
This method determines JSON control params
|
protected boolean |
determineJSONUsage()
This method determines whether to use JSON input
|
protected boolean |
getBooleanControlParam(java.lang.String pName,
boolean pDefault)
get a specified boolean control param value
|
ComponentResolver |
getComponentResolver() |
FilteringManager |
getFilteringManager() |
RestOutputCustomizer |
getOutputCustomizer()
Returns the requested or configured rest output customizer.
|
RestPipelineServlet |
getParentServlet() |
protected java.lang.String |
getStringControlParam(java.lang.String pName)
get a specified string control param value
|
boolean |
isAcceptJSONInput()
get AcceptJSONInput
|
protected boolean |
isResourceWritable(ParsedURI pParsedURI)
Returns true if the property is writable based on the filtering configuration.
|
protected boolean |
isResourceWritable(java.lang.String pPropertyName,
ParsedURI pParsedURI)
Returns true if the property is writable based on the filtering configuration.
|
void |
setAcceptJSONInput(boolean pAcceptJSONInput)
set AcceptJSONInput
|
void |
setComponentResolver(ComponentResolver pComponentResolver) |
void |
setOutputCustomizer(RestOutputCustomizer pOutputCustomizer)
Set the configured rest output customizer.
|
void |
setParentServlet(RestPipelineServlet pParentServlet)
This method sets the parent rest pipeline servlet
|
protected boolean |
useSimpleResponseCodes()
Returns true if simple response codes should be used for responses.
|
protected boolean |
validateResource(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Validates that the REST request is for a valid resource type.
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doRESTDelete, doRESTGet, doRESTPost, doRESTPut
public RestOutputCustomizer getOutputCustomizer() throws RestException, java.io.IOException
RestException
java.io.IOException
public void setOutputCustomizer(RestOutputCustomizer pOutputCustomizer)
pOutputCustomizer
- the outputCustomizer to setpublic RestPipelineServlet getParentServlet()
public void setParentServlet(RestPipelineServlet pParentServlet)
RestProcessor
setParentServlet
in interface RestProcessor
pParentServlet
- the parentServlet to setpublic ComponentResolver getComponentResolver()
public void setComponentResolver(ComponentResolver pComponentResolver)
pComponentResolver
- the componentResolver to setpublic FilteringManager getFilteringManager()
public void setAcceptJSONInput(boolean pAcceptJSONInput)
pAcceptJSONInput
- the AcceptJSONInputpublic boolean isAcceptJSONInput()
protected boolean validateResource(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws RestException, java.io.IOException
parsedURI
- an object containing the parsed URIpRequest
- the servlet requestpResponse
- the servlet responseRestException
- if an error occurs processing the REST requestjava.io.IOException
- if an input or output stream exception occursprotected boolean isResourceWritable(ParsedURI pParsedURI)
pParsedURI
- an object containing the parsed URIprotected boolean isResourceWritable(java.lang.String pPropertyName, ParsedURI pParsedURI)
pPropertyName
- the property namepParsedURI
- an object containing the parsed URIprotected boolean useSimpleResponseCodes()
protected boolean getBooleanControlParam(java.lang.String pName, boolean pDefault)
pName
- the name of the control parampDefault
- the default value for the control paramprotected java.lang.String getStringControlParam(java.lang.String pName)
pName
- the name of the control paramprotected JSONObject determineJSONControlParams() throws RestException
java.lang.IllegalArgumentException
- if an unexpected error occurs during parsing JSON input paramRestException
protected boolean determineJSONUsage()