Package io.quarkus.websockets.next
Interface WebSocketClientConnection
- All Superinterfaces:
BlockingSender,Sender
- All Known Implementing Classes:
WebSocketClientConnectionImpl
@Experimental("This API is experimental and may change in the future")
public interface WebSocketClientConnection
extends Sender, BlockingSender
This interface represents a client connection to a WebSocket endpoint.
Quarkus provides a built-in CDI bean that implements this interface and can be injected in a WebSocketClient
endpoint and used to interact with the connected server.
-
Method Summary
Modifier and TypeMethodDescriptionclientId()default io.smallrye.mutiny.Uni<Void>close()Close the connection.io.smallrye.mutiny.Uni<Void>close(CloseReason reason) Close the connection with a specific reason.default voidClose the connection and wait for the completion.default voidcloseAndAwait(CloseReason reason) Close the connection with a specific reason and wait for the completion.id()booleanisClosed()default booleanisOpen()booleanisSecure()Methods inherited from interface io.quarkus.websockets.next.BlockingSender
sendBinaryAndAwait, sendBinaryAndAwait, sendPingAndAwait, sendPongAndAwait, sendTextAndAwait, sendTextAndAwaitMethods inherited from interface io.quarkus.websockets.next.Sender
sendBinary, sendBinary, sendPing, sendPong, sendText, sendText
-
Method Details
-
id
String id()- Returns:
- the unique identifier assigned to this connection
-
clientId
String clientId() -
pathParam
- Parameters:
name-- Returns:
- the value of the path parameter or
null - See Also:
-
isSecure
boolean isSecure()- Returns:
trueif the HTTP connection is encrypted via SSL/TLS
-
isClosed
boolean isClosed()- Returns:
trueif the WebSocket is closed
-
closeReason
CloseReason closeReason()- Returns:
- the close reason or
nullif the connection is not closed
-
isOpen
default boolean isOpen()- Returns:
trueif the WebSocket is open
-
close
Close the connection.- Returns:
- a new
Uniwith anullitem
-
close
Close the connection with a specific reason.- Parameters:
reason-- Returns:
- a new
Uniwith anullitem
-
closeAndAwait
default void closeAndAwait()Close the connection and wait for the completion. -
closeAndAwait
Close the connection with a specific reason and wait for the completion. -
handshakeRequest
HandshakeRequest handshakeRequest()- Returns:
- the handshake request
-