class WiretapConnector extends java.lang.Object implements ClientHttpConnector
ClientHttpConnector
with the purpose of
intercepting, capturing, and exposing actual request and response data
transmitted to and received from the server.HttpHandlerConnector
Modifier and Type | Class and Description |
---|---|
(package private) class |
WiretapConnector.Info
|
private static class |
WiretapConnector.WiretapClientHttpRequest
ClientHttpRequestDecorator that intercepts and saves the request body.
|
private static class |
WiretapConnector.WiretapClientHttpResponse
ClientHttpResponseDecorator that intercepts and saves the response body.
|
(package private) static class |
WiretapConnector.WiretapRecorder
Tap into a Publisher of data buffers to save the content.
|
Modifier and Type | Field and Description |
---|---|
private ClientHttpConnector |
delegate |
private java.util.Map<java.lang.String,WiretapConnector.Info> |
exchanges |
Constructor and Description |
---|
WiretapConnector(ClientHttpConnector delegate) |
Modifier and Type | Method and Description |
---|---|
WiretapConnector.Info |
claimRequest(java.lang.String requestId)
Retrieve the
WiretapConnector.Info for the given "request-id" header value. |
<any> |
connect(HttpMethod method,
java.net.URI uri,
java.util.function.Function<? super ClientHttpRequest,<any>> requestCallback)
Connect to the origin server using the given
HttpMethod and
URI and apply the given requestCallback when the HTTP
request of the underlying API can be initialized and written to. |
private final ClientHttpConnector delegate
private final java.util.Map<java.lang.String,WiretapConnector.Info> exchanges
WiretapConnector(ClientHttpConnector delegate)
public <any> connect(HttpMethod method, java.net.URI uri, java.util.function.Function<? super ClientHttpRequest,<any>> requestCallback)
ClientHttpConnector
HttpMethod
and
URI
and apply the given requestCallback
when the HTTP
request of the underlying API can be initialized and written to.connect
in interface ClientHttpConnector
method
- the HTTP request methoduri
- the HTTP request URIrequestCallback
- a function that prepares and writes to the request,
returning a publisher that signals when it's done writing.
Implementations can return a Mono<Void>
by calling
ReactiveHttpOutputMessage.writeWith(<any>)
or ReactiveHttpOutputMessage.setComplete()
.ClientHttpResponse
public WiretapConnector.Info claimRequest(java.lang.String requestId)
WiretapConnector.Info
for the given "request-id" header value.