Package io.jmix.email.impl
Class EmailDataProviderImpl
java.lang.Object
io.jmix.email.impl.EmailDataProviderImpl
- All Implemented Interfaces:
EmailDataProvider
@Component("email_EmailDataProvider")
public class EmailDataProviderImpl
extends Object
implements EmailDataProvider
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected DataManager
protected EmailerProperties
protected EntityEventManager
protected javax.persistence.EntityManager
protected FetchPlanRepository
protected FileStorage
protected FileStorageLocator
protected TimeSource
protected org.springframework.transaction.support.TransactionTemplate
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
bodyTextFromByteArray
(byte[] bodyContent) protected byte[]
bodyTextToBytes
(SendingMessage message) protected String
buildErrorMessage
(SendingStatus status) protected FileRef
createContentFile
(EmailDataProviderImpl.MessagePersistingContext context, byte[] bodyBytes, String fileName) protected String
protected FileStorage
protected void
loadBodyAndAttachments
(SendingMessage message) loadContentText
(SendingMessage sendingMessage) Loads content text for given message.Loads email messages to be sent.protected void
migrateAttachment
(SendingAttachment attachment) void
migrateAttachmentsToFileStorage
(List<SendingAttachment> attachments) Migrate list of existing email attachments to be stored in file storage, in a single transaction.void
migrateEmailsToFileStorage
(List<SendingMessage> messages) Migrate list of existing messages to be stored in file storage, in a single transaction.protected void
void
persistMessage
(SendingMessage sendingMessage, SendingStatus status) Stores given message with specified status.protected void
persistSendingMessage
(SendingMessage message, EmailDataProviderImpl.MessagePersistingContext context) protected void
protected void
setTransactionManager
(org.springframework.transaction.PlatformTransactionManager transactionManager) protected boolean
shouldMarkNotSent
(SendingMessage sendingMessage) void
updateStatus
(SendingMessage sendingMessage, SendingStatus status) Update status for specified message.
-
Field Details
-
BODY_FILE_EXTENSION
- See Also:
-
emailerProperties
-
timeSource
-
entityManager
protected javax.persistence.EntityManager entityManager -
fetchPlanRepository
-
transaction
protected org.springframework.transaction.support.TransactionTemplate transaction -
fileStorage
-
dataManager
-
fileStorageLocator
-
entityEventManager
-
-
Constructor Details
-
EmailDataProviderImpl
public EmailDataProviderImpl()
-
-
Method Details
-
setTransactionManager
@Autowired protected void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) -
loadEmailsToSend
Description copied from interface:EmailDataProvider
Loads email messages to be sent.- Specified by:
loadEmailsToSend
in interfaceEmailDataProvider
-
updateStatus
Description copied from interface:EmailDataProvider
Update status for specified message.- Specified by:
updateStatus
in interfaceEmailDataProvider
- Parameters:
sendingMessage
- messagestatus
- new status
-
loadContentText
Description copied from interface:EmailDataProvider
Loads content text for given message.- Specified by:
loadContentText
in interfaceEmailDataProvider
- Returns:
- email content text
-
persistMessage
Description copied from interface:EmailDataProvider
Stores given message with specified status.- Specified by:
persistMessage
in interfaceEmailDataProvider
-
migrateEmailsToFileStorage
Description copied from interface:EmailDataProvider
Migrate list of existing messages to be stored in file storage, in a single transaction.- Specified by:
migrateEmailsToFileStorage
in interfaceEmailDataProvider
-
migrateAttachmentsToFileStorage
Description copied from interface:EmailDataProvider
Migrate list of existing email attachments to be stored in file storage, in a single transaction.- Specified by:
migrateAttachmentsToFileStorage
in interfaceEmailDataProvider
-
buildErrorMessage
-
migrateMessage
-
migrateAttachment
-
shouldMarkNotSent
-
loadBodyAndAttachments
-
persistSendingMessage
protected void persistSendingMessage(SendingMessage message, EmailDataProviderImpl.MessagePersistingContext context) -
createContentFile
protected FileRef createContentFile(@Nullable EmailDataProviderImpl.MessagePersistingContext context, byte[] bodyBytes, String fileName) -
getFileName
-
bodyTextFromByteArray
-
bodyTextToBytes
-
removeOrphanFiles
-
getFileStorage
-