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);
     }
 }
Пример #3
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));
 }
Пример #4
0
 public static PublicFolderSyncJobState QueryStatusSyncHierarchy(IExchangePrincipal contentMailboxPrincipal)
 {
     ArgumentValidator.ThrowIfNull("contentMailboxPrincipal", contentMailboxPrincipal);
     return(PublicFolderSyncJobRpc.QueryStatusSyncHierarchy(contentMailboxPrincipal.MailboxInfo.OrganizationId, contentMailboxPrincipal.MailboxInfo.MailboxGuid, contentMailboxPrincipal.MailboxInfo.Location.ServerFqdn));
 }
Пример #5
0
 public static PublicFolderSyncJobState SyncFolder(IExchangePrincipal contentMailboxPrincipal, byte[] folderId)
 {
     ArgumentValidator.ThrowIfNull("contentMailboxPrincipal", contentMailboxPrincipal);
     return(PublicFolderSyncJobRpc.SyncFolder(contentMailboxPrincipal.MailboxInfo.OrganizationId, contentMailboxPrincipal.MailboxInfo.MailboxGuid, contentMailboxPrincipal.MailboxInfo.Location.ServerFqdn, folderId));
 }