Class NetServer

java.lang.Object
io.vertx.mutiny.core.net.NetServer
All Implemented Interfaces:
MutinyDelegate, Measured

public class NetServer extends Object implements MutinyDelegate, Measured
Represents a TCP server

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

  • Field Details

  • Constructor Details

    • NetServer

      public NetServer(io.vertx.core.net.NetServer delegate)
    • NetServer

      public NetServer(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.core.net.NetServer getDelegate()
      Specified by:
      getDelegate in interface Measured
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

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

      public boolean isMetricsEnabled()
      Specified by:
      isMetricsEnabled in interface Measured
      Returns:
      true if metrics are enabled
    • connectStream

      @Deprecated public ReadStream<NetSocket> connectStream()
      Deprecated.
      instead use #connectHandler(Handler)
      Returns:
      the connect stream
    • connectHandler

      public NetServer connectHandler(Consumer<NetSocket> handler)
      Parameters:
      handler -
      Returns:
    • listen

      @CheckReturnValue public io.smallrye.mutiny.Uni<NetServer> listen()
      Like listen() but providing a handler that will be notified when the server is listening, or fails.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • listenAndAwait

      public NetServer listenAndAwait()
      Blocking variant of listen().

      This method waits 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 NetServer instance produced by the operation.
    • listenAndForget

      public NetServer listenAndForget()
      Variant of listen() that ignores the result of the operation.

      This method subscribes on the result of listen(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from listen() but you don't need to compose it with other operations.

      Returns:
      the instance of NetServer to chain method calls.
    • listen

      @CheckReturnValue public io.smallrye.mutiny.Uni<NetServer> listen(int port, String host)
      Like listen() but providing a handler that will be notified when the server is listening, or fails.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      port - the port to listen on
      host - the host to listen on
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • listenAndAwait

      public NetServer listenAndAwait(int port, String host)
      Blocking variant of listen(int,String).

      This method waits 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:
      port - the port to listen on
      host - the host to listen on
      Returns:
      the NetServer instance produced by the operation.
    • listenAndForget

      public NetServer listenAndForget(int port, String host)
      Variant of listen(int,String) that ignores the result of the operation.

      This method subscribes on the result of listen(int,String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from listen(int,String) but you don't need to compose it with other operations.

      Parameters:
      port - the port to listen on
      host - the host to listen on
      Returns:
      the instance of NetServer to chain method calls.
    • listen

      @CheckReturnValue public io.smallrye.mutiny.Uni<NetServer> listen(int port)
      Like listen() but providing a handler that will be notified when the server is listening, or fails.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      port - the port to listen on
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • listenAndAwait

      public NetServer listenAndAwait(int port)
      Blocking variant of listen(int).

      This method waits 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:
      port - the port to listen on
      Returns:
      the NetServer instance produced by the operation.
    • listenAndForget

      public NetServer listenAndForget(int port)
      Variant of listen(int) that ignores the result of the operation.

      This method subscribes on the result of listen(int), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from listen(int) but you don't need to compose it with other operations.

      Parameters:
      port - the port to listen on
      Returns:
      the instance of NetServer to chain method calls.
    • listen

      @CheckReturnValue public io.smallrye.mutiny.Uni<NetServer> listen(SocketAddress localAddress)
      Like listen() but providing a handler that will be notified when the server is listening, or fails.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      localAddress - the local address to listen on
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • listenAndAwait

      public NetServer listenAndAwait(SocketAddress localAddress)
      Blocking variant of listen(io.vertx.mutiny.core.net.SocketAddress).

      This method waits 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:
      localAddress - the local address to listen on
      Returns:
      the NetServer instance produced by the operation.
    • listenAndForget

      public NetServer listenAndForget(SocketAddress localAddress)
      Variant of listen(io.vertx.mutiny.core.net.SocketAddress) that ignores the result of the operation.

      This method subscribes on the result of listen(io.vertx.mutiny.core.net.SocketAddress), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from listen(io.vertx.mutiny.core.net.SocketAddress) but you don't need to compose it with other operations.

      Parameters:
      localAddress - the local address to listen on
      Returns:
      the instance of NetServer to chain method calls.
    • close

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> close()
      Like close() but supplying a handler that will be notified when close is complete.

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • closeAndAwait

      public Void closeAndAwait()
      Blocking variant of close().

      This method waits 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 Void instance produced by the operation.
    • closeAndForget

      public void closeAndForget()
      Variant of close() that ignores the result of the operation.

      This method subscribes on the result of close(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from close() but you don't need to compose it with other operations.

    • actualPort

      public int actualPort()
      Returns:
      the actual port the server is listening on.
    • updateSSLOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.SSLOptions options)
      Like updateSSLOptions(io.vertx.core.net.SSLOptions) but supplying a handler that will be called when the update happened (or has failed).

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      options - the new SSL options
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • updateSSLOptionsAndAwait

      public Boolean updateSSLOptionsAndAwait(io.vertx.core.net.SSLOptions options)
      Blocking variant of updateSSLOptions(SSLOptions).

      This method waits 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:
      options - the new SSL options
      Returns:
      the Boolean instance produced by the operation.
    • updateSSLOptionsAndForget

      public void updateSSLOptionsAndForget(io.vertx.core.net.SSLOptions options)
      Variant of updateSSLOptions(SSLOptions) that ignores the result of the operation.

      This method subscribes on the result of updateSSLOptions(SSLOptions), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from updateSSLOptions(SSLOptions) but you don't need to compose it with other operations.

      Parameters:
      options - the new SSL options
    • updateSSLOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.SSLOptions options, boolean force)
      Like updateSSLOptions(io.vertx.core.net.SSLOptions) but supplying a handler that will be called when the update happened (or has failed).

      Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      the uni firing the result of the operation when completed, or a failure if the operation failed.
    • updateSSLOptionsAndAwait

      public Boolean updateSSLOptionsAndAwait(io.vertx.core.net.SSLOptions options, boolean force)
      Blocking variant of updateSSLOptions(SSLOptions,boolean).

      This method waits 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:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      the Boolean instance produced by the operation.
    • updateSSLOptionsAndForget

      public void updateSSLOptionsAndForget(io.vertx.core.net.SSLOptions options, boolean force)
      Variant of updateSSLOptions(SSLOptions,boolean) that ignores the result of the operation.

      This method subscribes on the result of updateSSLOptions(SSLOptions,boolean), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from updateSSLOptions(SSLOptions,boolean) but you don't need to compose it with other operations.

      Parameters:
      options - the new SSL options
      force - force the update when options are equals
    • updateTrafficShapingOptions

      public void updateTrafficShapingOptions(io.vertx.core.net.TrafficShapingOptions options)
      Parameters:
      options - the new traffic shaping options
    • newInstance

      public static NetServer newInstance(io.vertx.core.net.NetServer arg)