示例#1
0
 public Synchronizer(TeamMailboxSyncJob job, MailboxSession mailboxSession, IResourceMonitor resourceMonitor, string siteUrl, ICredentials credential, bool isOAuthCredential, bool enableHttpDebugProxy, Stream syncCycleLogStream)
 {
     if (mailboxSession == null)
     {
         throw new ArgumentNullException("mailboxSession");
     }
     if (resourceMonitor == null)
     {
         throw new ArgumentNullException("resourceMonitor");
     }
     if (string.IsNullOrEmpty(siteUrl))
     {
         throw new ArgumentNullException("siteUrl");
     }
     try
     {
         this.siteUri = new Uri(siteUrl);
     }
     catch (UriFormatException innerException)
     {
         throw new ArgumentException(string.Format("Invalid format for siteUrl: {0}", siteUrl), innerException);
     }
     if (!this.siteUri.IsAbsoluteUri)
     {
         throw new ArgumentException(string.Format("Expect siteUrl: {0} to be absolute Uri", siteUrl));
     }
     this.mailboxSession       = mailboxSession;
     this.Job                  = job;
     this.credential           = credential;
     this.isOAuthCredential    = isOAuthCredential;
     this.resourceMonitor      = resourceMonitor;
     this.enableHttpDebugProxy = enableHttpDebugProxy;
     this.loggingContext       = new LoggingContext(this.mailboxSession.MailboxGuid, this.siteUri.ToString(), (job != null) ? job.ClientString : string.Empty, syncCycleLogStream);
 }
 public MaintenanceSynchronizer(TeamMailboxSyncJob job, MailboxSession mailboxSession, OrganizationId orgId, Uri webCollectionUrl, Guid webId, string siteUrl, string displayName, IResourceMonitor resourceMonitor, ICredentials credential, bool isOAuthCredential, bool enableHttpDebugProxy, Stream syncCycleLogStream) : base(job, mailboxSession, resourceMonitor, siteUrl, credential, isOAuthCredential, enableHttpDebugProxy, syncCycleLogStream)
 {
     if (orgId == null)
     {
         throw new ArgumentNullException("orgId");
     }
     this.orgId            = orgId;
     this.webCollectionUrl = webCollectionUrl;
     this.webId            = webId;
     this.recordedSiteUrl  = (string.IsNullOrEmpty(siteUrl) ? null : new Uri(siteUrl));
     this.displayName      = displayName;
     this.loggingComponent = ProtocolLog.Component.Maintenance;
 }
示例#3
0
 public MembershipSynchronizer(TeamMailboxSyncJob job, MailboxSession mailboxSession, OrganizationId orgId, ITeamMailboxSecurityRefresher teamMailboxSecurityRefresher, IResourceMonitor resourceMonitor, string siteUrl, ICredentials credential, bool isOAuthCredential, bool enableHttpDebugProxy, Stream syncCycleLogStream) : base(job, mailboxSession, resourceMonitor, siteUrl, credential, isOAuthCredential, enableHttpDebugProxy, syncCycleLogStream)
 {
     if (teamMailboxSecurityRefresher == null)
     {
         throw new ArgumentNullException("teamMailboxSecurityRefresher");
     }
     if (orgId == null)
     {
         throw new ArgumentNullException("orgId");
     }
     this.orgId = orgId;
     this.teamMailboxSecurityRefresher = teamMailboxSecurityRefresher;
     this.workLoadSize     = 20;
     this.loggingComponent = ProtocolLog.Component.MembershipSync;
 }
示例#4
0
        public override void OnJobCompletion(Job job)
        {
            TeamMailboxSyncJob teamMailboxSyncJob = job as TeamMailboxSyncJob;

            lock (this.syncObject)
            {
                teamMailboxSyncJob.SyncInfoEntry.IsPending                = false;
                teamMailboxSyncJob.SyncInfoEntry.PendingClientString      = null;
                teamMailboxSyncJob.SyncInfoEntry.PendingClientRequestTime = ExDateTime.MinValue;
                teamMailboxSyncJob.SyncInfoEntry.LastSyncUtcTime          = ExDateTime.UtcNow;
                teamMailboxSyncJob.SyncInfoEntry.NextAllowedSyncUtcTime   = ExDateTime.UtcNow + ((TeamMailboxSyncConfiguration)this.config).MinSyncInterval;
                if (teamMailboxSyncJob.LastError != null)
                {
                    teamMailboxSyncJob.SyncInfoEntry.SyncErrors[teamMailboxSyncJob.SyncInfoEntry.LastSyncUtcTime] = teamMailboxSyncJob.LastError;
                }
                base.OnJobCompletion(job);
            }
        }