Beispiel #1
0
        public void RecordLatestFolderHierarchySnapshot(MailboxSession mailboxSession, ISyncLogger syncLogger = null)
        {
            if (syncLogger == null)
            {
                syncLogger = TracingLogger.Singleton;
            }
            FolderHierarchyChangeDetector.SyncHierarchyManifestState syncHierarchyManifestState = this.SyncHierarchyManifestState;
            bool catchup = false;

            if (syncHierarchyManifestState == null)
            {
                syncLogger.TraceDebug(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.RecordLatestFolderHierarchySnapshot] Last ICS snapshot was null.  Doing a catchup sync.");
                syncHierarchyManifestState      = new FolderHierarchyChangeDetector.SyncHierarchyManifestState();
                this.SyncHierarchyManifestState = syncHierarchyManifestState;
                catchup = true;
            }
            FolderHierarchyChangeDetector.RunICSManifestSync(catchup, syncHierarchyManifestState, mailboxSession, syncLogger);
        }
Beispiel #2
0
 public FolderHierarchyChangeDetector.MailboxChangesManifest GetFolderHierarchyICSChanges(MailboxSession mailboxSession, out FolderHierarchyChangeDetector.SyncHierarchyManifestState latestState, ISyncLogger syncLogger = null)
 {
     if (syncLogger == null)
     {
         syncLogger = TracingLogger.Singleton;
     }
     latestState = this.SyncHierarchyManifestState;
     if (latestState == null)
     {
         syncLogger.TraceDebug(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetFolderHierarchyICSChanges] Old ICS state was missing from cache.  Must do expensive check instead.");
         return(null);
     }
     latestState = latestState.Clone();
     FolderHierarchyChangeDetector.MailboxChangesManifest mailboxChangesManifest = FolderHierarchyChangeDetector.RunICSManifestSync(false, latestState, mailboxSession, syncLogger);
     syncLogger.TraceDebug <string, string>(ExTraceGlobals.SyncProcessTracer, (long)this.GetHashCode(), "[DeviceSyncStateMetadata.GetFolderHierarchyICSChanges] Changes: {0}, Deletes: {1}", (mailboxChangesManifest == null || mailboxChangesManifest.ChangedFolders == null) ? "<NULL>" : mailboxChangesManifest.ChangedFolders.Count.ToString(), (mailboxChangesManifest == null || mailboxChangesManifest.DeletedFolders == null) ? "<NULL>" : mailboxChangesManifest.DeletedFolders.Count.ToString());
     return(mailboxChangesManifest);
 }