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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoPostProcessing(ChenileExchange chenileExchange) Override this to do post processing.private HttpStatusgetSuccessHttpStatus(ChenileExchange exchange) private voidpopulateResponseMessages(GenericResponse<Object> genericResponse, ChenileExchange exchange) private voidprocessFailure(ChenileExchange exchange) private voidprocessSuccess(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:BaseChenileInterceptorOverride 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:
doPostProcessingin classBaseChenileInterceptor- Parameters:
chenileExchange- Chenile Exchange
-
getSuccessHttpStatus
-
processFailure
-
populateResponseMessages
private void populateResponseMessages(GenericResponse<Object> genericResponse, ChenileExchange exchange) -
processSuccess
-