Beispiel #1
0
        public static BlobServiceClient CreateClient(string connectionString, System.Net.Http.IHttpClientFactory http = null)
        {
            var clientOptions = new BlobClientOptions
            {
                // notes: no options for this in new API,  there is GeoRedundantSecondaryUri, but we do not have second URI
                // LocationMode = LocationMode.PrimaryThenSecondary,
                // notes: next hash check is not recreated, either is is buildint or should be done manually
                // DisableContentMD5Validation = false, // controls whether or not the Storage Client will validate that MD5 hash on download
                Diagnostics = { IsDistributedTracingEnabled = true, IsLoggingEnabled = true },
                Retry       =
                {
                    NetworkTimeout = TimeSpan.FromSeconds(120),
                    Delay          = TimeSpan.FromSeconds(2),
                    MaxDelay       = TimeSpan.FromSeconds(20),
                    Mode           = RetryMode.Exponential
                },
            };

            if (http != null)
            {
                var client = http.CreateClient("Blob");
                client.Timeout          = TimeSpan.FromSeconds(720);
                clientOptions.Transport = new HttpClientTransport(client);
            }

            // is on per HTTP call basis, not per blob
            // clientOptions.AddPolicy(new HttpPipelinePolicy(), HttpPipelinePosition.PerCall)
            return(new BlobServiceClient(connectionString, clientOptions));
        }
Beispiel #2
0
 public ClaimsProxy(IContainerResolve container, IAppSettings appSettings, Config config, IHttpClientFactory httpClientFactory)
 {
     _container         = container;
     _httpClientFactory = httpClientFactory;
     _applicationName   = config?.ApplicationName ?? "Unknow";
     // read information to call the backend service from configuration.
     _url            = appSettings.Values.ContainsKey("arc4u_ClaimsProxyUri") ? appSettings.Values["arc4u_ClaimsProxyUri"] : null;
     _jsonSerializer = new DataContractJsonSerializer(typeof(IEnumerable <ClaimDto>));
 }
Beispiel #3
0
 public ReactModel(
     Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor,
     Microsoft.Extensions.Logging.ILogger <ReactModel> logger,
     Microsoft.AspNetCore.Hosting.IHostingEnvironment env,
     System.Net.Http.IHttpClientFactory httpClientFactory,
     Microsoft.Extensions.Options.IOptions <Web.App.Hypernova.HypernovaSettings> options
     )
 {
     BaseUrl         = $"{httpContextAccessor.HttpContext.Request.Scheme}://{httpContextAccessor.HttpContext.Request.Host}";
     hypernovaClient = new Web.App.Hypernova.HypernovaClient(logger, env, httpClientFactory, options, BaseUrl);
 }
Beispiel #4
0
 public XmlProductService(
     ILogger logger,
     ISettingsService settingsService,
     IConnectionProvider connectionProvider,
     IRegionTagReplaceService regionTagReplaceService,
     IOptions <LoaderProperties> loaderProperties,
     IHttpClientFactory factory
     )
 {
     _logger                  = logger;
     _settingsService         = settingsService;
     _regionTagReplaceService = regionTagReplaceService;
     _customer                = connectionProvider.GetCustomer();
     _loaderProperties        = loaderProperties.Value;
     _factory                 = factory;
 }
        public JsonProductService(
            IConnectionProvider connectionProvider,
            ILogger logger,
            ContentService contentService,
            FieldService fieldService,
            VirtualFieldContextService virtualFieldContextService,
            IRegionTagReplaceService regionTagReplaceService,
            IOptions<LoaderProperties> loaderProperties,
            IHttpClientFactory factory            
            )
        {
            _logger = logger;
            _contentService = contentService;
            _fieldService = fieldService;

            var customer = connectionProvider.GetCustomer();
            _dbConnector = new DBConnector(customer.ConnectionString, customer.DatabaseType);

            _virtualFieldContextService = virtualFieldContextService;
            _regionTagReplaceService = regionTagReplaceService;
            _loaderProperties = loaderProperties.Value;
            _factory = factory;
        }
Beispiel #6
0
 public UserViewModel(System.Net.Http.IHttpClientFactory httpClientFactory, Admin.IAdminViewModel adminViewModel) : base(httpClientFactory)
 {
     this.adminViewModel = adminViewModel;
 }
 public static System.Net.Http.HttpClient CreateClient(this System.Net.Http.IHttpClientFactory factory)
 {
     throw null;
 }
Beispiel #8
0
 public GetUser(IHttpClientFactory httpClientFactory, IGremlinClient gremlinClient, IB2CGraphClient b2cGraphClient, TelemetryConfiguration telemetryConfiguration) : base(httpClientFactory, gremlinClient, b2cGraphClient, telemetryConfiguration)
 {
     // Calls base
 }
Beispiel #9
0
 public MediaViewModel(System.Net.Http.IHttpClientFactory httpClientFactory, User.IUserViewModel userViewModel) : base(httpClientFactory)
 {
     this.userViewModel = userViewModel;
 }
Beispiel #10
0
 public AdminViewModel(System.Net.Http.IHttpClientFactory httpClientFactory) : base(httpClientFactory)
 {
 }
 public UserServiceBase(IHttpClientFactory httpClientFactory, IGremlinClient gremlinClient, IB2CGraphClient b2cGraphClient, TelemetryConfiguration telemetryConfiguration)
 {
     TelemetryClient = new TelemetryClient(telemetryConfiguration);
     GremlinClient   = gremlinClient;
     B2CGraphClient  = b2cGraphClient;
 }