Class MqttServer
- All Implemented Interfaces:
MutinyDelegate
You can accept incoming MQTT connection requests providing a MqttServer#endpointHandler(Handler). 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 Mutiny-ified interface.
- See Also:
-
MqttServer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMqttServer(io.vertx.mqtt.MqttServer delegate) Create a new instance ofMqttServerdelegating to the given (non-null) instance ofMqttServer.MqttServer(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionintThe actual port the server is listening on.io.smallrye.mutiny.Uni<Void>close()Close the server.voidClose the server.Close the server.static MqttServerReturn an MQTT server instance using default optionsstatic MqttServerReturn an MQTT server instanceendpointHandler(Consumer<MqttEndpoint> handler) Set the endpoint handler for the server.booleanexceptionHandler(Consumer<Throwable> handler) Set an exception handler for the server, that will be called when an error happens independantly of an acceptedMqttEndpoint, like a rejected connectionio.vertx.mqtt.MqttServerGet the delegate instance.inthashCode()io.smallrye.mutiny.Uni<MqttServer>listen()Start the server listening for incoming connections using the specified options through the constructorio.smallrye.mutiny.Uni<MqttServer>listen(int port) Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.io.smallrye.mutiny.Uni<MqttServer>Start the server listening for incoming connections on the port and host specifiedStart the server listening for incoming connections using the specified options through the constructorlistenAndAwait(int port) Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.listenAndAwait(int port, String host) Start the server listening for incoming connections on the port and host specifiedStart the server listening for incoming connections using the specified options through the constructorlistenAndForget(int port) Start the server listening for incoming connections on the port specified but on "0.0.0.0" as host.listenAndForget(int port, String host) Start the server listening for incoming connections on the port and host specifiedstatic MqttServernewInstance(io.vertx.mqtt.MqttServer delegate) Creates a new instance of theMqttServer.toString()io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.ServerSSLOptions options) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.ServerSSLOptions options) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.ServerSSLOptions options) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
MqttServer
public MqttServer(io.vertx.mqtt.MqttServer delegate) Create a new instance ofMqttServerdelegating to the given (non-null) instance ofMqttServer. -
MqttServer
-
-
Method Details
-
getDelegate
public io.vertx.mqtt.MqttServer 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:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
listen
Start the server listening for incoming connections using the specified options through the constructorUnlike 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
Unirepresenting the asynchronous result of this operation. - See Also:
-
MqttServer.listen()
-
listenAndAwait
Start the server listening for incoming connections using the specified options through the constructorUnlike the bare Vert.x variant, this method returns a
MqttServer. 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
MqttServer.listen()
-
listenAndForget
Start the server listening for incoming connections using the specified options through the constructorUnlike the bare Vert.x variant, this method ignores the
MqttServerresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MqttServer.listen()
-
listen
Start the server listening for incoming connections on the port and host specifiedUnlike 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:
port- the port to listen onhost- the host to listen on- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MqttServer.listen(int, String)
-
listenAndAwait
Start the server listening for incoming connections on the port and host specifiedUnlike the bare Vert.x variant, this method returns a
MqttServer. 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 aRuntimeException).- Parameters:
port- the port to listen onhost- the host to listen on- Returns:
- The operation result
- See Also:
-
MqttServer.listen(int, String)
-
listenAndForget
Start the server listening for incoming connections on the port and host specifiedUnlike the bare Vert.x variant, this method ignores the
MqttServerresult or any failure.- Parameters:
port- the port to listen onhost- the host to listen on- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MqttServer.listen(int, String)
-
listen
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 constructorUnlike 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:
port- the port to listen on- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MqttServer.listen(int)
-
listenAndAwait
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 constructorUnlike the bare Vert.x variant, this method returns a
MqttServer. 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 aRuntimeException).- Parameters:
port- the port to listen on- Returns:
- The operation result
- See Also:
-
MqttServer.listen(int)
-
listenAndForget
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 constructorUnlike the bare Vert.x variant, this method ignores the
MqttServerresult or any failure.- Parameters:
port- the port to listen on- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MqttServer.listen(int)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ServerSSLOptions options) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.This is equivalent to calling
updateSSLOptions(ServerSSLOptions, boolean)withforceset tofalse.The boolean succeeded uni result indicates whether the update occurred.
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:
options- the new SSL options- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MqttServer.updateSSLOptions(ServerSSLOptions)
-
updateSSLOptionsAndAwait
Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.This is equivalent to calling
updateSSLOptions(ServerSSLOptions, boolean)withforceset tofalse.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Boolean. 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 aRuntimeException).- Parameters:
options- the new SSL options- Returns:
- The operation result
- See Also:
-
MqttServer.updateSSLOptions(ServerSSLOptions)
-
updateSSLOptionsAndForget
Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.This is equivalent to calling
updateSSLOptions(ServerSSLOptions, boolean)withforceset tofalse.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Parameters:
options- the new SSL options- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MqttServer.updateSSLOptions(ServerSSLOptions)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equal since loading options can be costly. When options are equal, settingforcetotrueforces the update.The boolean succeeded uni result indicates whether the update occurred.
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:
options- the new SSL optionsforce- force the update when options are equal- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MqttServer.updateSSLOptions(ServerSSLOptions, boolean)
-
updateSSLOptionsAndAwait
Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equal since loading options can be costly. When options are equal, settingforcetotrueforces the update.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method returns a
Boolean. 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 aRuntimeException).- Parameters:
options- the new SSL optionsforce- force the update when options are equal- Returns:
- The operation result
- See Also:
-
MqttServer.updateSSLOptions(ServerSSLOptions, boolean)
-
updateSSLOptionsAndForget
public MqttServer updateSSLOptionsAndForget(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSLoptions, the update happens if the options object is valid and different from the existing options object.The
optionsobject is compared using itsequalsmethod against the existing options to prevent an update when the objects are equal since loading options can be costly. When options are equal, settingforcetotrueforces the update.The boolean succeeded underlying uni result indicates whether the update occurred.
Unlike the bare Vert.x variant, this method ignores the
Booleanresult or any failure.- Parameters:
options- the new SSL optionsforce- force the update when options are equal- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MqttServer.updateSSLOptions(ServerSSLOptions, boolean)
-
close
Close the server.The close happens asynchronously and the server may not be closed until some time after the call has returned.
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
Unirepresenting the asynchronous result of this operation. - See Also:
-
MqttServer.close()
-
closeAndAwait
public void closeAndAwait()Close the server.The close happens asynchronously and the server may not be closed until some time after the call has returned.
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 aRuntimeException).- See Also:
-
MqttServer.close()
-
closeAndForget
Close the server.The close happens asynchronously and the server may not be closed until some time after the call has returned.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MqttServer.close()
-
create
Return an MQTT server instance- Parameters:
vertx- Vert.x instanceoptions- MQTT server options- Returns:
- MQTT server instance
-
create
Return an MQTT server instance using default options- Parameters:
vertx- Vert.x instance- Returns:
- MQTT server instance
-
endpointHandler
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
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.
-
newInstance
Creates a new instance of theMqttServer. -
hashCode
public int hashCode() -
equals
-
toString
-