예제 #1
0
        private static TimeSpan GetRequestTimeoutFromAppConfig()
        {
            TimeSpan lowerBound = TimeSpan.FromSeconds(1.0);
            TimeSpan upperBound = TimeSpan.FromMinutes(60.0);

            return(EhfSyncAppConfig.GetConfigTimeSpan("EhfRequestTimeout", lowerBound, upperBound, EhfSyncAppConfig.DefaultRequestTimeout));
        }
예제 #2
0
        private HashSet <Guid> GetNewState(EhfWellKnownGroup wellKnownGroup, HashSet <Guid> existingAdmins, bool updateState)
        {
            if (wellKnownGroup == null || !updateState)
            {
                return(null);
            }
            HashSet <Guid> hashSet = new HashSet <Guid>();

            this.AddToAdminSet <MailboxAdminSyncUser>(wellKnownGroup.GroupMembers, hashSet);
            this.AddToAdminSet <PartnerGroupAdminSyncUser>(wellKnownGroup.LinkedRoleGroups, hashSet);
            this.AddToAdminSet <AdminSyncUser>(wellKnownGroup.SubGroups, hashSet);
            if (existingAdmins != null && existingAdmins.Count == hashSet.Count && existingAdmins.IsSubsetOf(hashSet))
            {
                this.ehfTargetConnection.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "The admin-state for group <{0}> is up to date in PerimeterConfig. No need to overwrite the state.", new object[]
                {
                    wellKnownGroup.WellKnownGroupName
                });
                return(null);
            }
            EhfSyncAppConfig ehfSyncAppConfig = this.ehfTargetConnection.Config.EhfSyncAppConfig;

            if (hashSet.Count >= ehfSyncAppConfig.EhfAdminSyncMaxTargetAdminStateSize)
            {
                this.ehfTargetConnection.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Number of members (<{0}>) of group <{1}> is greater than or equal to the maximum number <{2}> we store in AD. An Empty Guid will be stored in the state indicating that the max limit has reached.", new object[]
                {
                    hashSet.Count,
                    wellKnownGroup.WellKnownGroupName,
                    ehfSyncAppConfig.EhfAdminSyncMaxTargetAdminStateSize
                });
                hashSet.Clear();
                hashSet.Add(EhfCompanyAdmins.SyncStateFullGuid);
            }
            return(hashSet);
        }
예제 #3
0
        private static TimeSpan GetEhfAdminSyncIntervalFromAppConfig()
        {
            TimeSpan lowerBound = TimeSpan.FromSeconds(1.0);
            TimeSpan maxValue   = TimeSpan.MaxValue;

            return(EhfSyncAppConfig.GetConfigTimeSpan("EhfAdminSyncInterval", lowerBound, maxValue, EhfSyncAppConfig.DefaultEhfAdminSyncInterval));
        }
        private void SetFullTenantAdminSyncIfTooManyCachedChanges()
        {
            EhfSyncAppConfig ehfSyncAppConfig = this.ehfTargetConnection.Config.EhfSyncAppConfig;

            if (this.groupChanges.Count + this.liveIdChanges.Count > ehfSyncAppConfig.EhfAdminSyncMaxAccumulatedChangeSize || this.deletedObjects.Count > ehfSyncAppConfig.EhfAdminSyncMaxAccumulatedDeleteChangeSize)
            {
                this.ehfTargetConnection.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Setting the tenant <{0}> for FullAdminSync since there are too many cached changes. GroupChanges:<{1}>; LiveidChanges:<{2}>; DeletedObject:<{3}>", new object[]
                {
                    this.tenantOU,
                    this.groupChanges.Count,
                    this.liveIdChanges.Count,
                    this.deletedObjects.Count
                });
                this.SetFullTenantAdminSyncRequired();
            }
        }
예제 #5
0
 private static int GetBatchSizeFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("EhfBatchSize", 1, 100, 20));
 }
예제 #6
0
 private static int GetMaxMessageSizeFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("EhfMaxMessageSize", 10240, 256000, 102400));
 }
예제 #7
0
 private static int GetEhfAdminSyncMaxAccumulatedDeleteChangeSizeFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("EhfAdminSyncMaxAccumulatedDeleteChangeSize", 0, int.MaxValue, 1000));
 }
예제 #8
0
 private static int GetAdminSyncMaxTargetAdminStateSizeFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("EhfAdminSyncMaxTargetAdminStateSize", 0, 400, 50));
 }
예제 #9
0
 private static int GetAdminSyncMaxFailureCountFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("EhfAdminSyncMaxFailureCount", 0, int.MaxValue, 10));
 }
예제 #10
0
 private static int GetAdminSyncTransientFailureRetryThresholdFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("EhfAdminSyncTransientFailureRetryThreshold", 0, int.MaxValue, 10));
 }
예제 #11
0
 private static int GetTransientExceptionRetryCountFromAppConfig()
 {
     return(EhfSyncAppConfig.GetConfigInt("TransientExceptionRetryCount", 0, 100, 3));
 }
예제 #12
0
 public void Initialize(EhfSyncAppConfig ehfSyncAppConfig)
 {
     this.ehfSyncAppConfig = ehfSyncAppConfig;
 }