public /* public for test */ InstanceDiscoveryManager( IHttpManager httpManager, IMatsTelemetryManager telemetryManager, bool shouldClearCaches, IUserMetadataProvider userMetadataProvider = null, Uri userProvidedInstanceDiscoveryUri = null, IKnownMetadataProvider knownMetadataProvider = null, INetworkCacheMetadataProvider networkCacheMetadataProvider = null, INetworkMetadataProvider networkMetadataProvider = null) { _httpManager = httpManager ?? throw new ArgumentNullException(nameof(httpManager)); _telemetryManager = telemetryManager ?? throw new ArgumentNullException(nameof(telemetryManager)); _userMetadataProvider = userMetadataProvider; _knownMetadataProvider = knownMetadataProvider ?? new KnownMetadataProvider(); _networkCacheMetadataProvider = networkCacheMetadataProvider ?? new NetworkCacheMetadataProvider(); _networkMetadataProvider = networkMetadataProvider ?? new NetworkMetadataProvider( _httpManager, _telemetryManager, _networkCacheMetadataProvider, userProvidedInstanceDiscoveryUri); if (shouldClearCaches) { _networkCacheMetadataProvider.Clear(); } }
public TelemetryHelper( IMatsTelemetryManager telemetryManager, IHttpTelemetryManager httpTelemetryManager, EventBase eventBase) { _telemetryManager = telemetryManager; _httpTelemetryManager = httpTelemetryManager; _eventToEnd = eventBase; _telemetryManager?.StartEvent(eventBase); }
private readonly Uri _userProvidedInstanceDiscoveryUri; // can be null public NetworkMetadataProvider( IHttpManager httpManager, IMatsTelemetryManager telemetryManager, INetworkCacheMetadataProvider networkCacheMetadataProvider, Uri userProvidedInstanceDiscoveryUri = null) { _httpManager = httpManager ?? throw new ArgumentNullException(nameof(httpManager)); _telemetryManager = telemetryManager ?? throw new ArgumentNullException(nameof(telemetryManager)); _networkCacheMetadataProvider = networkCacheMetadataProvider ?? throw new ArgumentNullException(nameof(networkCacheMetadataProvider)); _userProvidedInstanceDiscoveryUri = userProvidedInstanceDiscoveryUri; // can be null }
public InstanceDiscoveryManager( IHttpManager httpManager, IMatsTelemetryManager telemetryManager, bool /* for test */ shouldClearCaches, InstanceDiscoveryResponse userProvidedInstanceDiscoveryResponse = null, Uri userProvidedInstanceDiscoveryUri = null) : this( httpManager, telemetryManager, shouldClearCaches, userProvidedInstanceDiscoveryResponse != null ? new UserMetadataProvider(userProvidedInstanceDiscoveryResponse) : null, userProvidedInstanceDiscoveryUri, null, null, null) { }
public OAuth2Client(ICoreLogger logger, IHttpManager httpManager, IMatsTelemetryManager telemetryManager) { _headers = new Dictionary <string, string>(MsalIdHelper.GetMsalIdParameters(logger)); _httpManager = httpManager ?? throw new ArgumentNullException(nameof(httpManager)); }