Interface ResponseWriter
- All Known Implementing Classes:
AbstractResourceWebScript,DiscoveryApiWebscript,NetworksWebScriptGet,NetworkWebScriptGet,PublicApiTenantWebScriptServletRuntime,ResourceWebScriptDelete,ResourceWebScriptGet,ResourceWebScriptPost,ResourceWebScriptPut,SearchApiWebscript,SearchSQLApiWebscript
public interface ResponseWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.extensions.webscripts.Cachestatic final ContentInfostatic final WithResponsestatic final String -
Method Summary
Modifier and TypeMethodDescriptiondefault voidrenderErrorResponse(ErrorResponse errorResponse, org.springframework.extensions.webscripts.WebScriptResponse res, JacksonHelper jsonHelper) Renders a JSON error responsedefault voidrenderErrorResponse(ErrorResponse errorResponse, org.springframework.extensions.webscripts.WebScriptResponse res, org.springframework.extensions.webscripts.WebScriptRequest req, JacksonHelper jsonHelper) Renders a JSON error responsedefault voidrenderException(Exception exception, org.springframework.extensions.webscripts.WebScriptResponse response, ApiAssistant assistant) Renders an exception to the output stream as Json.default voidrenderException(Exception exception, org.springframework.extensions.webscripts.WebScriptResponse response, org.springframework.extensions.webscripts.WebScriptRequest request, ApiAssistant assistant) Renders an exception to the output stream as Json.default voidrenderJsonResponse(org.springframework.extensions.webscripts.WebScriptResponse res, Object toSerialize, JacksonHelper jsonHelper) Renders the result of an execution.default org.apache.commons.logging.Logdefault voidsetContentInfoOnResponse(org.springframework.extensions.webscripts.WebScriptResponse res, ContentInfo contentInfo) Sets the response headers with any information we know about the contentdefault voidsetResponse(org.springframework.extensions.webscripts.WebScriptResponse res, int status, org.springframework.extensions.webscripts.Cache cache, ContentInfo contentInfo, Map<String, List<String>> headers) The response status must be set before the response is written by Jackson (which will by default close and commit the response).default voidsetResponse(org.springframework.extensions.webscripts.WebScriptResponse res, WithResponse withResponse) Sets the response using the WithResponse object
-
Field Details
-
UTF8
- See Also:
-
DEFAULT_JSON_CONTENT
-
CACHE_NEVER
static final org.springframework.extensions.webscripts.Cache CACHE_NEVER -
DEFAULT_SUCCESS
-
-
Method Details
-
resWriterLogger
default org.apache.commons.logging.Log resWriterLogger() -
setContentInfoOnResponse
default void setContentInfoOnResponse(org.springframework.extensions.webscripts.WebScriptResponse res, ContentInfo contentInfo) Sets the response headers with any information we know about the content- Parameters:
res- WebScriptResponsecontentInfo- Content Information
-
setResponse
default void setResponse(org.springframework.extensions.webscripts.WebScriptResponse res, int status, org.springframework.extensions.webscripts.Cache cache, ContentInfo contentInfo, Map<String, List<String>> headers) The response status must be set before the response is written by Jackson (which will by default close and commit the response). In a r/w txn, web script buffered responses ensure that it doesn't really matter but for r/o txns this is important. If you set content information via the contentInfo object and ALSO the headers then "headers" will win because they are set last.- Parameters:
res-status-cache-contentInfo-headers-
-
setResponse
default void setResponse(org.springframework.extensions.webscripts.WebScriptResponse res, WithResponse withResponse) Sets the response using the WithResponse object- Parameters:
res-withResponse-
-
renderErrorResponse
default void renderErrorResponse(ErrorResponse errorResponse, org.springframework.extensions.webscripts.WebScriptResponse res, JacksonHelper jsonHelper) throws IOException Renders a JSON error response- Parameters:
errorResponse- The errorres- web script response- Throws:
IOException
-
renderErrorResponse
default void renderErrorResponse(ErrorResponse errorResponse, org.springframework.extensions.webscripts.WebScriptResponse res, org.springframework.extensions.webscripts.WebScriptRequest req, JacksonHelper jsonHelper) throws IOException Renders a JSON error response- Parameters:
errorResponse- The errorres- web script responsereq- web script request- Throws:
IOException
-
renderException
default void renderException(Exception exception, org.springframework.extensions.webscripts.WebScriptResponse response, ApiAssistant assistant) throws IOException Renders an exception to the output stream as Json.- Parameters:
exception-response-- Throws:
IOException
-
renderException
default void renderException(Exception exception, org.springframework.extensions.webscripts.WebScriptResponse response, org.springframework.extensions.webscripts.WebScriptRequest request, ApiAssistant assistant) throws IOException Renders an exception to the output stream as Json.- Parameters:
exception-response-request-- Throws:
IOException
-
renderJsonResponse
default void renderJsonResponse(org.springframework.extensions.webscripts.WebScriptResponse res, Object toSerialize, JacksonHelper jsonHelper) throws IOException Renders the result of an execution.- Parameters:
res- WebScriptResponsetoSerialize- result of an execution- Throws:
IOException
-