Package io.jmix.imap.impl
Class ImapManagerImpl
java.lang.Object
io.jmix.imap.impl.ImapManagerImpl
- All Implemented Interfaces:
ImapManager
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected ImapHelper
protected ImapOperations
protected Metadata
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
consumeMessage
(ImapMessage msg, ImapManagerImpl.ImapFunction<com.sun.mail.imap.IMAPMessage, T> consumer, String actionDescription) void
deleteMessage
(ImapMessage message) Delete messageprotected void
doMove
(ImapMessage msg, String newFolderName, ImapMailBox mailBox) fetchFolders
(ImapMailBox box) Retrieve all folders of mailbox preserving tree structurefetchFolders
(ImapMailBox box, String... folderNames) Retrieve folders of mailbox with specified full names, result is presented in flat structure hiding parent\child relationshipfetchMessage
(ImapMessage message) Retrieve single messagegetAddressList
(jakarta.mail.Address[] addresses) getFlags
(jakarta.mail.Message message) void
moveMessage
(ImapMessage msg, String folderName) Move message in different folder, if folder is the same - nothing changed, if folder with specified full name doesn't exist - results in throwingImapException
void
setFlag
(ImapMessage message, ImapFlag flag, boolean set) Change meta data flag for message, flag can be either standard or custom oneCheck a connection for specified mail boxprotected ImapMessageDto
toDto
(ImapMailBox mailBox, ImapMessage imapMessage, com.sun.mail.imap.IMAPMessage nativeMessage)
-
Field Details
-
imapHelper
-
imapOperations
-
metadata
-
-
Constructor Details
-
ImapManagerImpl
public ImapManagerImpl()
-
-
Method Details
-
testConnection
Description copied from interface:ImapManager
Check a connection for specified mail box- Specified by:
testConnection
in interfaceImapManager
- Parameters:
box
- mail box to connect- Returns:
- result of set connection
-
fetchFolders
Description copied from interface:ImapManager
Retrieve all folders of mailbox preserving tree structure- Specified by:
fetchFolders
in interfaceImapManager
- Parameters:
box
- IMAP mailbox connection details- Returns:
- root folders of IMAP mailbox, each folder can contain nested child folders forming tree structure
-
fetchFolders
Description copied from interface:ImapManager
Retrieve folders of mailbox with specified full names, result is presented in flat structure hiding parent\child relationship- Specified by:
fetchFolders
in interfaceImapManager
- Parameters:
box
- IMAP mailbox connection detailsfolderNames
- full names of folders to retrieve- Returns:
- folders of IMAP mailbox with specified full names, result is ordered according to order of names input
-
fetchMessage
Description copied from interface:ImapManager
Retrieve single message- Specified by:
fetchMessage
in interfaceImapManager
- Parameters:
message
- reference object for IMAP message- Returns:
- fully fetched message or null if there is no message with such UID in corresponding folder
-
toDto
protected ImapMessageDto toDto(ImapMailBox mailBox, ImapMessage imapMessage, com.sun.mail.imap.IMAPMessage nativeMessage) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
deleteMessage
Description copied from interface:ImapManager
Delete message- Specified by:
deleteMessage
in interfaceImapManager
- Parameters:
message
- reference object for IMAP message
-
moveMessage
Description copied from interface:ImapManager
Move message in different folder, if folder is the same - nothing changed, if folder with specified full name doesn't exist - results in throwingImapException
- Specified by:
moveMessage
in interfaceImapManager
- Parameters:
msg
- reference object for IMAP messagefolderName
- full name of new folder
-
doMove
-
setFlag
Description copied from interface:ImapManager
Change meta data flag for message, flag can be either standard or custom one- Specified by:
setFlag
in interfaceImapManager
- Parameters:
message
- reference object for IMAP messageflag
- flag to changeset
- if true - set the flag, if false - clear the flag
-
consumeMessage
protected <T> T consumeMessage(ImapMessage msg, ImapManagerImpl.ImapFunction<com.sun.mail.imap.IMAPMessage, T> consumer, String actionDescription) -
getAddressList
-
getFlags
protected List<String> getFlags(jakarta.mail.Message message) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-