Top Description Fields Constructors Methods
reactor.netty5.http.client

pack-priv final Class WebsocketFinalizer

extends HttpClientConnect
implements WebsocketSender
Class Inheritance
All Implemented Interfaces
reactor.netty5.http.client.HttpClient.WebsocketSender, reactor.netty5.http.client.HttpClient.WebsocketReceiver, reactor.netty5.http.client.HttpClient.UriConfiguration
Imports
java.net.URI, java.util.Objects, java.util.function.BiFunction, .Function, io.netty5.buffer.BufferAllocator, io.netty5.channel.ChannelOption, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, reactor.netty5.BufferFlux, .Connection, reactor.netty5.channel.ChannelOperations, reactor.netty5.http.websocket.WebsocketInbound, .WebsocketOutbound

Configures the Websocket request before calling one of the terminal, Publisher based, WebsocketReceiver API.
Authors
Stephane Maldini, Violeta Georgieva

Field Summary

Inherited from reactor.netty5.http.client.HttpClientConnect:
ALLconfigDEFAULT_PORTlogURI_ADDRESS_MAPPER

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Mono<? extends Connection>
protected HttpClient
duplicate()

Overrides reactor.netty5.http.client.HttpClientConnect.duplicate.

Return a new Transport inheriting the current configuration.
public <V> Flux<V>
handle(BiFunction<? super WebsocketInbound, ? super WebsocketOutbound, ? extends Publisher<V>>
extracting receiver
receiver
)

Implements reactor.netty5.http.client.HttpClient.WebsocketReceiver.handle.

Negotiate a websocket upgrade and extract a flux from the given WebsocketInbound and WebsocketOutbound.
public BufferFlux
receive()

Implements reactor.netty5.http.client.HttpClient.WebsocketReceiver.receive.

Negotiate a websocket upgrade and extract a flux from the underlying WebsocketInbound.
public WebsocketFinalizer
send(Function<? super HttpClientRequest, ? extends Publisher<Void>>
a bifunction given the outgoing request returns a publisher that will terminate the request body on complete
sender
)

Implements reactor.netty5.http.client.HttpClient.WebsocketSender.send.

Configure headers to send on request using the returned Publisher to signal end of the request.
public HttpClient.WebsocketSender
uri(Mono<String>
target URI, if starting with "/" it will be prepended with baseUrl(String) when available
uri
)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response on subscribe
public HttpClient.WebsocketSender
uri(String
target URI, if starting with "/" it will be prepended with baseUrl(String) when available
uri
)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response
public HttpClient.WebsocketSender
uri(URI
target URI which is an absolute, fully constructed URI
uri
)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response.
Inherited from reactor.netty5.http.client.HttpClientConnect:
configurationtoString

Constructor Detail

WebsocketFinalizerback to summary
pack-priv WebsocketFinalizer(HttpClientConfig config)

Method Detail

connectback to summary
public Mono<? extends Connection> connect()

Overrides reactor.netty5.http.client.HttpClientConnect.connect.

Implements reactor.netty5.http.client.HttpClient.WebsocketReceiver.connect.

Doc from reactor.netty5.http.client.HttpClient.WebsocketReceiver.connect.

Negotiate a websocket upgrade and return a Mono of Connection. If Mono is cancelled, the underlying connection will be aborted. Once the Connection has been emitted and is not necessary anymore, disposing must be done by the user via Connection#dispose(). If update configuration phase fails, a Mono#error(Throwable) will be returned

Returns:Mono<? extends Connection>

a Mono of Connection

Annotations
@Override
duplicateback to summary
protected HttpClient duplicate()

Overrides reactor.netty5.http.client.HttpClientConnect.duplicate.

Doc from reactor.netty5.transport.Transport.duplicate.

Return a new Transport inheriting the current configuration. This is a shallow copy.

Returns:HttpClient

a new Transport inheriting the current configuration

Annotations
@Override
handleback to summary
public <V> Flux<V> handle(BiFunction<? super WebsocketInbound, ? super WebsocketOutbound, ? extends Publisher<V>> receiver)

Implements reactor.netty5.http.client.HttpClient.WebsocketReceiver.handle.

Doc from reactor.netty5.http.client.HttpClient.WebsocketReceiver.handle.

Negotiate a websocket upgrade and extract a flux from the given WebsocketInbound and WebsocketOutbound.

The connection will not automatically Connection#dispose() and manual disposing with the Connection, WebsocketOutbound#sendClose or the returned Flux might be necessary if the remote never terminates itself.

If the upgrade fails, the returned Flux will emit a io.netty5.handler.codec.http.websocketx.WebSocketHandshakeException

Parameters
<V>
the extracted flux type
receiver:BiFunction<? super WebsocketInbound, ? super WebsocketOutbound, ? extends Publisher<V>>

extracting receiver

Returns:Flux<V>

a Flux of the extracted data via the returned Publisher

Annotations
@Override
receiveback to summary
public BufferFlux receive()

Implements reactor.netty5.http.client.HttpClient.WebsocketReceiver.receive.

Doc from reactor.netty5.http.client.HttpClient.WebsocketReceiver.receive.

Negotiate a websocket upgrade and extract a flux from the underlying WebsocketInbound.

The connection will be disposed when the underlying subscriber is disposed OR when a close frame has been received, forwarding onComplete to the returned flux subscription.

If the upgrade fails, the returned Flux will emit a io.netty5.handler.codec.http.websocketx.WebSocketHandshakeException

Returns:BufferFlux

a BufferFlux of the inbound websocket content

Annotations
@Override
sendback to summary
public WebsocketFinalizer send(Function<? super HttpClientRequest, ? extends Publisher<Void>> sender)

Implements reactor.netty5.http.client.HttpClient.WebsocketSender.send.

Doc from reactor.netty5.http.client.HttpClient.WebsocketSender.send.

Configure headers to send on request using the returned Publisher to signal end of the request.

Parameters
sender:Function<? super HttpClientRequest, ? extends Publisher<Void>>

a bifunction given the outgoing request returns a publisher that will terminate the request body on complete

Returns:WebsocketFinalizer

a new ResponseReceiver

Annotations
@Override
uriback to summary
public HttpClient.WebsocketSender uri(Mono<String> uri)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Doc from reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response on subscribe

Parameters
uri:Mono<String>

target URI, if starting with "/" it will be prepended with baseUrl(String) when available

Returns:HttpClient.WebsocketSender

the appropriate sending or receiving contract

Annotations
@Override
uriback to summary
public HttpClient.WebsocketSender uri(String uri)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Doc from reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response

Parameters
uri:String

target URI, if starting with "/" it will be prepended with baseUrl(String) when available

Returns:HttpClient.WebsocketSender

the appropriate sending or receiving contract

Annotations
@Override
uriback to summary
public HttpClient.WebsocketSender uri(URI uri)

Implements reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Doc from reactor.netty5.http.client.HttpClient.UriConfiguration.uri.

Configure URI to use for this request/response.

Note

baseUrl(String) will have no effect when this method is used for configuring an URI.

Parameters
uri:URI

target URI which is an absolute, fully constructed URI

Returns:HttpClient.WebsocketSender

the appropriate sending or receiving contract

Annotations
@Override