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
Modifier and TypeFieldDescriptionprivate final ChenileEntryPoint
private final LocaleResolver
private static final ObjectMapper
private final OperationDefinition
private final ChenileServiceDefinition
-
Constructor Summary
ConstructorDescriptionHttpEntryPoint
(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) void
handleRequest
(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private void
processFailure
(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private void
processResponse
(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private void
processResponsePdf
(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, int httpStatusCode) private void
processSuccess
(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) private void
processWarningsIfAny
(ChenileExchange exchange, HttpServletResponse httpServletResponse) private void
setBody
(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:
handleRequest
in interfaceHttpRequestHandler
- Throws:
ServletException
IOException
-
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:
ServletException
IOException
-
processResponsePdf
private void processResponsePdf(ChenileExchange exchange, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, int httpStatusCode) throws ServletException, IOException - Throws:
ServletException
IOException
-
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
-