Package io.vertx.rxjava3.mqtt
Class MqttServer
- java.lang.Object
-
- io.vertx.rxjava3.mqtt.MqttServer
-
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
public class MqttServer extends Object implements io.vertx.lang.rx.RxDelegate
An MQTT serverYou 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 ofMqttEndpointin order to manage the communication with the remote MQTT client.NOTE: This class has been automatically generated from the
originalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<MqttServer>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description MqttServerโ(MqttServer delegate)MqttServerโ(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intactualPort()The actual port the server is listening on.Completableclose()Close the server.static MqttServercreateโ(Vertx vertx)Return an MQTT server instance using default optionsstatic MqttServercreateโ(Vertx vertx, MqttServerOptions options)Return an MQTT server instanceMqttServerendpointHandlerโ(Handler<MqttEndpoint> handler)Set the endpoint handler for the server.booleanequalsโ(Object o)MqttServerexceptionHandlerโ(Handler<Throwable> handler)Set an exception handler for the server, that will be called when an error happens independantly of an acceptedMqttEndpoint, like a rejected connectionMqttServergetDelegate()inthashCode()Single<MqttServer>listen()Start the server listening for incoming connections using the specified options through the constructorSingle<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 specifiedstatic MqttServernewInstanceโ(MqttServer arg)CompletablerxClose()Close the server.Single<MqttServer>rxListen()Start the server listening for incoming connections using the specified options through the constructorSingle<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 specifiedStringtoString()
-
-
-
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
-
getDelegate
public MqttServer getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
create
public static MqttServer createโ(Vertx vertx, MqttServerOptions options)
Return an MQTT server instance- Parameters:
vertx- Vert.x instanceoptions- 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()
Start the server listening for incoming connections using the specified options through the constructor- Returns:
- a
Futurecompleted with this server instance
-
rxListen
public Single<MqttServer> rxListen()
Start the server listening for incoming connections using the specified options through the constructor- Returns:
- a
Futurecompleted with this server instance
-
listen
public Single<MqttServer> listenโ(int port, String host)
Start the server listening for incoming connections on the port and host specified- Parameters:
port- the port to listen onhost- the host to listen on- Returns:
- a
Futurecompleted with this server instance
-
rxListen
public Single<MqttServer> rxListenโ(int port, String host)
Start the server listening for incoming connections on the port and host specified- Parameters:
port- the port to listen onhost- the host to listen on- Returns:
- a
Futurecompleted with this server instance
-
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
Futurecompleted with this server instance
-
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
Futurecompleted with this server instance
-
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 acceptedMqttEndpoint, 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.The close happens asynchronously and the server may not be closed until some time after the call has returned.
- Returns:
- a
Futurecompleted with this server is closed
-
rxClose
public Completable rxClose()
Close the server.The close happens asynchronously and the server may not be closed until some time after the call has returned.
- Returns:
- a
Futurecompleted with this server is closed
-
newInstance
public static MqttServer newInstanceโ(MqttServer arg)
-
-