use of com.zimbra.soap.mail.type.CreateItemNotification in project zm-mailbox by Zimbra.
the class JaxbUtil method getCreatedItemSOAP.
public static CreateItemNotification getCreatedItemSOAP(BaseItemInfo mod) throws ServiceException {
String tags = mod.getTags() == null ? null : Joiner.on(",").join(mod.getTags());
ImapMessageInfo messageInfo = new ImapMessageInfo(mod.getIdInMailbox(), mod.getImapUid(), mod.getMailItemType().toString(), mod.getFlagBitmask(), tags);
return new CreateItemNotification(messageInfo);
}
use of com.zimbra.soap.mail.type.CreateItemNotification in project zm-mailbox by Zimbra.
the class PendingRemoteModifications method fromSOAP.
public static PendingRemoteModifications fromSOAP(PendingFolderModifications mods, Integer folderId, String acctId) {
PendingRemoteModifications prms = new PendingRemoteModifications();
for (CreateItemNotification createSpec : mods.getCreated()) {
prms.recordCreated(ModificationItem.itemUpdate(createSpec.getMessageInfo(), folderId, acctId));
}
for (ModifyItemNotification modifyItem : mods.getModifiedMsgs()) {
int change = modifyItem.getChangeBitmask();
BaseItemInfo itemUpdate = ModificationItem.itemUpdate(modifyItem.getMessageInfo(), folderId, acctId);
prms.recordModified(itemUpdate, change);
}
for (ModifyTagNotification modifyTag : mods.getModifiedTags()) {
int change = modifyTag.getChangeBitmask();
int tagId = modifyTag.getId();
String tagName = modifyTag.getName();
ZimbraTag tagRename = ModificationItem.tagRename(tagId, tagName);
prms.recordModified(tagRename, acctId, change);
}
for (RenameFolderNotification renamedFolder : mods.getRenamedFolders()) {
int change = renamedFolder.getChangeBitmask();
int renamedFolderId = renamedFolder.getFolderId();
String newPath = renamedFolder.getPath();
ModificationItem folderRename = ModificationItem.folderRename(renamedFolderId, newPath, acctId);
prms.recordModified(folderRename, change);
}
for (DeleteItemNotification delSpec : mods.getDeleted()) {
int id = delSpec.getId();
MailItem.Type type = MailItem.Type.of(delSpec.getType());
prms.recordDeleted(type, acctId, id);
}
return prms;
}
Aggregations