Package org.chenile.core.interceptors
Class GenericResponseBuilder
java.lang.Object
org.chenile.core.interceptors.BaseChenileInterceptor
org.chenile.core.interceptors.GenericResponseBuilder
- All Implemented Interfaces:
Command<ChenileExchange>
Constructs a generic response from the response and exception that has been thrown.
This also sets the Http Status and warnings in the exchange so that the HTTP controller can access them directly from exchange.
This also sets the Http Status and warnings in the exchange so that the HTTP controller can access them directly from exchange.
- Author:
- Raja Shankar Kolluru
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doPostProcessing
(ChenileExchange chenileExchange) Override this to do post processing.private HttpStatus
getSuccessHttpStatus
(ChenileExchange exchange) private void
populateResponseMessages
(GenericResponse<Object> genericResponse, ChenileExchange exchange) private void
processFailure
(ChenileExchange exchange) private void
processSuccess
(ChenileExchange exchange) Methods inherited from class org.chenile.core.interceptors.BaseChenileInterceptor
bypassInterception, doContinue, doPreProcessing, execute, getExtensionByAnnotation, getExtensionByAnnotation, resumeFromSavedPoint, savePoint
-
Constructor Details
-
GenericResponseBuilder
public GenericResponseBuilder()
-
-
Method Details
-
doPostProcessing
Description copied from class:BaseChenileInterceptor
Override this to do post processing. This will be called even if there is an exception downstream. So make sure that if you don't want to do any processing in case of exception, check ifChenileExchange.getException()
returns null value. If you happen to throw an exception in this method, it will get added to the set of errors that would ultimately be returned. See alsoChenileExchange.setException(Throwable)
- Overrides:
doPostProcessing
in classBaseChenileInterceptor
- Parameters:
chenileExchange
- Chenile Exchange
-
getSuccessHttpStatus
-
processFailure
-
populateResponseMessages
private void populateResponseMessages(GenericResponse<Object> genericResponse, ChenileExchange exchange) -
processSuccess
-