Package io.jmix.imap.sync.events
Class ImapStandardEventsGenerator
java.lang.Object
io.jmix.imap.sync.events.ImapEventsBatchedGenerator
io.jmix.imap.sync.events.ImapStandardEventsGenerator
- All Implemented Interfaces:
ImapEventsGenerator
@Component("imap_StandardEventsGenerator")
public class ImapStandardEventsGenerator
extends ImapEventsBatchedGenerator
-
Field Summary
Modifier and TypeFieldDescriptionprotected SystemAuthenticator
protected javax.persistence.EntityManager
protected ImapMessageSyncDataProvider
protected ImapProperties
protected TimeSource
protected org.springframework.transaction.support.TransactionTemplate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends BaseImapEvent>
generateForChangedMessages
(ImapFolder folder, int batchSize) Collection<? extends BaseImapEvent>
generateForMissedMessages
(ImapFolder jmixFolder, int batchSize) Collection<? extends BaseImapEvent>
generateForNewMessages
(ImapFolder folder, int batchSize) protected List<BaseImapEvent>
generateUpdateEvents
(ImapMessageSync messageSync) protected int
void
init
(ImapMailBox imapMailBox) Performs bootstrap logic for mailbox synchronization, e.g.protected boolean
isAnswered
(javax.mail.Flags newFlags, javax.mail.Flags oldFlags) protected boolean
isSeen
(javax.mail.Flags newFlags, javax.mail.Flags oldFlags) protected void
recalculateMessageNumbers
(ImapFolder jmixFolder, List<Integer> messageNumbers) protected void
setTransactionManager
(org.springframework.transaction.PlatformTransactionManager transactionManager) void
shutdown
(ImapMailBox imapMailBox) Releases resources used for synchronization, e.g.Methods inherited from class io.jmix.imap.sync.events.ImapEventsBatchedGenerator
generateForChangedMessages, generateForMissedMessages, generateForNewMessages
-
Field Details
-
imapMessageSyncDataProvider
-
authentication
-
entityManager
protected javax.persistence.EntityManager entityManager -
transaction
protected org.springframework.transaction.support.TransactionTemplate transaction -
timeSource
-
imapProperties
-
-
Constructor Details
-
ImapStandardEventsGenerator
public ImapStandardEventsGenerator()
-
-
Method Details
-
setTransactionManager
@Autowired protected void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) -
init
Description copied from interface:ImapEventsGenerator
Performs bootstrap logic for mailbox synchronization, e.g. attaching listeners or schedule background tasks- Parameters:
imapMailBox
- IMAP mailbox
-
shutdown
Description copied from interface:ImapEventsGenerator
Releases resources used for synchronization, e.g. detaching listeners or cancelling scheduled background tasks- Parameters:
imapMailBox
- IMAP mailbox
-
getBatchSize
protected int getBatchSize()- Specified by:
getBatchSize
in classImapEventsBatchedGenerator
-
generateForNewMessages
- Specified by:
generateForNewMessages
in classImapEventsBatchedGenerator
-
generateForChangedMessages
public Collection<? extends BaseImapEvent> generateForChangedMessages(ImapFolder folder, int batchSize) - Specified by:
generateForChangedMessages
in classImapEventsBatchedGenerator
-
generateUpdateEvents
-
isSeen
protected boolean isSeen(javax.mail.Flags newFlags, javax.mail.Flags oldFlags) -
isAnswered
protected boolean isAnswered(javax.mail.Flags newFlags, javax.mail.Flags oldFlags) -
generateForMissedMessages
@Transactional public Collection<? extends BaseImapEvent> generateForMissedMessages(ImapFolder jmixFolder, int batchSize) - Specified by:
generateForMissedMessages
in classImapEventsBatchedGenerator
-
recalculateMessageNumbers
-