Class QuicConnection

java.lang.Object
io.vertx.mutiny.core.net.QuicConnection
All Implemented Interfaces:
MutinyDelegate

public class QuicConnection extends Object implements MutinyDelegate

A Quic connection between a client and a server, providing support for handling or creating Quic streams

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Julien Viet
See Also:
  • QuicConnection
  • Field Details

  • Constructor Details

    • QuicConnection

      public QuicConnection(io.vertx.core.net.QuicConnection delegate)
      Create a new instance of QuicConnection delegating to the given (non-null) instance of QuicConnection.
    • QuicConnection

      public QuicConnection(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.net.QuicConnection getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • openStream

      @CheckReturnValue public io.smallrye.mutiny.Uni<QuicStream> openStream()
      Open a bidirectional stream to the remote endpoint.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.openStream()
    • openStreamAndAwait

      public QuicStream openStreamAndAwait()
      Open a bidirectional stream to the remote endpoint.

      Unlike the bare Vert.x variant, this method returns a QuicStream. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • QuicConnection.openStream()
    • openStreamAndForget

      public QuicConnection openStreamAndForget()
      Open a bidirectional stream to the remote endpoint.

      Unlike the bare Vert.x variant, this method ignores the QuicStream result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.openStream()
    • openStream

      @CheckReturnValue public io.smallrye.mutiny.Uni<QuicStream> openStream(boolean bidirectional)
      Open a stream to the remote endpoint with bidirectional parameter specifying its directionality.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      bidirectional - whether the stream is unidirectional or bidirectional
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.openStream(boolean)
    • openStreamAndAwait

      public QuicStream openStreamAndAwait(boolean bidirectional)
      Open a stream to the remote endpoint with bidirectional parameter specifying its directionality.

      Unlike the bare Vert.x variant, this method returns a QuicStream. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      bidirectional - whether the stream is unidirectional or bidirectional
      Returns:
      The operation result
      See Also:
      • QuicConnection.openStream(boolean)
    • openStreamAndForget

      public QuicConnection openStreamAndForget(boolean bidirectional)
      Open a stream to the remote endpoint with bidirectional parameter specifying its directionality.

      Unlike the bare Vert.x variant, this method ignores the QuicStream result or any failure.

      Parameters:
      bidirectional - whether the stream is unidirectional or bidirectional
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.openStream(boolean)
    • writeDatagram

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> writeDatagram(io.vertx.core.buffer.Buffer buffer)
      Send a datagram.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      buffer - the datagram
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.writeDatagram(Buffer)
    • writeDatagramAndAwait

      public void writeDatagramAndAwait(io.vertx.core.buffer.Buffer buffer)
      Send a datagram.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      buffer - the datagram
      See Also:
      • QuicConnection.writeDatagram(Buffer)
    • writeDatagramAndForget

      public QuicConnection writeDatagramAndForget(io.vertx.core.buffer.Buffer buffer)
      Send a datagram.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      buffer - the datagram
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.writeDatagram(Buffer)
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Close the connection, all associated streams will be closed before.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.close()
    • closeAndAwait

      public void closeAndAwait()
      Close the connection, all associated streams will be closed before.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • QuicConnection.close()
    • closeAndForget

      public QuicConnection closeAndForget()
      Close the connection, all associated streams will be closed before.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.close()
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close(io.vertx.core.net.QuicConnectionClose payload)
      Close the connection, all associated streams will be closed before.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      payload - the close payload
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.close(QuicConnectionClose)
    • closeAndAwait

      public void closeAndAwait(io.vertx.core.net.QuicConnectionClose payload)
      Close the connection, all associated streams will be closed before.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      payload - the close payload
      See Also:
      • QuicConnection.close(QuicConnectionClose)
    • closeAndForget

      public QuicConnection closeAndForget(io.vertx.core.net.QuicConnectionClose payload)
      Close the connection, all associated streams will be closed before.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      payload - the close payload
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.close(QuicConnectionClose)
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown()
      Shutdown with a 30 seconds timeout.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.shutdown()
    • shutdownAndAwait

      public void shutdownAndAwait()
      Shutdown with a 30 seconds timeout.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      See Also:
      • QuicConnection.shutdown()
    • shutdownAndForget

      public QuicConnection shutdownAndForget()
      Shutdown with a 30 seconds timeout.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.shutdown()
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown(Duration timeout)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight streams are processed, otherwise after a timeout the connection will be closed.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.shutdown(Duration)
    • shutdownAndAwait

      public void shutdownAndAwait(Duration timeout)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight streams are processed, otherwise after a timeout the connection will be closed.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      See Also:
      • QuicConnection.shutdown(Duration)
    • shutdownAndForget

      public QuicConnection shutdownAndForget(Duration timeout)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight streams are processed, otherwise after a timeout the connection will be closed.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.shutdown(Duration)
    • shutdown

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> shutdown(Duration timeout, io.vertx.core.net.QuicConnectionClose payload)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight streams are processed, otherwise after a timeout the connection will be closed.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      payload - the close payload
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • QuicConnection.shutdown(Duration, QuicConnectionClose)
    • shutdownAndAwait

      public void shutdownAndAwait(Duration timeout, io.vertx.core.net.QuicConnectionClose payload)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight streams are processed, otherwise after a timeout the connection will be closed.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      payload - the close payload
      See Also:
      • QuicConnection.shutdown(Duration, QuicConnectionClose)
    • shutdownAndForget

      public QuicConnection shutdownAndForget(Duration timeout, io.vertx.core.net.QuicConnectionClose payload)
      Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight streams are processed, otherwise after a timeout the connection will be closed.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Parameters:
      timeout - the amount of time after which all resources are forcibly closed
      payload - the close payload
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • QuicConnection.shutdown(Duration, QuicConnectionClose)
    • streamHandler

      public QuicConnection streamHandler(Consumer<QuicStream> handler)
      Set a handler processing incoming Quic streams.
      Parameters:
      handler - the handler processing streams
      Returns:
      this instance of a connection
    • shutdownHandler

      public QuicConnection shutdownHandler(Consumer<Duration> handler)
      Set a handler notified when the connection is shutdown: the client or server will close the connection within a certain amount of time. This gives the opportunity to the handler to close the connection gracefully before the socket is closed.
      Parameters:
      handler - the handler notified
      Returns:
      a reference to this, so the API can be used fluently
    • closeHandler

      public QuicConnection closeHandler(Runnable handler)
      Set a handler called when the connection is closed.
      Parameters:
      handler - the handler signaled with the connection close
      Returns:
      this instance of a connection
    • datagramHandler

      public QuicConnection datagramHandler(Consumer<io.vertx.core.buffer.Buffer> handler)
      Set a handler called with the datagram addressed to this connection.
      Parameters:
      handler - the handler
      Returns:
      this instance of a connection
    • applicationLayerProtocol

      public String applicationLayerProtocol()
      Returns:
      the application-level protocol negotiated during the TLS handshake
    • indicatedServerName

      public String indicatedServerName()
      Returns:
      the server name indicated during the TLS handshake
    • transportParams

      public io.vertx.core.net.QuicTransportParams transportParams()
      Returns:
      the transport parameters
    • maxDatagramLength

      public int maxDatagramLength()
      Returns:
      the maximum number of bytes the datagram payload can be or 0 when the datagram extension is disabled
    • sslSession

      public SSLSession sslSession()
      Returns:
      SSLSession associated with the underlying socket. Returns null if connection is not SSL.
      See Also:
    • closePayload

      public io.vertx.core.net.QuicConnectionClose closePayload()
      Returns:
      the close payload, available after the close handler is signaled
    • remoteAddress

      public io.vertx.core.net.SocketAddress remoteAddress()
      Returns:
      the remote connection socket address
    • localAddress

      public io.vertx.core.net.SocketAddress localAddress()
      Returns:
      the local connection socket address
    • newInstance

      public static QuicConnection newInstance(io.vertx.core.net.QuicConnection delegate)
      Creates a new instance of the QuicConnection.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object