Interface TinyMailService

  • All Implemented Interfaces:

    
    public interface TinyMailService
    
                        

    Send mail sync or async, save to database first to ensure mail must be sent.

    Since:

    2022-12-29

    Author:

    trydofor

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface TinyMailService.StatusHook

      hook the sending result (success/failure), and can stop the next send. should not throw exception in the hook.

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract boolean send(@NotNull() TinyMail message, boolean retry) Sync send, return success or not, or throw exception.
      abstract boolean post(@NotNull() TinyMail message, boolean retry) Sync send, fire and forget, no exception throw.
      abstract long emit(@NotNull() TinyMail message, boolean retry) Async, no exception throw.
      boolean send(@NotNull() TinyMailPlain message) Sync send, return success or not, or throw exception.
      boolean post(@NotNull() TinyMailPlain message) Sync send, fire and forget, no exception throw.
      long emit(@NotNull() TinyMailPlain message) Async, no exception throw.
      abstract boolean send(long id, boolean retry, boolean check) Sync send, fire and forget, no exception throw.
      abstract boolean post(long id, boolean retry, boolean check) Sync send, fire and forget, no exception throw.
      abstract long emit(long id, boolean retry, boolean check) Async, no exception throw.
      abstract long save(@NotNull() TinyMailPlain message) Create(id is empty) or edit a mail, return the id
      abstract int scan() Sync scan the mail to resend, return the count, and send them async
      long auto(@NotNull() TinyMail message, boolean retry) Create the mail, and auto send it in sync or async way.
      long auto(@NotNull() TinyMailPlain message) Create the mail, and auto send it in sync or async way.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • send

         abstract boolean send(@NotNull() TinyMail message, boolean retry)

        Sync send, return success or not, or throw exception. If not success, async retry

      • post

         abstract boolean post(@NotNull() TinyMail message, boolean retry)

        Sync send, fire and forget, no exception throw. If not success, async retry

      • emit

         abstract long emit(@NotNull() TinyMail message, boolean retry)

        Async, no exception throw. auto batch send. Return the estimated sending time, `-1` for failure If not success, async retry.

      • send

         boolean send(@NotNull() TinyMailPlain message)

        Sync send, return success or not, or throw exception. If not success, async retry

      • post

         boolean post(@NotNull() TinyMailPlain message)

        Sync send, fire and forget, no exception throw. If not success, async retry

      • emit

         long emit(@NotNull() TinyMailPlain message)

        Async, no exception throw. auto batch send. Return the estimated sending time, `-1` for failure If not success, async retry.

      • send

         abstract boolean send(long id, boolean retry, boolean check)

        Sync send, fire and forget, no exception throw. If not success, async retry, whether to check state before sending

      • post

         abstract boolean post(long id, boolean retry, boolean check)

        Sync send, fire and forget, no exception throw. If not success, async retry, whether to check state before sending

      • emit

         abstract long emit(long id, boolean retry, boolean check)

        Async, no exception throw. auto batch send. Return the estimated sending time, `-1` for failure If not success, async retry, whether to check state before sending

      • save

         abstract long save(@NotNull() TinyMailPlain message)

        Create(id is empty) or edit a mail, return the id

      • scan

         abstract int scan()

        Sync scan the mail to resend, return the count, and send them async

      • auto

         long auto(@NotNull() TinyMail message, boolean retry)

        Create the mail, and auto send it in sync or async way. `-1` means failure, `0` means sync send, otherwise means async send at estimated sending time

      • auto

         long auto(@NotNull() TinyMailPlain message)

        Create the mail, and auto send it in sync or async way. `-1` means failure, `0` means sync send, otherwise means async send at estimated sending time