Interface TinyMailService
-
- All Implemented Interfaces:
public interface TinyMailServiceSend mail sync or async, save to database first to ensure mail must be sent.
- Since:
2022-12-29
trydofor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceTinyMailService.StatusHookhook the sending result (success/failure), and can stop the next send. should not throw exception in the hook.
-
Method Summary
Modifier and Type Method Description abstract booleansend(@NotNull() TinyMail message, boolean retry)Save first, then Sync single send. and return, - true, if send success. - false, if check fail, e.g. prop, lock or format. - throw if send fail, MailRetryException if async retry.abstract longpost(@NotNull() TinyMail message, boolean retry)Save first, then Sync single send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retryabstract longemit(@NotNull() TinyMail message, boolean retry)Save first, then Async batch send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - mills > now(), estimated send or retry (when error) timebooleansend(@NotNull() TinyMailPlain message)Save first, then Sync single send. and return, - true, if send success. - false, if check fail, e.g. prop, lock or format. - throw if send fail, MailRetryException if async retry.longpost(@NotNull() TinyMailPlain message)Save first, then Sync single send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retrylongemit(@NotNull() TinyMailPlain message)Save first, then Async batch send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - mills > now(), estimated send or retry (when error) timeabstract booleansend(long id, boolean retry, boolean check)Save first, then Sync single send. and return, - true, if send success. - false, if check fail, e.g. prop, lock or format. - throw if send fail, MailRetryException if async retry.abstract longpost(long id, boolean retry, boolean check)Save first, then Sync single send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retryabstract longemit(long id, boolean retry, boolean check)Save first, then Async batch send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - mills > now(), estimated send or retry (when error) timelongsave(@NotNull() TinyMailPlain message)Create(id is empty) or edit a mail with check, return the id. abstract longsave(@NotNull() TinyMailPlain message, boolean check)Create(id is empty) or edit a mail with check, return the id. abstract intscan(Long idle)Sync scan the unsent mail to resend them async, return the count. and if idel is * null, only scan, nothing to idle * > 0, adjust the scheduled scan interval mills * = 0, disable the scheduled scan * < 0, reset to scan-idle prop if adjusted beforeintscan()Sync scan the unsent mail to resend them async, return the count. longauto(@NotNull() TinyMail message, boolean retry)Save first, then auto post/emit by its mail-date. and retrun, - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retrylongauto(@NotNull() TinyMailPlain message)Save first, then auto post/emit by its mail-date. and retrun, - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retry-
-
Method Detail
-
send
abstract boolean send(@NotNull() TinyMail message, boolean retry)
Save first, then Sync single send. and return, - true, if send success. - false, if check fail, e.g. prop, lock or format. - throw if send fail, MailRetryException if async retry.
-
post
abstract long post(@NotNull() TinyMail message, boolean retry)
Save first, then Sync single send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retry
-
emit
abstract long emit(@NotNull() TinyMail message, boolean retry)
Save first, then Async batch send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - mills > now(), estimated send or retry (when error) time
-
send
boolean send(@NotNull() TinyMailPlain message)
Save first, then Sync single send. and return, - true, if send success. - false, if check fail, e.g. prop, lock or format. - throw if send fail, MailRetryException if async retry.
-
post
long post(@NotNull() TinyMailPlain message)
Save first, then Sync single send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retry
-
emit
long emit(@NotNull() TinyMailPlain message)
Save first, then Async batch send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - mills > now(), estimated send or retry (when error) time
-
send
abstract boolean send(long id, boolean retry, boolean check)
Save first, then Sync single send. and return, - true, if send success. - false, if check fail, e.g. prop, lock or format. - throw if send fail, MailRetryException if async retry.
-
post
abstract long post(long id, boolean retry, boolean check)
Save first, then Sync single send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retry
-
emit
abstract long emit(long id, boolean retry, boolean check)
Save first, then Async batch send, fire and forget, no exception throw. and return, - {@value #ErrOther}, if throw non MailRetryException. - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - mills > now(), estimated send or retry (when error) time
-
save
long save(@NotNull() TinyMailPlain message)
Create(id is empty) or edit a mail with check, return the id. NOTE: no schedule to send, need manually send/post/emit it.
-
save
abstract long save(@NotNull() TinyMailPlain message, boolean check)
Create(id is empty) or edit a mail with check, return the id. NOTE: no schedule to send, need manually send/post/emit it.
-
scan
abstract int scan(Long idle)
Sync scan the unsent mail to resend them async, return the count. and if idel is * null, only scan, nothing to idle * > 0, adjust the scheduled scan interval mills * = 0, disable the scheduled scan * < 0, reset to scan-idle prop if adjusted before
-
scan
int scan()
Sync scan the unsent mail to resend them async, return the count.
-
auto
long auto(@NotNull() TinyMail message, boolean retry)
Save first, then auto post/emit by its mail-date. and retrun, - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retry
-
auto
long auto(@NotNull() TinyMailPlain message)
Save first, then auto post/emit by its mail-date. and retrun, - {@value #ErrCheck}, if check fail, e.g. prop, lock or format. - {@value #Success}, if send success. - mills > now(), estimated retry time, if fail and async retry
-
-
-
-