public class ImapMailboxRecordsService extends BaseMailboxRecordsService implements IInternalMailboxItems
IInternalMailboxItems.ImapClient, IInternalMailboxItems.ImapCommandRunner
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
DEFAULT_TIMEOUT |
container, context, mailboxUniqueId, optRecordsLocation, rbac, recordStore, replicaStore, storeService
Constructor and Description |
---|
ImapMailboxRecordsService(javax.sql.DataSource ds,
Container cont,
BmContext context,
java.lang.String mailboxUniqueId,
MailboxRecordStore recordStore,
ContainerStoreService<MailboxRecord> storeService) |
Modifier and Type | Method and Description |
---|---|
Ack |
addFlag(FlagUpdate flagUpdate)
Add one flag to multiple
MailboxItem . |
ImapItemIdentifier |
create(MailboxItem value) |
ImapAck |
createById(long id,
MailboxItem value) |
void |
deleteById(long id) |
Ack |
deleteFlag(FlagUpdate flagUpdate)
Delete one flag to multiple
MailboxItem . |
Stream |
fetch(long imapUid,
java.lang.String address,
java.lang.String encoding,
java.lang.String mime,
java.lang.String charset,
java.lang.String filename)
Fetch a single part from an email mime tree.
|
Stream |
fetchComplete(long imapUid) |
ItemValue<MailboxItem> |
getCompleteById(long id) |
ItemValue<MailboxItem> |
getForUpdate(long id)
Decompose EML in temporary parts, useful to update drafts
|
IInternalMailboxItems.ImapCommandRunner |
imapExecutor() |
java.lang.String |
imapFolder() |
java.util.List<ItemIdentifier> |
multiCreate(java.util.List<MailboxItem> items) |
java.util.List<ItemValue<MailboxItem>> |
multipleById(java.util.List<java.lang.Long> ids) |
void |
multipleDeleteById(java.util.List<java.lang.Long> ids) |
java.util.List<java.lang.Long> |
recentItems(java.util.Date d)
Get the list of
ItemValue.internalId for MailboxItem
delivered or updated after or at the given date. |
void |
removePart(java.lang.String partId)
Remove a part uploaded through
IMailboxItems.uploadPart(Stream) |
void |
resync()
Removes extra records (missing on imap server)
|
ItemIdentifier |
unexpunge(long itemId)
Re-injects a deleted item into the current folder
|
java.util.List<java.lang.Long> |
unreadItems()
Get the list of unread items, applying the per-user overlay when dealing with
a shared folder.
|
ImapAck |
updateById(long id,
MailboxItem mail) |
java.lang.String |
uploadPart(Stream part)
Upload an email part (eg.
|
adapt, allIds, changeset, changesetById, checkExistOnBackend, containerChangelog, count, fetchCompleteOIO, filteredChangesetById, getVersion, itemChangelog, sortedIds
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sortedIds
allIds, changeset, changesetById, containerChangelog, filteredChangesetById, getVersion, itemChangelog
count
public ImapMailboxRecordsService(javax.sql.DataSource ds, Container cont, BmContext context, java.lang.String mailboxUniqueId, MailboxRecordStore recordStore, ContainerStoreService<MailboxRecord> storeService)
public java.lang.String imapFolder()
imapFolder
in interface IInternalMailboxItems
public IInternalMailboxItems.ImapCommandRunner imapExecutor()
imapExecutor
in interface IInternalMailboxItems
public ItemValue<MailboxItem> getCompleteById(long id)
getCompleteById
in interface IMailboxItems
getCompleteById
in interface ICrudByIdSupport<MailboxItem>
public void deleteById(long id)
deleteById
in interface IMailboxItems
deleteById
in interface ICrudByIdSupport<MailboxItem>
public void resync()
IMailboxItems
resync
in interface IMailboxItems
public ImapAck updateById(long id, MailboxItem mail)
updateById
in interface IMailboxItems
updateById
in interface ICrudByIdSupport<MailboxItem>
public ImapItemIdentifier create(MailboxItem value)
create
in interface IMailboxItems
public ImapAck createById(long id, MailboxItem value)
createById
in interface IMailboxItems
createById
in interface ICrudByIdSupport<MailboxItem>
public java.util.List<ItemIdentifier> multiCreate(java.util.List<MailboxItem> items)
multiCreate
in interface IInternalMailboxItems
public java.util.List<ItemValue<MailboxItem>> multipleById(java.util.List<java.lang.Long> ids)
multipleById
in interface IMailboxItems
public ItemIdentifier unexpunge(long itemId)
IMailboxItems
unexpunge
in interface IMailboxItems
itemId
- the item id of a deleted or deleted+expunged messagepublic Stream fetchComplete(long imapUid)
fetchComplete
in interface IMailboxItems
fetchComplete
in class BaseMailboxRecordsService
public Stream fetch(long imapUid, java.lang.String address, java.lang.String encoding, java.lang.String mime, java.lang.String charset, java.lang.String filename)
IMailboxItems
MessageBody.Part
objects from MessageBody.structure
.fetch
in interface IMailboxItems
encoding
- set null to fetch pristine partmime
- override the mime type of the responsecharset
- override the charset of the responsefilename
- set a part name (useful for download purpose)public java.lang.String uploadPart(Stream part)
IMailboxItems
MessageBody.Part.address
when creating or updating a MailboxItem
.
The uploaded parts need to be cleaned-up explicitly with
IMailboxItems.removePart(String)
uploadPart
in interface IMailboxItems
part
- a re-usable email part.MessageBody.Part.address
public void removePart(java.lang.String partId)
IMailboxItems
IMailboxItems.uploadPart(Stream)
removePart
in interface IMailboxItems
partId
- an address returned by a previous uploadPart
callpublic java.util.List<java.lang.Long> unreadItems()
IMailboxItems
unreadItems
in interface IMailboxItems
ItemValue.internalId
public java.util.List<java.lang.Long> recentItems(java.util.Date d)
IMailboxItems
ItemValue.internalId
for MailboxItem
delivered or updated after or at the given date.recentItems
in interface IMailboxItems
public void multipleDeleteById(java.util.List<java.lang.Long> ids)
multipleDeleteById
in interface ICrudByIdSupport<MailboxItem>
public Ack addFlag(FlagUpdate flagUpdate)
IMailboxItems
MailboxItem
.addFlag
in interface IMailboxItems
public Ack deleteFlag(FlagUpdate flagUpdate)
IMailboxItems
MailboxItem
.deleteFlag
in interface IMailboxItems
public ItemValue<MailboxItem> getForUpdate(long id)
IMailboxItems
getForUpdate
in interface IMailboxItems
Copyright © 2021. All Rights Reserved.