public GeoMasterDataProvider(OperationDataCache cache, DataProviderContext context) : base(cache)
 {
     _geoMasterHostName = string.IsNullOrWhiteSpace(context.GeomasterHostName) ? context.Configuration.GeoMasterConfiguration.GeoEndpointAddress : context.GeomasterHostName;
     _configuration     = context.Configuration.GeoMasterConfiguration;
     _geoMasterClient   = InitClient();
     GeoMasterName      = string.IsNullOrWhiteSpace(context.GeomasterName) ? ParseGeoMasterName(_geoMasterHostName) : context.GeomasterName;
 }
 public DataProviders(DataProviderContext context)
 {
     Kusto       = new DataProviderLogDecorator(context, new KustoDataProvider(_cache, context.Configuration.KustoConfiguration));
     Observer    = new DataProviderLogDecorator(context, SupportObserverDataProviderFactory.GetDataProvider(_cache, context.Configuration));
     GeoMaster   = new DataProviderLogDecorator(context, new GeoMasterDataProvider(_cache, context.Configuration.GeoMasterConfiguration));
     AppInsights = new DataProviderLogDecorator(context, new AppInsightsDataProvider(_cache, context.Configuration.AppInsightsConfiguration));
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AscDataProvider"/> class.
 /// </summary>
 /// <param name="cache">Operation Data Cache instance.</param>
 /// <param name="configuration">Configuration for calling into Azure Support Center.</param>
 /// <param name="requestId">AppLens request id.</param>
 public AscDataProvider(OperationDataCache cache, AscDataProviderConfiguration configuration, string requestId, DataProviderContext context)
     : base(cache)
 {
     dataProviderConfiguration = configuration;
     dataProviderRequestId     = requestId;
     ascClient             = new AscClient(configuration, dataProviderRequestId, context.receivedHeaders);
     CurrentRequestContext = context;
 }
 public SupportObserverDataProviderBase(OperationDataCache cache, SupportObserverDataProviderConfiguration configuration, DataProviderContext dataProviderContext) : base(cache)
 {
     Configuration       = configuration;
     RequestId           = dataProviderContext.RequestId;
     DataProviderContext = dataProviderContext;
     Logger                  = DiagnosticsETWProvider.Instance;
     _httpClient             = GetObserverClient();
     _httpClient.BaseAddress = new Uri($"{configuration.Endpoint}/api/");
     _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="DataProviders" /> class.
        /// </summary>
        /// <param name="context">Data provider context</param>
        public DataProviders(DataProviderContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            Kusto       = new DataProviderLogDecorator(context, new KustoDataProvider(_cache, context.Configuration.KustoConfiguration, context.RequestId));
            Observer    = new DataProviderLogDecorator(context, SupportObserverDataProviderFactory.GetDataProvider(_cache, context.Configuration));
            GeoMaster   = new DataProviderLogDecorator(context, new GeoMasterDataProvider(_cache, context.Configuration.GeoMasterConfiguration));
            AppInsights = new DataProviderLogDecorator(context, new AppInsightsDataProvider(_cache, context.Configuration.AppInsightsConfiguration));
            Mdm         = new DataProviderLogDecorator(context, new MdmDataProvider(_cache, context.Configuration.MdmConfiguration, context.RequestId));
        }
        public DataProviders(DataProviderContext context)
        {
            Kusto          = new KustoLogDecorator(context, new KustoDataProvider(_cache, context.Configuration.KustoConfiguration, context.RequestId, context.KustoHeartBeatService));
            Observer       = new ObserverLogDecorator(context, SupportObserverDataProviderFactory.GetDataProvider(_cache, context.Configuration, context));
            GeoMaster      = new GeoMasterLogDecorator(context, new GeoMasterDataProvider(_cache, context));
            AppInsights    = new AppInsightsLogDecorator(context, new AppInsightsDataProvider(_cache, context.Configuration.AppInsightsConfiguration));
            ChangeAnalysis = new ChangeAnalysisLogDecorator(context, new ChangeAnalysisDataProvider(_cache, context.Configuration.ChangeAnalysisDataProviderConfiguration, context.RequestId, context.clientObjectId, context.clientPrincipalName, Kusto, context.receivedHeaders));
            Asc            = new AscLogDecorator(context, new AscDataProvider(_cache, context.Configuration.AscDataProviderConfiguration, context.RequestId));
            Mdm            = (MdmDataSource ds) =>
            {
                switch (ds)
                {
                case MdmDataSource.Antares:
                    return(new MdmLogDecorator(context, new MdmDataProvider(_cache, context.Configuration.AntaresMdmConfiguration, context.RequestId)));

                case MdmDataSource.Networking:
                    return(new MdmLogDecorator(context, new MdmDataProvider(_cache, context.Configuration.NetworkingMdmConfiguration, context.RequestId)));

                default:
                    throw new NotSupportedException($"{ds} is not supported.");
                }
            };
        }
Exemple #7
0
 public MdmLogDecorator(DataProviderContext context, IMdmDataProvider dataProvider) : base(context, dataProvider.GetMetadata())
 {
     DataProvider = dataProvider;
 }
Exemple #8
0
 public DataProviderLogDecorator(DataProviderContext context, IKustoDataProvider dataProvider) : this(context, dataProvider.GetMetadata())
 {
     _kustoDataProvider = dataProvider;
 }
 public MockSupportObserverDataProvider(OperationDataCache cache, SupportObserverDataProviderConfiguration configuration, DataProviderContext dataProviderContext) : base(cache, configuration, dataProviderContext)
 {
 }
 public ObserverLogDecorator(DataProviderContext context, ISupportObserverDataProvider dataProvider) : base(context, dataProvider.GetMetadata())
 {
     DataProvider = dataProvider;
 }
 public AppInsightsLogDecorator(DataProviderContext context, IAppInsightsDataProvider dataProvider) : base(context, dataProvider.GetMetadata())
 {
     DataProvider = dataProvider;
 }
Exemple #12
0
 public GeoMasterLogDecorator(DataProviderContext context, IGeoMasterDataProvider dataProvider) : base(context, dataProvider.GetMetadata())
 {
     DataProvider = dataProvider;
 }
Exemple #13
0
 public DataProviderLogDecorator(DataProviderContext context, IGeoMasterDataProvider dataProvider) : this(context, dataProvider.GetMetadata())
 {
     _geomasterDataProvider = dataProvider;
 }
Exemple #14
0
 protected LogDecoratorBase(DataProviderContext context, DataProviderMetadata metaData)
 {
     _metadataProvider            = metaData;
     _requestId                   = context.RequestId;
     _dataSourceCancellationToken = context.DataSourcesCancellationToken;
 }
Exemple #15
0
 private DataProviderLogDecorator(DataProviderContext context, DataProviderMetadata metaData)
 {
     _currentMetadataProvider = metaData;
     _requestId = context.RequestId;
     _dataSoureCancellationToken = context.DataSourcesCancellationToken;
 }
Exemple #16
0
 public DataProviderLogDecorator(DataProviderContext context, IAppInsightsDataProvider dataProvider) : this(context, dataProvider.GetMetadata())
 {
     _appInsightsDataProvider = dataProvider;
 }
Exemple #17
0
 public DataProviderLogDecorator(DataProviderContext context, ISupportObserverDataProvider dataProvider) : this(context, dataProvider.GetMetadata())
 {
     _observerDataProvider = dataProvider;
 }
 public KustoLogDecorator(DataProviderContext context, IKustoDataProvider dataProvider) : base(context, dataProvider.GetMetadata())
 {
     DataProvider = dataProvider;
 }
 public ChangeAnalysisLogDecorator(DataProviderContext context, IChangeAnalysisDataProvider dataProvider) : base(context, dataProvider.GetMetadata())
 {
     DataProvider = dataProvider;
 }