Package io.vertx.reactivex.ext.mail
Class MailClient
- java.lang.Object
-
- io.vertx.reactivex.ext.mail.MailClient
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<MailClient>__TYPE_ARGstatic StringDEFAULT_POOL_NAMEThe name of the default pool
-
Constructor Summary
Constructors Constructor Description MailClient(MailClient delegate)MailClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the MailClientvoidclose(Handler<AsyncResult<Void>> closedHandler)Close the MailClientstatic MailClientcreate(Vertx vertx, MailConfig config)Create a non shared instance of the mail client.static MailClientcreateShared(Vertx vertx, MailConfig config)LikecreateShared(io.vertx.reactivex.core.Vertx, io.vertx.ext.mail.MailConfig, java.lang.String)but with the default pool namestatic MailClientcreateShared(Vertx vertx, MailConfig config, String poolName)Create a Mail client which shares its connection pool with any other Mail clients created with the same pool namebooleanequals(Object o)MailClientgetDelegate()inthashCode()static MailClientnewInstance(MailClient arg)io.reactivex.CompletablerxClose()Close the MailClientio.reactivex.Single<MailResult>rxSendMail(MailMessage email)send a single mail via MailClientMailClientsendMail(MailMessage email)send a single mail via MailClientMailClientsendMail(MailMessage email, Handler<AsyncResult<MailResult>> resultHandler)send a single mail via MailClientStringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<MailClient> __TYPE_ARG
-
DEFAULT_POOL_NAME
public static final String DEFAULT_POOL_NAME
The name of the default pool- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MailClient
public MailClient(MailClient delegate)
-
MailClient
public MailClient(Object delegate)
-
-
Method Detail
-
getDelegate
public MailClient getDelegate()
-
create
public static MailClient create(Vertx vertx, MailConfig config)
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
-
createShared
public static MailClient createShared(Vertx vertx, MailConfig config, String poolName)
Create a Mail client which shares its connection pool with any other Mail clients created with the same pool name- Parameters:
vertx- the Vert.x instanceconfig- the configurationpoolName- the pool name- Returns:
- the client
-
createShared
public static MailClient createShared(Vertx vertx, MailConfig config)
LikecreateShared(io.vertx.reactivex.core.Vertx, io.vertx.ext.mail.MailConfig, java.lang.String)but with the default pool name- Parameters:
vertx- the Vert.x instanceconfig- the configuration- Returns:
- the client
-
sendMail
public MailClient sendMail(MailMessage email, Handler<AsyncResult<MailResult>> resultHandler)
send a single mail via MailClient- Parameters:
email- MailMessage object containing the mail text, from/to, attachments etcresultHandler- will be called when the operation is finished or it fails (may be null to ignore the result)- Returns:
- this MailClient instance so the method can be used fluently
-
sendMail
public MailClient sendMail(MailMessage email)
send a single mail via MailClient- Parameters:
email- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- this MailClient instance so the method can be used fluently
-
rxSendMail
public io.reactivex.Single<MailResult> rxSendMail(MailMessage email)
send a single mail via MailClient- Parameters:
email- MailMessage object containing the mail text, from/to, attachments etc- Returns:
- this MailClient instance so the method can be used fluently
-
close
public void close(Handler<AsyncResult<Void>> closedHandler)
Close the MailClient- Parameters:
closedHandler- will be called after it is closed.
-
close
public void close()
Close the MailClient
-
rxClose
public io.reactivex.Completable rxClose()
Close the MailClient- Returns:
-
newInstance
public static MailClient newInstance(MailClient arg)
-
-