public interface ResponseInterceptor
ResponseInterceptor
s may be configured for purposes such as verifying or modifying
headers of response, verifying the business status of decoded object, or processing responses to
unsuccessful requests. Once the interceptors are applied,
intercept(InvocationContext, Chain)
is called, then the response is
decoded.Modifier and Type | Interface and Description |
---|---|
static interface |
ResponseInterceptor.Chain
Contract for delegation to the rest of the chain.
|
Modifier and Type | Method and Description |
---|---|
default ResponseInterceptor |
andThen(ResponseInterceptor nextInterceptor)
Return a new
ResponseInterceptor that invokes the current interceptor first and then
the one that is passed in. |
default ResponseInterceptor.Chain |
apply(ResponseInterceptor.Chain chain)
Apply this interceptor to the given
Chain resulting in an intercepted chain. |
Object |
intercept(InvocationContext invocationContext,
ResponseInterceptor.Chain chain)
Called by
ResponseHandler after refreshing the response and wrapped around the whole
decode process, must either manually invoke ResponseInterceptor.Chain.next(InvocationContext) or manually
create a new response object |
Object intercept(InvocationContext invocationContext, ResponseInterceptor.Chain chain) throws Exception
ResponseHandler
after refreshing the response and wrapped around the whole
decode process, must either manually invoke ResponseInterceptor.Chain.next(InvocationContext)
or manually
create a new response objectinvocationContext
- information surrounding the response being decodedException
default ResponseInterceptor andThen(ResponseInterceptor nextInterceptor)
ResponseInterceptor
that invokes the current interceptor first and then
the one that is passed in.nextInterceptor
- the interceptor to delegate to after the currentdefault ResponseInterceptor.Chain apply(ResponseInterceptor.Chain chain)
Chain
resulting in an intercepted chain.chain
- the chain to add interception aroundCopyright © 2012–2023 OpenFeign. All rights reserved.