Class BasicWebSocketConnectorImpl
java.lang.Object
io.quarkus.websockets.next.runtime.WebSocketConnectorBase<BasicWebSocketConnectorImpl>
io.quarkus.websockets.next.runtime.BasicWebSocketConnectorImpl
- All Implemented Interfaces:
BasicWebSocketConnector
@Typed(BasicWebSocketConnector.class)
@Dependent
public class BasicWebSocketConnectorImpl
extends WebSocketConnectorBase<BasicWebSocketConnectorImpl>
implements BasicWebSocketConnector
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.quarkus.websockets.next.BasicWebSocketConnector
BasicWebSocketConnector.ExecutionModel -
Field Summary
Fields inherited from class io.quarkus.websockets.next.runtime.WebSocketConnectorBase
baseUri, codecs, config, connectionManager, headers, path, PATH_PARAM_PATTERN, pathParamNames, pathParams, subprotocols, tlsConfigurationRegistry, vertx -
Constructor Summary
ConstructorsConstructorDescriptionBasicWebSocketConnectorImpl(io.vertx.core.Vertx vertx, Codecs codecs, ClientConnectionManager connectionManager, WebSocketsClientRuntimeConfig config, TlsConfigurationRegistry tlsConfigurationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<WebSocketClientConnection> connect()Set the execution model for callback handlers.onBinaryMessage(BiConsumer<WebSocketClientConnection, io.vertx.core.buffer.Buffer> consumer) Set a callback to be invoked when a binary message is received from the server.onClose(BiConsumer<WebSocketClientConnection, CloseReason> consumer) Set a callback to be invoked when a connection to the server is closed.onError(BiConsumer<WebSocketClientConnection, Throwable> consumer) Set a callback to be invoked when an error occurs.onOpen(Consumer<WebSocketClientConnection> consumer) Set a callback to be invoked when a connection to the server is open.onPing(BiConsumer<WebSocketClientConnection, io.vertx.core.buffer.Buffer> consumer) Set a callback to be invoked when a ping message is received from the server.onPong(BiConsumer<WebSocketClientConnection, io.vertx.core.buffer.Buffer> consumer) Set a callback to be invoked when a pong message is received from the server.onTextMessage(BiConsumer<WebSocketClientConnection, String> consumer) Set a callback to be invoked when a text message is received from the server.Set the path that should be appended to the path of the URI set byBasicWebSocketConnector.baseUri(URI).Methods inherited from class io.quarkus.websockets.next.runtime.WebSocketConnectorBase
addHeader, addSubprotocol, baseUri, getPathParamNames, isSecure, newConnectOptions, pathParam, populateClientOptions, replacePathParameters, self, setPathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.quarkus.websockets.next.BasicWebSocketConnector
addHeader, addSubprotocol, baseUri, baseUri, connectAndAwait, pathParam
-
Constructor Details
-
BasicWebSocketConnectorImpl
BasicWebSocketConnectorImpl(io.vertx.core.Vertx vertx, Codecs codecs, ClientConnectionManager connectionManager, WebSocketsClientRuntimeConfig config, TlsConfigurationRegistry tlsConfigurationRegistry)
-
-
Method Details
-
executionModel
Description copied from interface:BasicWebSocketConnectorSet the execution model for callback handlers.By default,
BasicWebSocketConnector.ExecutionModel.BLOCKINGis used.- Specified by:
executionModelin interfaceBasicWebSocketConnector- Returns:
- self
- See Also:
-
path
Description copied from interface:BasicWebSocketConnectorSet the path that should be appended to the path of the URI set byBasicWebSocketConnector.baseUri(URI).The path may contain path parameters as defined by
WebSocketClient.path(). In this case, theBasicWebSocketConnector.pathParam(String, String)method must be used to pass path param values.- Specified by:
pathin interfaceBasicWebSocketConnector- Parameters:
path-- Returns:
- self
-
onOpen
Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when a connection to the server is open.- Specified by:
onOpenin interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
onTextMessage
Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when a text message is received from the server.- Specified by:
onTextMessagein interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
onBinaryMessage
public BasicWebSocketConnector onBinaryMessage(BiConsumer<WebSocketClientConnection, io.vertx.core.buffer.Buffer> consumer) Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when a binary message is received from the server.- Specified by:
onBinaryMessagein interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
onPing
public BasicWebSocketConnector onPing(BiConsumer<WebSocketClientConnection, io.vertx.core.buffer.Buffer> consumer) Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when a ping message is received from the server.- Specified by:
onPingin interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
onPong
public BasicWebSocketConnector onPong(BiConsumer<WebSocketClientConnection, io.vertx.core.buffer.Buffer> consumer) Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when a pong message is received from the server.- Specified by:
onPongin interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
onClose
Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when a connection to the server is closed.- Specified by:
onClosein interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
onError
Description copied from interface:BasicWebSocketConnectorSet a callback to be invoked when an error occurs.- Specified by:
onErrorin interfaceBasicWebSocketConnector- Parameters:
consumer-- Returns:
- self
- See Also:
-
connect
- Specified by:
connectin interfaceBasicWebSocketConnector- Returns:
- a new
Uniwith aWebSocketClientConnectionitem
-