Interface Connection

All Superinterfaces:
Sender
All Known Subinterfaces:
WebSocketClientConnection, WebSocketConnection
All Known Implementing Classes:
WebSocketClientConnectionImpl, WebSocketConnectionBase, WebSocketConnectionImpl

public interface Connection extends Sender
WebSocket connection.
See Also:
  • Method Details

    • id

      String id()
      Returns:
      the unique identifier assigned to this connection
    • pathParam

      String pathParam(String name)
      Parameters:
      name -
      Returns:
      the value of the path parameter or null
      See Also:
    • isSecure

      boolean isSecure()
      Returns:
      true if the HTTP connection is encrypted via SSL/TLS
    • isClosed

      boolean isClosed()
      Returns:
      true if the WebSocket is closed
    • closeReason

      CloseReason closeReason()
      Returns:
      the close reason or null if the connection is not closed
    • isOpen

      default boolean isOpen()
      Returns:
      true if the WebSocket is open
    • close

      @CheckReturnValue default io.smallrye.mutiny.Uni<Void> close()
      Close the connection.
      Returns:
      a new Uni with a null item
    • close

      io.smallrye.mutiny.Uni<Void> close(CloseReason reason)
      Close the connection with a specific reason.
      Parameters:
      reason -
      Returns:
      a new Uni with a null item
    • closeAndAwait

      default void closeAndAwait()
      Close the connection and wait for the completion.
    • closeAndAwait

      default void closeAndAwait(CloseReason reason)
      Close the connection with a specific reason and wait for the completion.
    • handshakeRequest

      HandshakeRequest handshakeRequest()
      Returns:
      the handshake request
    • creationTime

      Instant creationTime()
      Returns:
      the time when this connection was created
    • userData

      UserData userData()
      Returns:
      the user data associated with this connection