Class MqttServer

    • Constructor Summary

      Constructors 
      Constructor Description
      MqttServer​(io.vertx.mqtt.MqttServer delegate)  
      MqttServer​(Object delegate)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int actualPort()
      The actual port the server is listening on.
      void close()
      Close the server supplying an handler that will be called when the server is actually closed (or has failed).
      void close​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
      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, io.vertx.mqtt.MqttServerOptions options)
      Return an MQTT server instance
      MqttServer endpointHandler​(io.vertx.core.Handler<MqttEndpoint> handler)
      Set the endpoint handler for the server.
      boolean equals​(Object o)  
      MqttServer exceptionHandler​(io.vertx.core.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
      io.vertx.mqtt.MqttServer getDelegate()  
      int hashCode()  
      MqttServer listen()
      Start the server listening for incoming connections using the specified options through the constructor
      MqttServer listen​(int port)
      Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.
      MqttServer listen​(int port, io.vertx.core.Handler<io.vertx.core.AsyncResult<MqttServer>> listenHandler)
      Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.
      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
      MqttServer listen​(int port, String host, io.vertx.core.Handler<io.vertx.core.AsyncResult<MqttServer>> listenHandler)
      Start the server listening for incoming connections on the port and host specified It ignores any options specified through the constructor
      MqttServer listen​(io.vertx.core.Handler<io.vertx.core.AsyncResult<MqttServer>> listenHandler)
      Start the server listening for incoming connections using the specified options through the constructor
      static MqttServer newInstance​(io.vertx.mqtt.MqttServer arg)  
      rx.Single<Void> rxClose()
      Close the server supplying an handler that will be called when the server is actually closed (or has failed).
      rx.Single<MqttServer> rxListen()
      Start the server listening for incoming connections using the specified options through the constructor
      rx.Single<MqttServer> rxListen​(int port)
      Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.
      rx.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()  
    • Constructor Detail

      • MqttServer

        public MqttServer​(io.vertx.mqtt.MqttServer delegate)
      • MqttServer

        public MqttServer​(Object delegate)
    • Method Detail

      • hashCode

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

        public io.vertx.mqtt.MqttServer getDelegate()
      • create

        public static MqttServer create​(Vertx vertx,
                                        io.vertx.mqtt.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 MqttServer listen​(int port,
                                 String host,
                                 io.vertx.core.Handler<io.vertx.core.AsyncResult<MqttServer>> listenHandler)
        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
        listenHandler - handler called when the asynchronous listen call ends
        Returns:
        a reference to this, so the API can be used fluently
      • listen

        public 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 rx.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 MqttServer listen​(int port,
                                 io.vertx.core.Handler<io.vertx.core.AsyncResult<MqttServer>> listenHandler)
        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
        listenHandler - handler called when the asynchronous listen call ends
        Returns:
        a reference to this, so the API can be used fluently
      • listen

        public 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 rx.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 MqttServer listen​(io.vertx.core.Handler<io.vertx.core.AsyncResult<MqttServer>> listenHandler)
        Start the server listening for incoming connections using the specified options through the constructor
        Parameters:
        listenHandler - handler called when the asynchronous listen call ends
        Returns:
        a reference to this, so the API can be used fluently
      • listen

        public 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 rx.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​(io.vertx.core.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​(io.vertx.core.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 void close​(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> completionHandler)
        Close the server supplying an handler that will be called when the server is actually closed (or has failed).
        Parameters:
        completionHandler - the handler called on completion
      • close

        public void close()
        Close the server supplying an handler that will be called when the server is actually closed (or has failed).
      • rxClose

        public rx.Single<Void> 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​(io.vertx.mqtt.MqttServer arg)