public DefaultGrpcClientFactory(IServiceProvider serviceProvider, GrpcCallInvokerFactory callInvokerFactory, IOptionsMonitor <GrpcClientFactoryOptions> clientFactoryOptionsMonitor, IHttpMessageHandlerFactory messageHandlerFactory) { _serviceProvider = serviceProvider; _callInvokerFactory = callInvokerFactory; _clientFactoryOptionsMonitor = clientFactoryOptionsMonitor; _messageHandlerFactory = messageHandlerFactory; }
protected GetARideServiceBaseGateway(IHttpMessageHandlerFactory httpMessageHandlerFactory, GatewayConfiguration gatewayConfiguration) { var httpMessageHandler = httpMessageHandlerFactory.CreateHttpMessageHandler(); HttpClient = new HttpClient(httpMessageHandler); AuthenticationUrl = gatewayConfiguration.AuthenticationUrl; ApiUrl = gatewayConfiguration.ApiUrl; ClientId = gatewayConfiguration.ClientID; ClientSecret = gatewayConfiguration.ClientSecret; }
public HelloService(IHttpMessageHandlerFactory factory, ILogger <HelloService> logger, IOptionsMonitor <HelloServiceOptions> options) { _logger = logger; _client = new Hello_PortTypeClient(); _client.Endpoint.EndpointBehaviors.Add(new HttpMessageHandlerBehavior(factory, ServiceName)); _client.Endpoint.Address = new EndpointAddress(options.CurrentValue.EndpointAddress); _client.Endpoint.Binding.CloseTimeout = TimeSpan.FromSeconds(options.CurrentValue.TimeoutSeconds); _client.Endpoint.Binding.OpenTimeout = TimeSpan.FromSeconds(options.CurrentValue.TimeoutSeconds); _client.Endpoint.Binding.ReceiveTimeout = TimeSpan.FromSeconds(options.CurrentValue.TimeoutSeconds); _client.Endpoint.Binding.SendTimeout = TimeSpan.FromSeconds(options.CurrentValue.TimeoutSeconds); }
//Temp fix: Remove after 01-01-2016; IHttpMessageHandlerFactory is registered in the DI. //The DI needs to be upgraded for the registeration. below code prevent a runtime error in case that the DI is not upgraded. public BaseProvider(IProvidersCommonServices commonServices) { if (commonServices == null) { throw new ArgumentNullException("commonServices"); } Logger = commonServices.Logger; _httpMessageHandlerFactory = new DefaultHttpMessageHandlerFactory(); _publicationResolver = commonServices.PublicationResolver; Configuration = commonServices.Configuration; }
private RaftHttpCluster(IOptionsMonitor <RaftClusterMemberConfiguration> config, IServiceProvider dependencies, out MutableMemberCollection members) : this(config.CurrentValue, out members) { configurator = dependencies.GetService <IRaftClusterConfigurator>(); messageHandler = dependencies.GetService <IMessageHandler>(); AuditTrail = dependencies.GetService <IPersistentState>(); hostingAddresses = dependencies.GetRequiredService <IServer>().GetHostingAddresses; httpHandlerFactory = dependencies.GetService <IHttpMessageHandlerFactory>(); var loggerFactory = dependencies.GetRequiredService <ILoggerFactory>(); Logger = loggerFactory.CreateLogger(GetType()); //track changes in configuration configurationTracker = config.OnChange(ConfigurationChanged); }
public GrpcCallInvokerFactory( IServiceScopeFactory scopeFactory, ILoggerFactory loggerFactory, IOptionsMonitor <GrpcClientFactoryOptions> grpcClientFactoryOptionsMonitor, IOptionsMonitor <HttpClientFactoryOptions> httpClientFactoryOptionsMonitor, IHttpMessageHandlerFactory messageHandlerFactory) { if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); } _loggerFactory = loggerFactory; _grpcClientFactoryOptionsMonitor = grpcClientFactoryOptionsMonitor; _httpClientFactoryOptionsMonitor = httpClientFactoryOptionsMonitor; _messageHandlerFactory = messageHandlerFactory; _scopeFactory = scopeFactory; _activeChannels = new ConcurrentDictionary <EntryKey, CallInvoker>(); _invokerFactory = CreateInvoker; }
internal AuthenticationHttpClient(IHttpMessageHandlerFactory httpMessageHandlerFactory, string name) : this(new AuthenticationHttpMessageHandler(httpMessageHandlerFactory.CreateHandler(name))) { }
internal OAuthAuthenticated(IHttpMessageHandlerFactory httpMessageHandlerFactory, string oauthToken, HashSet <TwitchConstants.TwitchOAuthScopes> scopes) : this(new HttpClient(httpMessageHandlerFactory.CreateHandler()), oauthToken, scopes) { }
public AuthenticationHttpClient(IHttpMessageHandlerFactory httpMessageHandlerFactory) : this(new AuthenticationHttpMessageHandler(httpMessageHandlerFactory.CreateHandler())) { }
public TridionBinaryProvider(IProvidersCommonServices commonServices, IHttpMessageHandlerFactory httpClientFactory) :base(commonServices, httpClientFactory) { }
IAuthenticationBuilder IAuthenticationBuilder.UseHttpMessageHandlerFactory(IHttpMessageHandlerFactory messageHandlerFactory) => UseHttpMessageHandlerFactory(messageHandlerFactory);
/// <summary> /// Initializes a new instance of the <see cref="DefaultRemoteTargetActionsFactory"/> class. /// </summary> /// <param name="context">The WebDAV request context</param> /// <param name="httpMessageHandlerFactory">The factory for <see cref="HttpClient"/> instances</param> public DefaultRemoteTargetActionsFactory(IWebDavContext context, IHttpMessageHandlerFactory httpMessageHandlerFactory) { _context = context; _httpMessageHandlerFactory = httpMessageHandlerFactory; }
public OrderService(IHttpMessageHandlerFactory messageHandlerFactory) : base(messageHandlerFactory) { }
public CustomEndpointBehavior(IHttpMessageHandlerFactory factory) { factory.CreateHandler(); _httpHandler = () => factory.CreateHandler(); }
public EventsService(IHttpMessageHandlerFactory messageHandlerFactory) : base(messageHandlerFactory) { }
public CreditCheckFilter(IHttpMessageHandlerFactory httpMessageHandlerFactory, ILogger logger) { this.httpMessageHandlerFactory = httpMessageHandlerFactory; this.logger = logger; }
public TridionComponentPresentationProvider(IProvidersCommonServices commonServices, IHttpMessageHandlerFactory httpClientFactory) : base(commonServices, httpClientFactory) { }
public MegaRetryFilter(IHttpMessageHandlerFactory messageHandlerFactory = null, int retriesCount = 5) : base(messageHandlerFactory, retriesCount) { }
/// <summary> /// Creates a new <see cref="HttpMessageHandler"/> using the default configuration. /// </summary> /// <param name="factory">The <see cref="IHttpMessageHandlerFactory"/>.</param> /// <returns>An <see cref="HttpMessageHandler"/> configured using the default configuration.</returns> public static HttpMessageHandler CreateHandler(this IHttpMessageHandlerFactory factory !!) { return(factory.CreateHandler(Options.DefaultName));
public DefaultHttpClientFactory(IHttpMessageHandlerFactory httpMessageHandlerFactory) { _httpMessageHandlerFactory = Check.NotNull(httpMessageHandlerFactory, nameof(httpMessageHandlerFactory)); }
public GeolocatorMapquest(IHttpMessageHandlerFactory httpMessageHandlerFactory, ConfigurationProviderMapquest configuration) : base(httpMessageHandlerFactory) { _gatewayConfiguration = configuration.GetGatewayConfiguration(); }
public GetARideServiceLyftGateway(IHttpMessageHandlerFactory httpMessageHandlerFactory, GatewayConfiguration gatewayConfiguration) : base(httpMessageHandlerFactory, gatewayConfiguration) { }
protected GeolocatorBase(IHttpMessageHandlerFactory httpMessageHandlerFactory) { var httpMessageHander = httpMessageHandlerFactory.CreateHttpMessageHandler(); _httpClient = new HttpClient(httpMessageHander); }
/// <summary> /// Creates a new <see cref="HttpMessageHandler"/> using the default configuration. /// </summary> /// <param name="factory">The <see cref="IHttpMessageHandlerFactory"/>.</param> /// <returns>An <see cref="HttpMessageHandler"/> configured using the default configuration.</returns> public static HttpMessageHandler CreateHandler(this IHttpMessageHandlerFactory factory) { ThrowHelper.ThrowIfNull(factory); return(factory.CreateHandler(Options.DefaultName)); }
public StaticHttpClientFactory(IHttpMessageHandlerFactory handlerFactory) { _handlerFactory = handlerFactory; }
protected RideSharingBase(IHttpMessageHandlerFactory httpMessageHandlerFactory) { var httpMessageHandler = httpMessageHandlerFactory.CreateHttpMessageHandler(); _httpClient = new HttpClient(httpMessageHandler); }
public TridionBinaryProvider(IProvidersCommonServices commonServices, IHttpMessageHandlerFactory httpClientFactory) : base(commonServices, httpClientFactory) { }
public WcfClientFactory(IHttpMessageHandlerFactory httpMessageHandlerFactory) { _httpMessageHandlerFactory = httpMessageHandlerFactory ?? throw new ArgumentNullException(nameof(httpMessageHandlerFactory)); }
public ServiceBase(IHttpMessageHandlerFactory messageHandlerFactory) { MessageHandlerFactory = messageHandlerFactory; CurrentHttpClient = new HttpClient(MessageHandlerFactory.GetHttpMessageHandler()); CurrentHttpClient.DefaultRequestHeaders.Add("x-functions-key", apiKey); }
public ProductService(IHttpMessageHandlerFactory messageHandlerFactory) : base(messageHandlerFactory) { }
public IBotAuthenticationBuilder UseHttpMessageHandlerFactory(IHttpMessageHandlerFactory messageHandlerFactory) { HttpMessageHandlerFactory = messageHandlerFactory; return(this); }
public RideSharingLyft(IHttpMessageHandlerFactory httpMessageHandlerFactory, ConfigurationProviderLyft configurationProvider, LyftToGetARyderTransformer lyftToGetARyderTransformer) : base(httpMessageHandlerFactory) { this._lyftGatewayConfiguration = configurationProvider.GetGatewayConfiguration(); this._lyftToGetARydertransformer = lyftToGetARyderTransformer; }