Class NetClient
- All Implemented Interfaces:
MutinyDelegate,Measured
Multiple connections to different servers can be made using the same instance.
This client supports a configurable number of connection attempts and a configurable delay between attempts.
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox
- See Also:
-
NetClient
-
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 TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>close()Close immediately (shutdown(0, TimeUnit.SECONDS).voidClose immediately (shutdown(0, TimeUnit.SECONDS).Close immediately (shutdown(0, TimeUnit.SECONDS).io.smallrye.mutiny.Uni<NetSocket>Open a connection to a server at the specificportandhost.io.smallrye.mutiny.Uni<NetSocket>Open a connection to a server at the specificportandhost.io.smallrye.mutiny.Uni<NetSocket>connect(io.vertx.core.net.ConnectOptions connectOptions) Open a connection to a server at the specificconnectOptions.io.smallrye.mutiny.Uni<NetSocket>connect(io.vertx.core.net.SocketAddress remoteAddress) Open a connection to a server at the specificremoteAddress.io.smallrye.mutiny.Uni<NetSocket>Open a connection to a server at the specificremoteAddress.connectAndAwait(int port, String host) Open a connection to a server at the specificportandhost.connectAndAwait(int port, String host, String serverName) Open a connection to a server at the specificportandhost.connectAndAwait(io.vertx.core.net.ConnectOptions connectOptions) Open a connection to a server at the specificconnectOptions.connectAndAwait(io.vertx.core.net.SocketAddress remoteAddress) Open a connection to a server at the specificremoteAddress.connectAndAwait(io.vertx.core.net.SocketAddress remoteAddress, String serverName) Open a connection to a server at the specificremoteAddress.connectAndForget(int port, String host) Open a connection to a server at the specificportandhost.connectAndForget(int port, String host, String serverName) Open a connection to a server at the specificportandhost.connectAndForget(io.vertx.core.net.ConnectOptions connectOptions) Open a connection to a server at the specificconnectOptions.connectAndForget(io.vertx.core.net.SocketAddress remoteAddress) Open a connection to a server at the specificremoteAddress.connectAndForget(io.vertx.core.net.SocketAddress remoteAddress, String serverName) Open a connection to a server at the specificremoteAddress.booleanio.vertx.core.net.NetClientGet the delegate instance.inthashCode()booleanWhether the metrics are enabled for this measured objectstatic NetClientnewInstance(io.vertx.core.net.NetClient delegate) Creates a new instance of theNetClient.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 client shutdown sequence.voidShutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).voidshutdownAndAwait(long timeout, TimeUnit unit) Callsshutdown(Duration).voidshutdownAndAwait(Duration timeout) Initiate the client shutdown sequence.Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).shutdownAndForget(long timeout, TimeUnit unit) Callsshutdown(Duration).shutdownAndForget(Duration timeout) Initiate the client shutdown sequence.toString()io.smallrye.mutiny.Uni<Boolean>updateSSLOptions(io.vertx.core.net.ClientSSLOptions options) Update the client 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.ClientSSLOptions options, boolean force) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions options, boolean force) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options) Update the client with new SSLoptions, the update happens if the options object is valid and different from the existing options object.updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options, boolean force) Update the client 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
-
NetClient
public NetClient(io.vertx.core.net.NetClient delegate) Create a new instance ofNetClientdelegating to the given (non-null) instance ofNetClient. -
NetClient
-
-
Method Details
-
getDelegate
public io.vertx.core.net.NetClient 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
-
connect
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.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:
port- the porthost- the host- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetClient.connect(int, String)
-
connectAndAwait
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.Unlike the bare Vert.x variant, this method returns a
NetSocket. 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 porthost- the host- Returns:
- The operation result
- See Also:
-
NetClient.connect(int, String)
-
connectAndForget
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.Unlike the bare Vert.x variant, this method ignores the
NetSocketresult or any failure.- Parameters:
port- the porthost- the host- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetClient.connect(int, String)
-
connect
@CheckReturnValue public io.smallrye.mutiny.Uni<NetSocket> connect(int port, String host, String serverName) Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.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:
port- the porthost- the hostserverName- the SNI server name- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetClient.connect(int, String, String)
-
connectAndAwait
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.Unlike the bare Vert.x variant, this method returns a
NetSocket. 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 porthost- the hostserverName- the SNI server name- Returns:
- The operation result
- See Also:
-
NetClient.connect(int, String, String)
-
connectAndForget
Open a connection to a server at the specificportandhost.hostcan be a valid host name or IP address.Unlike the bare Vert.x variant, this method ignores the
NetSocketresult or any failure.- Parameters:
port- the porthost- the hostserverName- the SNI server name- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetClient.connect(int, String, String)
-
connect
@CheckReturnValue public io.smallrye.mutiny.Uni<NetSocket> connect(io.vertx.core.net.SocketAddress remoteAddress) Open a connection to a server at the specificremoteAddress.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:
remoteAddress- the remote address- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetClient.connect(SocketAddress)
-
connectAndAwait
Open a connection to a server at the specificremoteAddress.Unlike the bare Vert.x variant, this method returns a
NetSocket. 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:
remoteAddress- the remote address- Returns:
- The operation result
- See Also:
-
NetClient.connect(SocketAddress)
-
connectAndForget
Open a connection to a server at the specificremoteAddress.Unlike the bare Vert.x variant, this method ignores the
NetSocketresult or any failure.- Parameters:
remoteAddress- the remote address- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetClient.connect(SocketAddress)
-
connect
@CheckReturnValue public io.smallrye.mutiny.Uni<NetSocket> connect(io.vertx.core.net.SocketAddress remoteAddress, String serverName) Open a connection to a server at the specificremoteAddress.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:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetClient.connect(SocketAddress, String)
-
connectAndAwait
Open a connection to a server at the specificremoteAddress.Unlike the bare Vert.x variant, this method returns a
NetSocket. 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:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- The operation result
- See Also:
-
NetClient.connect(SocketAddress, String)
-
connectAndForget
Open a connection to a server at the specificremoteAddress.Unlike the bare Vert.x variant, this method ignores the
NetSocketresult or any failure.- Parameters:
remoteAddress- the remote addressserverName- the SNI server name- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetClient.connect(SocketAddress, String)
-
connect
@CheckReturnValue public io.smallrye.mutiny.Uni<NetSocket> connect(io.vertx.core.net.ConnectOptions connectOptions) Open a connection to a server at the specificconnectOptions.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:
connectOptions- the options describing how to connect to the remote server- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
NetClient.connect(ConnectOptions)
-
connectAndAwait
Open a connection to a server at the specificconnectOptions.Unlike the bare Vert.x variant, this method returns a
NetSocket. 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:
connectOptions- the options describing how to connect to the remote server- Returns:
- The operation result
- See Also:
-
NetClient.connect(ConnectOptions)
-
connectAndForget
Open a connection to a server at the specificconnectOptions.Unlike the bare Vert.x variant, this method ignores the
NetSocketresult or any failure.- Parameters:
connectOptions- the options describing how to connect to the remote server- Returns:
- The current instance to chain operations if needed.
- See Also:
-
NetClient.connect(ConnectOptions)
-
close
Close immediately (shutdown(0, 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:
-
NetClient.close()
-
closeAndAwait
public void closeAndAwait()Close immediately (shutdown(0, 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:
-
NetClient.close()
-
closeAndForget
Close immediately (shutdown(0, 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:
-
NetClient.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:
-
NetClient.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:
-
NetClient.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:
-
NetClient.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:
-
NetClient.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:
-
NetClient.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:
-
NetClient.shutdown(long, TimeUnit)
-
shutdown
Initiate the client 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:
-
NetClient.shutdown(Duration)
-
shutdownAndAwait
Initiate the client 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:
-
NetClient.shutdown(Duration)
-
shutdownAndForget
Initiate the client 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:
-
NetClient.shutdown(Duration)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions options) Update the client 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:
-
NetClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptionsAndAwait
Update the client 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:
-
NetClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptionsAndForget
Update the client 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:
-
NetClient.updateSSLOptions(ClientSSLOptions)
-
updateSSLOptions
@CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions options, boolean force) Update the client 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:
-
NetClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptionsAndAwait
Update the client 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:
-
NetClient.updateSSLOptions(ClientSSLOptions, boolean)
-
updateSSLOptionsAndForget
public NetClient updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions options, boolean force) Update the client 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:
-
NetClient.updateSSLOptions(ClientSSLOptions, boolean)
-
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 theNetClient. -
hashCode
public int hashCode() -
equals
-
toString
-