Package io.quarkus.websockets.next
Interface WebSocketConnector<CLIENT>
- Type Parameters:
CLIENT- The client endpoint class
- All Known Implementing Classes:
WebSocketConnectorImpl
@Experimental("This API is experimental and may change in the future")
public interface WebSocketConnector<CLIENT>
This connector can be used to configure and open new client connections using a client endpoint class.
This construct is not thread-safe and should not be used concurrently.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdd a header used during the initial handshake request.addSubprotocol(String value) Add the subprotocol.default WebSocketConnector<CLIENT>Set the base URI.Set the base URI.io.smallrye.mutiny.Uni<WebSocketClientConnection>connect()default WebSocketClientConnectionSet the path param.
-
Method Details
-
baseUri
Set the base URI.- Parameters:
baseUri-- Returns:
- self
-
baseUri
Set the base URI.- Parameters:
baseUri-- Returns:
- self
-
pathParam
Set the path param.The value is encoded using
URLEncoder.encode(String, java.nio.charset.Charset)before it's used to build the target URI.- Parameters:
name-value-- Returns:
- self
- Throws:
IllegalArgumentException- If the client endpoint path does not contain a parameter with the given name- See Also:
-
addHeader
Add a header used during the initial handshake request.- Parameters:
name-value-- Returns:
- self
- See Also:
-
addSubprotocol
Add the subprotocol.- Parameters:
name-value-- Returns:
- self
-
connect
- Returns:
- a new
Uniwith aWebSocketClientConnectionitem
-
connectAndAwait
- Returns:
- the client connection
-