public abstract class BaseExpressionHttpResponseInterceptor extends Object implements HttpResponseInterceptor
HttpResponseInterceptor that relies on DW expressions. It allows use of DW expressions to
define the matching condition and transformations for statusCode, reasonPhrase, headers and body.
BindingContext provided on each expression has the original HttpResponse data with the following variables:
| Modifier and Type | Field and Description |
|---|---|
protected StreamingHelper |
streamingHelper |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseExpressionHttpResponseInterceptor(org.mule.runtime.api.metadata.MediaType defaultResponseMediaType,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage,
StreamingHelper streamingHelper) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract RepeatableHttpResponse |
doIntercept(HttpRequest httpRequest,
RepeatableHttpResponse repeatableHttpResponse,
org.mule.runtime.api.el.ExpressionLanguageSession session,
org.mule.runtime.api.el.BindingContext bindingContext,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage) |
protected <T> org.mule.runtime.api.metadata.TypedValue<T> |
evaluate(String expression,
org.mule.runtime.api.el.ExpressionLanguageSession session,
org.mule.runtime.api.metadata.DataType dataType)
Evaluates an expression giving the bindingContext and dataType.
|
protected org.mule.runtime.api.metadata.MediaType |
getMediaType(org.mule.runtime.http.api.domain.message.response.HttpResponse httpResponse) |
org.mule.runtime.http.api.domain.message.response.HttpResponse |
intercept(HttpRequest httpRequest,
org.mule.runtime.http.api.domain.message.response.HttpResponse httpResponse)
Process an
HttpResponse and generate a new one or return the one provided. |
protected StreamingHelper streamingHelper
protected BaseExpressionHttpResponseInterceptor(org.mule.runtime.api.metadata.MediaType defaultResponseMediaType,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage,
StreamingHelper streamingHelper)
protected org.mule.runtime.api.metadata.MediaType getMediaType(org.mule.runtime.http.api.domain.message.response.HttpResponse httpResponse)
protected <T> org.mule.runtime.api.metadata.TypedValue<T> evaluate(String expression, org.mule.runtime.api.el.ExpressionLanguageSession session, org.mule.runtime.api.metadata.DataType dataType)
T - type of the output TypedValue.expression - to be evaluated.session - expression language session.dataType - the output DataType for the result of the expression evaluation.TypedValue.public org.mule.runtime.http.api.domain.message.response.HttpResponse intercept(HttpRequest httpRequest, org.mule.runtime.http.api.domain.message.response.HttpResponse httpResponse)
HttpResponseInterceptorHttpResponse and generate a new one or return the one provided.intercept in interface HttpResponseInterceptorhttpRequest - the HTTP request that was executed against the server.httpResponse - the server response to be intercepted. Entity's content could not be read more than once, so
implementations should address this when content needs to be accessed more than once.HttpResponse.protected abstract RepeatableHttpResponse doIntercept(HttpRequest httpRequest, RepeatableHttpResponse repeatableHttpResponse, org.mule.runtime.api.el.ExpressionLanguageSession session, org.mule.runtime.api.el.BindingContext bindingContext, org.mule.runtime.api.el.ExpressionLanguage expressionLanguage)
Copyright © 2022. All rights reserved.