Package org.chenile.http.handler
Class HttpEntryPoint
java.lang.Object
org.chenile.http.handler.HttpEntryPoint
- All Implemented Interfaces:
HttpRequestHandler
This is a generic controller that is used if JSON is used to configure a Chenile service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChenileEntryPointprivate final LocaleResolverprivate static final ObjectMapperprivate final OperationDefinitionprivate final ChenileServiceDefinition -
Constructor Summary
ConstructorsConstructorDescriptionHttpEntryPoint(ChenileServiceDefinition serviceDefinition, OperationDefinition operationDefinition, ChenileEntryPoint chenileEntryPoint) -
Method Summary
Modifier and TypeMethodDescriptionextractPathVariables(String url, String pathInfo) getHeaders(OperationDefinition od, HttpServletRequest httpServletRequest) static Map<String,MultipartFile> getMultiPartMap(HttpServletRequest httpServletRequest) getSuccessHttpStatus(Object response) voidhandleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private voidprocessFailure(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private voidprocessResponse(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private voidprocessResponsePdf(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, int httpStatusCode) private voidprocessSuccess(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private voidprocessWarningsIfAny(ChenileExchange exchange, HttpServletResponse httpServletResponse) private voidsetBody(HttpServletRequest httpServletRequest, ChenileExchange exchange)
-
Field Details
-
serviceDefinition
-
operationDefinition
-
chenileEntryPoint
-
localeResolver
-
om
-
-
Constructor Details
-
HttpEntryPoint
public HttpEntryPoint(ChenileServiceDefinition serviceDefinition, OperationDefinition operationDefinition, ChenileEntryPoint chenileEntryPoint)
-
-
Method Details
-
handleRequest
public void handleRequest(@NonNull HttpServletRequest httpServletRequest, @NonNull HttpServletResponse httpServletResponse) throws ServletException, IOException - Specified by:
handleRequestin interfaceHttpRequestHandler- Throws:
ServletExceptionIOException
-
getMultiPartMap
-
processSuccess
private void processSuccess(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception - Throws:
Exception
-
processFailure
private void processFailure(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException - Throws:
ServletExceptionIOException
-
processResponsePdf
private void processResponsePdf(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, int httpStatusCode) throws ServletException, IOException - Throws:
ServletExceptionIOException
-
processResponse
private void processResponse(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception - Throws:
Exception
-
processWarningsIfAny
private void processWarningsIfAny(ChenileExchange exchange, HttpServletResponse httpServletResponse) -
getSuccessHttpStatus
-
setBody
private void setBody(HttpServletRequest httpServletRequest, ChenileExchange exchange) throws IOException - Throws:
IOException
-
getHeaders
public static Map<String,Object> getHeaders(OperationDefinition od, HttpServletRequest httpServletRequest) -
extractPathVariables
-