Example #1
0
 public static EdgeSyncAppConfig Load()
 {
     if (EdgeSyncAppConfig.instance == null)
     {
         lock (EdgeSyncAppConfig.initializationLock)
         {
             if (EdgeSyncAppConfig.instance == null)
             {
                 EdgeSyncAppConfig edgeSyncAppConfig = new EdgeSyncAppConfig();
                 edgeSyncAppConfig.delayStart       = edgeSyncAppConfig.GetConfigTimeSpan("DelayStart", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.MinValue);
                 edgeSyncAppConfig.enabledSyncType  = (SyncTreeType)edgeSyncAppConfig.GetConfigEnum("EnabledSyncType", typeof(SyncTreeType), SyncTreeType.Configuration | SyncTreeType.Recipients);
                 edgeSyncAppConfig.delayLdapEnabled = edgeSyncAppConfig.GetConfigBool("DelayLdapEnabled", false);
                 if (edgeSyncAppConfig.delayLdapEnabled)
                 {
                     edgeSyncAppConfig.delayLdapSearchRequest = edgeSyncAppConfig.GetConfigTimeSpan("DelayLdapSearchRequest", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.MinValue);
                     edgeSyncAppConfig.delayLdapUpdateRequest = edgeSyncAppConfig.GetConfigTimeSpan("DelayLdapUpdateRequest", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.MinValue);
                     edgeSyncAppConfig.delayLdapUpdateRequestContainingString = edgeSyncAppConfig.GetConfigString("DelayLdapUpdateRequestContainingString", string.Empty);
                 }
                 edgeSyncAppConfig.tenantSyncControlCacheSize            = edgeSyncAppConfig.GetConfigLong("TenantSyncControlCacheSize", 1024L, 1073741824L, 36700160L);
                 edgeSyncAppConfig.tenantSyncControlCacheExpiryInterval  = edgeSyncAppConfig.GetConfigTimeSpan("TenantSyncControlCacheExpiryInterval", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.FromHours(4.0));
                 edgeSyncAppConfig.tenantSyncControlCacheCleanupInterval = edgeSyncAppConfig.GetConfigTimeSpan("TenantSyncControlCacheCleanupInterval", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.FromMinutes(15.0));
                 edgeSyncAppConfig.tenantSyncControlCachePurgeInterval   = edgeSyncAppConfig.GetConfigTimeSpan("TenantSyncControlCachePurgeInterval", TimeSpan.FromSeconds(1.0), TimeSpan.MaxValue, TimeSpan.FromMinutes(5.0));
                 edgeSyncAppConfig.trackDuplicatedAddEntries             = edgeSyncAppConfig.GetConfigBool("TrackDuplicatedAddEntries", true);
                 edgeSyncAppConfig.duplicatedAddEntriesCacheSize         = edgeSyncAppConfig.GetConfigInt("DuplicatedAddEntriesCacheSize", 1, int.MaxValue, 1500);
                 edgeSyncAppConfig.podSiteStartRange           = edgeSyncAppConfig.GetConfigInt("PodSiteStartRange", 0, int.MaxValue, 50000);
                 edgeSyncAppConfig.podSiteEndRange             = edgeSyncAppConfig.GetConfigInt("PodSiteEndRange", 0, int.MaxValue, 59999);
                 edgeSyncAppConfig.synchronizationProviderList = edgeSyncAppConfig.LoadSynchronizationProviders();
                 Thread.MemoryBarrier();
                 EdgeSyncAppConfig.instance = edgeSyncAppConfig;
             }
         }
     }
     return(EdgeSyncAppConfig.instance);
 }
Example #2
0
 public Connection(PooledLdapConnection connection, EdgeSyncAppConfig appConfig)
 {
     if (appConfig == null)
     {
         throw new ArgumentNullException("appConfig");
     }
     this.connection = connection;
     this.appConfig  = appConfig;
 }