private void OnSynchronizeHierarchyCheck(object sender)
 {
     lock (this.objectDisposedLock)
     {
         if (this.isInternalDisposed)
         {
             return;
         }
         if (this.synchronizeHierarchyCheckTimer != null)
         {
             this.synchronizeHierarchyCheckTimer.Dispose();
             this.synchronizeHierarchyCheckTimer = 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 if (publicFolderSyncJobState.JobStatus == PublicFolderSyncJobState.Status.None)
         {
             this.ScheduleSynchronizeHierarchy(TimeSpan.FromMilliseconds(0.0));
         }
         else if (publicFolderSyncJobState.JobStatus == PublicFolderSyncJobState.Status.Completed)
         {
             if (publicFolderSyncJobState.LastError != null)
             {
                 this.ScheduleSynchronizeHierarchy(PublicFolderMailboxSynchronizer.SynchronizeHierarchyAfterFailureInterval);
             }
             else
             {
                 this.ScheduleSynchronizeHierarchy(PublicFolderMailboxSynchronizer.SynchronizeHierarchyAfterSuccessInterval);
             }
         }
     }
     catch (PublicFolderSyncTransientException)
     {
         this.ScheduleSynchonizeHierarchyCheck(PublicFolderMailboxSynchronizer.QueryStatusSynchronizeHierarchyInterval);
     }
     catch (PublicFolderSyncPermanentException)
     {
         this.ScheduleSynchonizeHierarchyCheck(PublicFolderMailboxSynchronizer.QueryStatusSynchronizeHierarchyInterval);
     }
 }
 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 #3
0
 public PublicFolderSyncJobEnqueueResult(EnqueueResultType result, PublicFolderSyncJobState syncJobState) : base(result)
 {
     this.PublicFolderSyncJobState = syncJobState;
     this.Type = QueueType.PublicFolder;
 }