private static void InitializeIfNeeded() { if (!FederationTrustCache.IsInitialized()) { lock (FederationTrustCache.locker) { if (!FederationTrustCache.IsInitialized()) { FederationTrustCache.timeout = DateTime.UtcNow + FederationTrustCache.ExpirationTime; try { FederationTrustCache.LoadFederationTrust(); FederationTrustCache.SubscribeForNotifications(); } catch (LocalizedException arg) { FederationTrustCache.Tracer.TraceError <LocalizedException>(0L, "FederationTrustCache: Unable to initialize due exception: {0}", arg); } if (FederationTrustCache.notification != null) { FederationTrustCache.timeout = DateTime.MaxValue; } FederationTrustCache.initialized = true; } } } }
private static void NotificationHandler(ADNotificationEventArgs args) { FederationTrustCache.Tracer.TraceDebug(0L, "FederationTrustCache: changes detected in configuration in AD."); try { FederationTrustCache.LoadFederationTrust(); } catch (LocalizedException arg) { FederationTrustCache.Tracer.TraceError <LocalizedException>(0L, "FederationTrustCache: failed to read federation trust from AD due exception: {0}", arg); return; } if (FederationTrustCache.Change != null) { FederationTrustCache.Tracer.TraceDebug(0L, "FederationTrustCache: notifying subscribers of change."); FederationTrustCache.Change(); } }
internal static void Initialize() { FederationTrustCache.LoadFederationTrust(); }