Search in sources :

Example 1 with CreateItemNotification

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);
}
Also used : CreateItemNotification(com.zimbra.soap.mail.type.CreateItemNotification) ImapMessageInfo(com.zimbra.soap.mail.type.ImapMessageInfo)

Example 2 with CreateItemNotification

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;
}
Also used : CreateItemNotification(com.zimbra.soap.mail.type.CreateItemNotification) BaseItemInfo(com.zimbra.common.mailbox.BaseItemInfo) ZimbraTag(com.zimbra.common.mailbox.ZimbraTag) Type(com.zimbra.cs.mailbox.MailItem.Type) RenameFolderNotification(com.zimbra.soap.mail.type.ModifyNotification.RenameFolderNotification) MailItem(com.zimbra.cs.mailbox.MailItem) ZimbraMailItem(com.zimbra.common.mailbox.ZimbraMailItem) DeleteItemNotification(com.zimbra.soap.mail.type.DeleteItemNotification) ModifyItemNotification(com.zimbra.soap.mail.type.ModifyNotification.ModifyItemNotification) ModifyTagNotification(com.zimbra.soap.mail.type.ModifyNotification.ModifyTagNotification)

Aggregations

CreateItemNotification (com.zimbra.soap.mail.type.CreateItemNotification)2 BaseItemInfo (com.zimbra.common.mailbox.BaseItemInfo)1 ZimbraMailItem (com.zimbra.common.mailbox.ZimbraMailItem)1 ZimbraTag (com.zimbra.common.mailbox.ZimbraTag)1 MailItem (com.zimbra.cs.mailbox.MailItem)1 Type (com.zimbra.cs.mailbox.MailItem.Type)1 DeleteItemNotification (com.zimbra.soap.mail.type.DeleteItemNotification)1 ImapMessageInfo (com.zimbra.soap.mail.type.ImapMessageInfo)1 ModifyItemNotification (com.zimbra.soap.mail.type.ModifyNotification.ModifyItemNotification)1 ModifyTagNotification (com.zimbra.soap.mail.type.ModifyNotification.ModifyTagNotification)1 RenameFolderNotification (com.zimbra.soap.mail.type.ModifyNotification.RenameFolderNotification)1