Ejemplo n.º 1
0
 public DataProviders(DataSourcesConfiguration configuration)
 {
     Kusto       = new DataProviderLogDecorator(new KustoDataProvider(_cache, configuration.KustoConfiguration));
     Observer    = new DataProviderLogDecorator(SupportObserverDataProviderFactory.GetDataProvider(_cache, configuration));
     GeoMaster   = new DataProviderLogDecorator(new GeoMasterDataProvider(_cache, configuration.GeoMasterConfiguration));
     AppInsights = new DataProviderLogDecorator(new AppInsightsDataProvider(_cache, configuration.AppInsightsConfiguration));
 }
 public DataProviderContext(DataSourcesConfiguration dataSourceConfiguration, string requestId = null, CancellationToken dataSourceCancellationToken = default(CancellationToken), DateTime queryStartTime = default(DateTime), DateTime queryEndTime = default(DateTime), IWawsObserverTokenService wawsObserverTokenService = null, ISupportBayApiObserverTokenService supportBayApiObserverTokenService = null, string objectId = "", string principalName = "", IKustoHeartBeatService kustoHeartBeatService = null, string geoMasterHostName = null, string geomasterName = null, string cloudDomain = null, IHeaderDictionary incomingHeaders = null)
 {
     Configuration = dataSourceConfiguration;
     RequestId     = requestId ?? Guid.NewGuid().ToString();
     DataSourcesCancellationToken = dataSourceCancellationToken;
     clientObjectId                    = objectId;
     clientPrincipalName               = principalName;
     QueryStartTime                    = queryStartTime;
     QueryEndTime                      = queryEndTime;
     WawsObserverTokenService          = wawsObserverTokenService;
     SupportBayApiObserverTokenService = supportBayApiObserverTokenService;
     KustoHeartBeatService             = kustoHeartBeatService;
     GeomasterHostName                 = geoMasterHostName;
     GeomasterName                     = geomasterName;
     CloudDomain     = cloudDomain;
     receivedHeaders = incomingHeaders;
 }
        public DataSourcesConfiguration LoadConfigurations()
        {
            var dataSourcesConfiguration = new DataSourcesConfiguration();
            var configurationProperties  = dataSourcesConfiguration.GetType().GetProperties()
                                           .Where(property => {
                return(property.PropertyType.GetInterfaces().Contains(typeof(IDataProviderConfiguration)));
            });

            foreach (var configProperty in configurationProperties)
            {
                var instance = Activator.CreateInstance(configProperty.PropertyType) as IDataProviderConfiguration;
                LoadConfigurationValues(instance);
                instance.PostInitialize();
                configProperty.SetValue(dataSourcesConfiguration, instance, null);
            }

            return(dataSourcesConfiguration);
        }
Ejemplo n.º 4
0
 public static ISupportObserverDataProvider GetDataProvider(OperationDataCache cache, DataSourcesConfiguration configuration)
 {
     if (configuration.SupportObserverConfiguration.IsMockConfigured)
     {
         return(new MockSupportObserverDataProvider(cache, configuration.SupportObserverConfiguration));
     }
     else
     {
         return(new SupportObserverDataProvider(cache, configuration.SupportObserverConfiguration));
     }
 }
Ejemplo n.º 5
0
 public DataProviderContext(DataSourcesConfiguration dataSourceConfiguration, CancellationToken dataSourceCancellationToken = default(CancellationToken), string requestId = null)
 {
     Configuration = dataSourceConfiguration;
     RequestId     = requestId;
     DataSourcesCancellationToken = dataSourceCancellationToken;
 }
 public DataProviderContext(DataSourcesConfiguration dataSourceConfiguration, string requestId = null, CancellationToken dataSourceCancellationToken = default(CancellationToken))
 {
     Configuration = dataSourceConfiguration;
     RequestId     = requestId ?? Guid.NewGuid().ToString();
     DataSourcesCancellationToken = dataSourceCancellationToken;
 }