io.vertx.rxjava3.mqtt

## Class MqttServer

- java.lang.Object
- - io.vertx.rxjava3.mqtt.MqttServer

-     public class MqttServer
      extends Object

  An MQTT server

  You can accept incoming MQTT connection requests providing a `endpointHandler(io.vertx.core.Handler<io.vertx.rxjava3.mqtt.MqttEndpoint>)`. As the requests arrive, the handler will be called with an instance of `MqttEndpoint` in order to manage the communication with the remote MQTT client.

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<MqttServer>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MqttServer(MqttServer delegate)`
    `MqttServer(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `actualPort()` The actual port the server is listening on.
    `Completable` | `close()` Close the server supplying an handler that will be called when the server is actually closed (or has failed).
    `static MqttServer` | `create(Vertx vertx)` Return an MQTT server instance using default options
    `static MqttServer` | `create(Vertx vertx, MqttServerOptions options)` Return an MQTT server instance
    `MqttServer` | `endpointHandler(Handler<MqttEndpoint> handler)` Set the endpoint handler for the server.
    `boolean` | `equals(Object o)`
    `MqttServer` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler for the server, that will be called when an error happens independantly of an accepted `MqttEndpoint`, like a rejected connection
    `MqttServer` | `getDelegate()`
    `int` | `hashCode()`
    `Single<MqttServer>` | `listen()` Start the server listening for incoming connections using the specified options through the constructor
    `Single<MqttServer>` | `listen(int port)` Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.
    `Single<MqttServer>` | `listen(int port, String host)` Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor
    `static MqttServer` | `newInstance(MqttServer arg)`
    `Completable` | `rxClose()` Close the server supplying an handler that will be called when the server is actually closed (or has failed).
    `Single<MqttServer>` | `rxListen()` Start the server listening for incoming connections using the specified options through the constructor
    `Single<MqttServer>` | `rxListen(int port)` Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.
    `Single<MqttServer>` | `rxListen(int port, String host)` Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<MqttServer> __TYPE_ARG

  - ### Constructor Detail

    - #### MqttServer

          public MqttServer(MqttServer delegate)

    - #### MqttServer

          public MqttServer(Object delegate)

  - ### Method Detail

    - #### 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`

    - #### getDelegate

          public MqttServer getDelegate()

    - #### create

          public static MqttServer create(Vertx vertx,
                                          MqttServerOptions options)

      Return an MQTT server instance
      Parameters:
        `vertx` - Vert.x instance
        `options` - MQTT server options
      Returns:
        MQTT server instance

    - #### create

          public static MqttServer create(Vertx vertx)

      Return an MQTT server instance using default options
      Parameters:
        `vertx` - Vert.x instance
      Returns:
        MQTT server instance

    - #### listen

          public Single<MqttServer> listen(int port,
                                           String host)

      Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxListen

          public Single<MqttServer> rxListen(int port,
                                             String host)

      Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor
      Parameters:
        `port` - the port to listen on
        `host` - the host to listen on
      Returns:
        a reference to this, so the API can be used fluently

    - #### listen

          public Single<MqttServer> listen(int port)

      Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host. It ignores any options specified through the constructor
      Parameters:
        `port` - the port to listen on
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxListen

          public Single<MqttServer> rxListen(int port)

      Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host. It ignores any options specified through the constructor
      Parameters:
        `port` - the port to listen on
      Returns:
        a reference to this, so the API can be used fluently

    - #### listen

          public Single<MqttServer> listen()

      Start the server listening for incoming connections using the specified options through the constructor
      Returns:
        a reference to this, so the API can be used fluently

    - #### rxListen

          public Single<MqttServer> rxListen()

      Start the server listening for incoming connections using the specified options through the constructor
      Returns:
        a reference to this, so the API can be used fluently

    - #### endpointHandler

          public MqttServer endpointHandler(Handler<MqttEndpoint> handler)

      Set the endpoint handler for the server. If an MQTT client connect to the server a new MqttEndpoint instance will be created and passed to the handler
      Parameters:
        `handler` - the endpoint handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### exceptionHandler

          public MqttServer exceptionHandler(Handler<Throwable> handler)

      Set an exception handler for the server, that will be called when an error happens independantly of an accepted `MqttEndpoint`, like a rejected connection
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### actualPort

          public int actualPort()

      The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port
      Returns:
        the actual port the server is listening on.

    - #### close

          public Completable close()

      Close the server supplying an handler that will be called when the server is actually closed (or has failed).
      Returns:

    - #### rxClose

          public Completable rxClose()

      Close the server supplying an handler that will be called when the server is actually closed (or has failed).
      Returns:

    - #### newInstance

          public static MqttServer newInstance(MqttServer arg)

Copyright © 2023 Eclipse. All rights reserved.