Class MailClient
- All Implemented Interfaces:
MutinyDelegate
A simple asynchronous API for sending mails from Vert.x applications
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Alexander Lehmann
- See Also:
-
MailClient
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<MailClient>static final StringThe name of the default pool -
Constructor Summary
ConstructorsConstructorDescriptionMailClient(io.vertx.ext.mail.MailClient delegate) Create a new instance ofMailClientdelegating to the given (non-null) instance ofMailClient.MailClient(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionstatic MailClientBuilderProvide a builder forMailClient.io.smallrye.mutiny.Uni<Void>close()Close the MailClientvoidClose the MailClientClose the MailClientstatic MailClientCreate a non shared instance of the mail client.static MailClientcreateShared(Vertx vertx, io.vertx.ext.mail.MailConfig config) LikecreateShared(io.vertx.mutiny.core.Vertx, MailConfig, String)but with the default pool namestatic MailClientcreateShared(Vertx vertx, io.vertx.ext.mail.MailConfig config, String poolName) Create a Mail client which shares its connection pool with any other Mail clients created with the same pool namebooleanio.vertx.ext.mail.MailClientGet the delegate instance.inthashCode()static MailClientnewInstance(io.vertx.ext.mail.MailClient delegate) Creates a new instance of theMailClient.io.smallrye.mutiny.Uni<io.vertx.ext.mail.MailResult>sendMail(io.vertx.ext.mail.MailMessage email) send a single mail via MailClientio.vertx.ext.mail.MailResultsendMailAndAwait(io.vertx.ext.mail.MailMessage email) send a single mail via MailClientsendMailAndForget(io.vertx.ext.mail.MailMessage email) send a single mail via MailClienttoString()
-
Field Details
-
DEFAULT_POOL_NAME
The name of the default pool- See Also:
-
__TYPE_ARG
-
-
Constructor Details
-
MailClient
public MailClient(io.vertx.ext.mail.MailClient delegate) Create a new instance ofMailClientdelegating to the given (non-null) instance ofMailClient. -
MailClient
-
-
Method Details
-
getDelegate
public io.vertx.ext.mail.MailClient 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
-
sendMail
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.mail.MailResult> sendMail(io.vertx.ext.mail.MailMessage email) send a single mail via MailClientUnlike 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:
email- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
MailClient.sendMail(MailMessage)
-
sendMailAndAwait
public io.vertx.ext.mail.MailResult sendMailAndAwait(io.vertx.ext.mail.MailMessage email) send a single mail via MailClientUnlike the bare Vert.x variant, this method returns a
MailResult. 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:
email- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- The operation result
- See Also:
-
MailClient.sendMail(MailMessage)
-
sendMailAndForget
send a single mail via MailClientUnlike the bare Vert.x variant, this method ignores the
MailResultresult or any failure.- Parameters:
email- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MailClient.sendMail(MailMessage)
-
close
Close the MailClientUnlike 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:
-
MailClient.close()
-
closeAndAwait
public void closeAndAwait()Close the MailClientUnlike 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:
-
MailClient.close()
-
closeAndForget
Close the MailClientUnlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
MailClient.close()
-
builder
Provide a builder forMailClient.It can be used to configure advanced settings like changing credentials with
MailClientBuilder.withCredentialsSupplier(Supplier). -
create
Create a non shared instance of the mail client.- Parameters:
vertx- the Vertx instance the operation will be run inconfig- MailConfig configuration to be used for sending mails- Returns:
- MailClient instance that can then be used to send multiple mails
-
newInstance
Creates a new instance of theMailClient. -
hashCode
public int hashCode() -
equals
-
toString
-