Class NetServer
- All Implemented Interfaces:
MutinyDelegate,Measured
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox
- See Also:
-
NetServer
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.metrics.Measured
Measured.MeasuredImpl -
Field Summary
Fields -
Constructor Summary
Constructors -
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.connectHandler(Consumer<NetSocket> handler) Supply a connect handler for this server.booleanio.vertx.core.net.NetServerGet the delegate instance.inthashCode()booleanWhether the metrics are enabled for this measured objectio.smallrye.mutiny.Uni<NetServer>listen()Start listening on the port and host as configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.io.smallrye.mutiny.Uni<NetServer>listen(int port) Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.io.smallrye.mutiny.Uni<NetServer>Start listening on the specified port and host, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.io.smallrye.mutiny.Uni<NetServer>listen(io.vertx.core.net.SocketAddress localAddress) Start listening on the specified local address, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Start listening on the port and host as configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.listenAndAwait(int port) Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.listenAndAwait(int port, String host) Start listening on the specified port and host, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.listenAndAwait(io.vertx.core.net.SocketAddress localAddress) Start listening on the specified local address, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Start listening on the port and host as configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.listenAndForget(int port) Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.listenAndForget(int port, String host) Start listening on the specified port and host, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.listenAndForget(io.vertx.core.net.SocketAddress localAddress) Start listening on the specified local address, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.static NetServernewInstance(io.vertx.core.net.NetServer delegate) Creates a new instance of theNetServer.io.smallrye.mutiny.Uni<Void>shutdown()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).io.smallrye.mutiny.Uni<Void>Callsshutdown(Duration).io.smallrye.mutiny.Uni<Void>Initiate the server shutdown sequence.voidShutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).voidshutdownAndAwait(long timeout, TimeUnit unit) Callsshutdown(Duration).voidshutdownAndAwait(Duration timeout) Initiate the server shutdown sequence.Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).shutdownAndForget(long timeout, TimeUnit unit) Callsshutdown(Duration).shutdownAndForget(Duration timeout) Initiate the server shutdown sequence.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.io.smallrye.mutiny.Uni<Boolean>updateTrafficShapingOptions(io.vertx.core.net.TrafficShapingOptions options) Update the server with new trafficoptions, the update happens if the options object is valid and different from the existing options object.updateTrafficShapingOptionsAndAwait(io.vertx.core.net.TrafficShapingOptions options) Update the server with new trafficoptions, the update happens if the options object is valid and different from the existing options object.updateTrafficShapingOptionsAndForget(io.vertx.core.net.TrafficShapingOptions options) Update the server with new trafficoptions, the update happens if the options object is valid and different from the existing options object.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
NetServer
public NetServer(io.vertx.core.net.NetServer delegate) Create a new instance ofNetServerdelegating to the given (non-null) instance ofNetServer. -
NetServer
-
-
Method Details
-
getDelegate
public io.vertx.core.net.NetServer 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 interfaceMeasured- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
listen
Start listening on the port and host as configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.The server may not be listening until some time after the call to listen 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:
-
NetServer.listen()
-
listenAndAwait
Start listening on the port and host as configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method returns a
NetServer. 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:
-
NetServer.listen()
-
listenAndForget
Start listening on the port and host as configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method ignores the
NetServerresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.listen()
-
listen
Start listening on the specified port and host, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Port
0can be specified meaning "choose an random port".Host
0.0.0.0can be specified meaning "listen on all available interfaces".The server may not be listening until some time after the call to listen 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:
-
NetServer.listen(int, String)
-
listenAndAwait
Start listening on the specified port and host, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Port
0can be specified meaning "choose an random port".Host
0.0.0.0can be specified meaning "listen on all available interfaces".The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method returns a
NetServer. 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:
-
NetServer.listen(int, String)
-
listenAndForget
Start listening on the specified port and host, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Port
0can be specified meaning "choose an random port".Host
0.0.0.0can be specified meaning "listen on all available interfaces".The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method ignores the
NetServerresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.listen(int, String)
-
listen
Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Port
0can be specified meaning "choose an random port".The server may not be listening until some time after the call to listen 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:
-
NetServer.listen(int)
-
listenAndAwait
Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Port
0can be specified meaning "choose an random port".The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method returns a
NetServer. 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:
-
NetServer.listen(int)
-
listenAndForget
Start listening on the specified port and host "0.0.0.0", ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.Port
0can be specified meaning "choose an random port".The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method ignores the
NetServerresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.listen(int)
-
listen
@CheckReturnValue public io.smallrye.mutiny.Uni<NetServer> listen(io.vertx.core.net.SocketAddress localAddress) Start listening on the specified local address, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.The server may not be listening until some time after the call to listen 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.
- Parameters:
localAddress- the local address to listen on- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetServer.listen(SocketAddress)
-
listenAndAwait
Start listening on the specified local address, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method returns a
NetServer. 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:
localAddress- the local address to listen on- Returns:
- The operation result
- See Also:
-
NetServer.listen(SocketAddress)
-
listenAndForget
Start listening on the specified local address, ignoring port and host configured in theio.vertx.mutiny.core.net.NetServerOptionsused when creating the server.The server may not be listening until some time after the call to listen has returned.
Unlike the bare Vert.x variant, this method ignores the
NetServerresult or any failure.- Parameters:
localAddress- the local address to listen on- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.listen(SocketAddress)
-
close
Close the server. This will close any currently open connections. The close may not complete until after this method 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:
-
NetServer.close()
-
closeAndAwait
public void closeAndAwait()Close the server. This will close any currently open connections. The close may not complete until after this method 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:
-
NetServer.close()
-
closeAndForget
Close the server. This will close any currently open connections. The close may not complete until after this method 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:
-
NetServer.close()
-
shutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).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:
-
NetServer.shutdown()
-
shutdownAndAwait
public void shutdownAndAwait()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).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:
-
NetServer.shutdown()
-
shutdownAndForget
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).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:
-
NetServer.shutdown()
-
shutdown
Callsshutdown(Duration).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:
-
NetServer.shutdown(long, TimeUnit)
-
shutdownAndAwait
Callsshutdown(Duration).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:
-
NetServer.shutdown(long, TimeUnit)
-
shutdownAndForget
Callsshutdown(Duration).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:
-
NetServer.shutdown(long, TimeUnit)
-
shutdown
Initiate the server shutdown sequence.Connections are taken out of service and notified the close sequence has started through
NetSocket#shutdownHandler(Handler). When all connections are closed the client is closed. When thetimeoutexpires, all unclosed connections are immediately closed.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:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetServer.shutdown(Duration)
-
shutdownAndAwait
Initiate the server shutdown sequence.Connections are taken out of service and notified the close sequence has started through
NetSocket#shutdownHandler(Handler). When all connections are closed the client is closed. When thetimeoutexpires, all unclosed connections are immediately closed.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).- Parameters:
timeout- the amount of time after which all resources are forcibly closed- See Also:
-
NetServer.shutdown(Duration)
-
shutdownAndForget
Initiate the server shutdown sequence.Connections are taken out of service and notified the close sequence has started through
NetSocket#shutdownHandler(Handler). When all connections are closed the client is closed. When thetimeoutexpires, all unclosed connections are immediately closed.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.shutdown(Duration)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ServerSSLOptions options) Update the server with new SSL
options, the update happens if the options object is valid and different from the existing options object.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:
-
NetServer.updateSSLOptions(ServerSSLOptions)
-
updateSSLOptionsAndAwait
Update the server with new SSL
options, the update happens if the options object is valid and different from the existing options object.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:
-
NetServer.updateSSLOptions(ServerSSLOptions)
-
updateSSLOptionsAndForget
Update the server with new SSL
options, the update happens if the options object is valid and different from the existing options object.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:
-
NetServer.updateSSLOptions(ServerSSLOptions)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSL
options, 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 equals since loading options can be costly, this can happen for share TCP servers. When object are equals, 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 equals- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetServer.updateSSLOptions(ServerSSLOptions, boolean)
-
updateSSLOptionsAndAwait
Update the server with new SSL
options, 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 equals since loading options can be costly, this can happen for share TCP servers. When object are equals, 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 equals- Returns:
- The operation result
- See Also:
-
NetServer.updateSSLOptions(ServerSSLOptions, boolean)
-
updateSSLOptionsAndForget
public NetServer updateSSLOptionsAndForget(io.vertx.core.net.ServerSSLOptions options, boolean force) Update the server with new SSL
options, 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 equals since loading options can be costly, this can happen for share TCP servers. When object are equals, 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 equals- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.updateSSLOptions(ServerSSLOptions, boolean)
-
updateTrafficShapingOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateTrafficShapingOptions(io.vertx.core.net.TrafficShapingOptions options) Update the server with new traffic
options, 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 equals since loading options can be costly, this can happen for share TCP servers. When object are equals, 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 traffic shaping options- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetServer.updateTrafficShapingOptions(TrafficShapingOptions)
-
updateTrafficShapingOptionsAndAwait
Update the server with new traffic
options, 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 equals since loading options can be costly, this can happen for share TCP servers. When object are equals, 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 traffic shaping options- Returns:
- The operation result
- See Also:
-
NetServer.updateTrafficShapingOptions(TrafficShapingOptions)
-
updateTrafficShapingOptionsAndForget
public NetServer updateTrafficShapingOptionsAndForget(io.vertx.core.net.TrafficShapingOptions options) Update the server with new traffic
options, 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 equals since loading options can be costly, this can happen for share TCP servers. When object are equals, 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 traffic shaping options- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetServer.updateTrafficShapingOptions(TrafficShapingOptions)
-
connectHandler
Supply a connect handler for this server. The server can only have at most one connect handler at any one time. As the server accepts TCP or SSL connections it creates an instance ofNetSocketand passes it to the connect 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.
-
isMetricsEnabled
public boolean isMetricsEnabled()Whether the metrics are enabled for this measured object- Specified by:
isMetricsEnabledin interfaceMeasured- Returns:
trueif metrics are enabled
-
newInstance
Creates a new instance of theNetServer. -
hashCode
public int hashCode() -
equals
-
toString
-