Search in sources :

Example 6 with PendingFolderModifications

use of com.zimbra.soap.mail.type.PendingFolderModifications in project zm-mailbox by Zimbra.

the class ImapServerListener method notifyAccountChange.

public void notifyAccountChange(AccountWithModifications accInfo) {
    ConcurrentHashMap<Integer, Set<ImapRemoteSession>> foldersToSessions = sessionMap.get(accInfo.getId());
    if (foldersToSessions != null && !foldersToSessions.isEmpty()) {
        Collection<PendingFolderModifications> mods = accInfo.getPendingFolderModifications();
        if (mods != null && !mods.isEmpty()) {
            for (PendingFolderModifications folderMods : mods) {
                Integer folderId = folderMods.getFolderId();
                PendingRemoteModifications remoteMods = PendingRemoteModifications.fromSOAP(folderMods, folderId, accInfo.getId());
                Set<ImapRemoteSession> listeners = foldersToSessions.get(folderId);
                if (listeners != null) {
                    for (ImapRemoteSession l : listeners) {
                        l.notifyPendingChanges(remoteMods, accInfo.getLastChangeId(), null);
                    }
                }
            }
        }
    }
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) HashSet(java.util.HashSet) Set(java.util.Set) PendingRemoteModifications(com.zimbra.cs.session.PendingRemoteModifications) PendingFolderModifications(com.zimbra.soap.mail.type.PendingFolderModifications)

Aggregations

PendingFolderModifications (com.zimbra.soap.mail.type.PendingFolderModifications)6 AccountWithModifications (com.zimbra.soap.type.AccountWithModifications)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 ZFolder (com.zimbra.client.ZFolder)2 ZMailbox (com.zimbra.client.ZMailbox)2 BaseItemInfo (com.zimbra.common.mailbox.BaseItemInfo)2 MailItem (com.zimbra.cs.mailbox.MailItem)2 Mailbox (com.zimbra.cs.mailbox.Mailbox)2 AdminCreateWaitSetResponse (com.zimbra.soap.admin.message.AdminCreateWaitSetResponse)2 AdminWaitSetRequest (com.zimbra.soap.admin.message.AdminWaitSetRequest)2 AdminWaitSetResponse (com.zimbra.soap.admin.message.AdminWaitSetResponse)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Test (org.junit.Test)2 ZimbraMailItem (com.zimbra.common.mailbox.ZimbraMailItem)1 ServiceException (com.zimbra.common.service.ServiceException)1 Element (com.zimbra.common.soap.Element)1 ContainerException (com.zimbra.common.soap.Element.ContainerException)1 Pair (com.zimbra.common.util.Pair)1