Package io.jmix.imap

Interface ImapEventsGenerator

All Known Implementing Classes:
ImapEventsBatchedGenerator, ImapStandardEventsGenerator

public interface ImapEventsGenerator
An extension point for IMAP events. A bean implementing this interface can be specified in an IMAP configuration. Such beans can be useful for applying IMAP extensions and custom communication mechanisms specific for particular mailboxes
  • Method Details

    • init

      void init(ImapMailBox mailBox)
      Performs bootstrap logic for mailbox synchronization, e.g. attaching listeners or schedule background tasks
      Parameters:
      mailBox - IMAP mailbox
    • shutdown

      void shutdown(ImapMailBox mailBox)
      Releases resources used for synchronization, e.g. detaching listeners or cancelling scheduled background tasks
      Parameters:
      mailBox - IMAP mailbox
    • generateForNewMessages

      Collection<? extends BaseImapEvent> generateForNewMessages(ImapFolder folder)
      Emits events for new messages in a mailbox folder accumulated since the previous call of this method for the folder
      Parameters:
      folder - IMAP mailbox folder
      Returns:
      events related to new messages in the folder, can emit not only instances of NewEmailImapEvent
    • generateForChangedMessages

      Collection<? extends BaseImapEvent> generateForChangedMessages(ImapFolder folder)
      Emits events for modified messages in a mailbox folder accumulated since the previous call of this method for the folder
      Parameters:
      folder - IMAP mailbox folder
      Returns:
      events related to modified messages in the folder
    • generateForMissedMessages

      Collection<? extends BaseImapEvent> generateForMissedMessages(ImapFolder folder)
      Emits events for missed (moved to other folder or deleted) messages in a mailbox folder accumulated since the previous call of this method for the folder
      Parameters:
      folder - IMAP mailbox folder
      Returns:
      events related to missed messages in the folder