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 |
|---|---|
static String |
BODY |
protected org.mule.runtime.api.metadata.MediaType |
defaultResponseMediaType |
static String |
HEADERS |
static String |
REASON_PHRASE |
static String |
REQUEST |
static String |
STATUS_CODE |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseExpressionHttpResponseInterceptor(org.mule.runtime.api.metadata.MediaType defaultResponseMediaType) |
| Modifier and Type | Method and Description |
|---|---|
protected org.mule.runtime.api.el.BindingContext |
createBindingContext(InterceptionHttpRequest httpRequest,
org.mule.runtime.http.api.domain.message.response.HttpResponse httpResponse)
Creates a
BindingContext with data resolved from the HttpResponseInterceptor and HttpResponse as
variables:
request: HttpResponseInterceptor
statusCode: int
reasonPhrase: String
headers: MultiMap |
protected <T> org.mule.runtime.api.metadata.TypedValue<T> |
evaluate(String expression,
org.mule.runtime.api.el.BindingContext bindingContext,
org.mule.runtime.api.metadata.DataType dataType,
org.mule.runtime.api.el.ExpressionLanguage expressionLanguage)
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) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitintercept, matchpublic static final String REQUEST
public static final String STATUS_CODE
public static final String REASON_PHRASE
public static final String HEADERS
public static final String BODY
protected org.mule.runtime.api.metadata.MediaType defaultResponseMediaType
protected BaseExpressionHttpResponseInterceptor(org.mule.runtime.api.metadata.MediaType defaultResponseMediaType)
protected org.mule.runtime.api.el.BindingContext createBindingContext(InterceptionHttpRequest httpRequest, org.mule.runtime.http.api.domain.message.response.HttpResponse httpResponse)
BindingContext with data resolved from the HttpResponseInterceptor and HttpResponse as
variables:
httpRequest - the request to be injected to the binding context.httpResponse - the response to retrieve the values for variables related to response.BindingContext.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.BindingContext bindingContext, org.mule.runtime.api.metadata.DataType dataType, org.mule.runtime.api.el.ExpressionLanguage expressionLanguage)
T - type of the output TypedValue.expression - to be evaluated.bindingContext - to be provided for the expression language.dataType - the output DataType for the result of the expression evaluation.expressionLanguage - ExpressionLanguage to delegate the invocation.TypedValue.Copyright © 2021. All rights reserved.