private void OnSynchronizeHierarchy(object state)
 {
     lock (this.objectDisposedLock)
     {
         if (this.isInternalDisposed)
         {
             return;
         }
         if (this.synchronizeHierarchyTimer != null)
         {
             this.synchronizeHierarchyTimer.Dispose();
             this.synchronizeHierarchyTimer = null;
         }
     }
     try
     {
         OrganizationId           organizationId           = this.tenantPartitionHint.GetOrganizationId();
         PublicFolderSyncJobState publicFolderSyncJobState = PublicFolderSyncJobRpc.QueryStatusSyncHierarchy(organizationId, this.mailboxGuid, this.serverFqdn);
         this.syncJobState = publicFolderSyncJobState;
         if (publicFolderSyncJobState.JobStatus == PublicFolderSyncJobState.Status.Queued)
         {
             this.ScheduleSynchonizeHierarchyCheck(PublicFolderMailboxSynchronizer.QueryStatusSynchronizeHierarchyInterval);
         }
         else
         {
             publicFolderSyncJobState = PublicFolderSyncJobRpc.StartSyncHierarchy(organizationId, this.mailboxGuid, this.serverFqdn, false);
             this.syncJobState        = publicFolderSyncJobState;
             if (publicFolderSyncJobState.JobStatus == PublicFolderSyncJobState.Status.Queued)
             {
                 this.ScheduleSynchonizeHierarchyCheck(PublicFolderMailboxSynchronizer.QueryStatusSynchronizeHierarchyInterval);
             }
             else
             {
                 this.ScheduleSynchronizeHierarchy(PublicFolderMailboxSynchronizer.SynchronizeHierarchyAfterFailureInterval);
             }
         }
     }
     catch (PublicFolderSyncTransientException)
     {
         this.ScheduleSynchronizeHierarchy(PublicFolderMailboxSynchronizer.SynchronizeHierarchyAfterFailureInterval);
     }
     catch (PublicFolderSyncPermanentException)
     {
         this.ScheduleSynchronizeHierarchy(PublicFolderMailboxSynchronizer.SynchronizeHierarchyAfterFailureInterval);
     }
 }
Beispiel #2
0
 public static PublicFolderSyncJobState StartSyncHierarchy(IExchangePrincipal contentMailboxPrincipal, bool executeReconcileFolders = false)
 {
     ArgumentValidator.ThrowIfNull("contentMailboxPrincipal", contentMailboxPrincipal);
     return(PublicFolderSyncJobRpc.StartSyncHierarchy(contentMailboxPrincipal.MailboxInfo.OrganizationId, contentMailboxPrincipal.MailboxInfo.MailboxGuid, contentMailboxPrincipal.MailboxInfo.Location.ServerFqdn, executeReconcileFolders));
 }