コード例 #1
0
 public DefaultGrpcClientFactory(IServiceProvider serviceProvider,
                                 GrpcCallInvokerFactory callInvokerFactory,
                                 IOptionsMonitor <GrpcClientFactoryOptions> clientFactoryOptionsMonitor,
                                 IHttpMessageHandlerFactory messageHandlerFactory)
 {
     _serviceProvider             = serviceProvider;
     _callInvokerFactory          = callInvokerFactory;
     _clientFactoryOptionsMonitor = clientFactoryOptionsMonitor;
     _messageHandlerFactory       = messageHandlerFactory;
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        //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;
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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;
        }
コード例 #7
0
 internal AuthenticationHttpClient(IHttpMessageHandlerFactory httpMessageHandlerFactory, string name)
     : this(new AuthenticationHttpMessageHandler(httpMessageHandlerFactory.CreateHandler(name)))
 {
 }
コード例 #8
0
 internal OAuthAuthenticated(IHttpMessageHandlerFactory httpMessageHandlerFactory, string oauthToken, HashSet <TwitchConstants.TwitchOAuthScopes> scopes)
     : this(new HttpClient(httpMessageHandlerFactory.CreateHandler()), oauthToken, scopes)
 {
 }
コード例 #9
0
 public AuthenticationHttpClient(IHttpMessageHandlerFactory httpMessageHandlerFactory)
     : this(new AuthenticationHttpMessageHandler(httpMessageHandlerFactory.CreateHandler()))
 {
 }
コード例 #10
0
        public TridionBinaryProvider(IProvidersCommonServices commonServices, IHttpMessageHandlerFactory httpClientFactory)
            :base(commonServices, httpClientFactory)
        {

        }
コード例 #11
0
 IAuthenticationBuilder IAuthenticationBuilder.UseHttpMessageHandlerFactory(IHttpMessageHandlerFactory messageHandlerFactory) => UseHttpMessageHandlerFactory(messageHandlerFactory);
コード例 #12
0
 /// <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;
 }
コード例 #13
0
 public OrderService(IHttpMessageHandlerFactory messageHandlerFactory)
     : base(messageHandlerFactory)
 {
 }
コード例 #14
0
 public CustomEndpointBehavior(IHttpMessageHandlerFactory factory)
 {
     factory.CreateHandler();
     _httpHandler = () => factory.CreateHandler();
 }
コード例 #15
0
ファイル: EventService.cs プロジェクト: AlienArc/kcdnug
 public EventsService(IHttpMessageHandlerFactory messageHandlerFactory) : base(messageHandlerFactory)
 {
 }
コード例 #16
0
 public CreditCheckFilter(IHttpMessageHandlerFactory httpMessageHandlerFactory, ILogger logger)
 {
     this.httpMessageHandlerFactory = httpMessageHandlerFactory;
     this.logger = logger;
 }
        public TridionComponentPresentationProvider(IProvidersCommonServices commonServices, IHttpMessageHandlerFactory httpClientFactory)
            : base(commonServices, httpClientFactory)
        {

        }
コード例 #18
0
 public MegaRetryFilter(IHttpMessageHandlerFactory messageHandlerFactory = null, int retriesCount = 5)
     : base(messageHandlerFactory, retriesCount)
 {
 }
コード例 #19
0
 /// <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));
コード例 #20
0
 public DefaultHttpClientFactory(IHttpMessageHandlerFactory httpMessageHandlerFactory)
 {
     _httpMessageHandlerFactory = Check.NotNull(httpMessageHandlerFactory, nameof(httpMessageHandlerFactory));
 }
コード例 #21
0
 public GeolocatorMapquest(IHttpMessageHandlerFactory httpMessageHandlerFactory, ConfigurationProviderMapquest configuration)
     : base(httpMessageHandlerFactory)
 {
     _gatewayConfiguration = configuration.GetGatewayConfiguration();
 }
コード例 #22
0
 public GetARideServiceLyftGateway(IHttpMessageHandlerFactory httpMessageHandlerFactory, GatewayConfiguration gatewayConfiguration)
     : base(httpMessageHandlerFactory, gatewayConfiguration)
 {
 }
コード例 #23
0
ファイル: GeolocatorBase.cs プロジェクト: jefft22/get-a-ryder
        protected GeolocatorBase(IHttpMessageHandlerFactory httpMessageHandlerFactory)
        {
            var httpMessageHander = httpMessageHandlerFactory.CreateHttpMessageHandler();

            _httpClient = new HttpClient(httpMessageHander);
        }
コード例 #24
0
        /// <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));
        }
コード例 #25
0
 public StaticHttpClientFactory(IHttpMessageHandlerFactory handlerFactory)
 {
     _handlerFactory = handlerFactory;
 }
コード例 #26
0
        protected RideSharingBase(IHttpMessageHandlerFactory httpMessageHandlerFactory)
        {
            var httpMessageHandler = httpMessageHandlerFactory.CreateHttpMessageHandler();

            _httpClient = new HttpClient(httpMessageHandler);
        }
コード例 #27
0
 public TridionBinaryProvider(IProvidersCommonServices commonServices, IHttpMessageHandlerFactory httpClientFactory)
     : base(commonServices, httpClientFactory)
 {
 }
コード例 #28
0
 public WcfClientFactory(IHttpMessageHandlerFactory httpMessageHandlerFactory)
 {
     _httpMessageHandlerFactory = httpMessageHandlerFactory ?? throw new ArgumentNullException(nameof(httpMessageHandlerFactory));
 }
コード例 #29
0
ファイル: ServiceBase.cs プロジェクト: AlienArc/kcdnug
 public ServiceBase(IHttpMessageHandlerFactory messageHandlerFactory)
 {
     MessageHandlerFactory = messageHandlerFactory;
     CurrentHttpClient     = new HttpClient(MessageHandlerFactory.GetHttpMessageHandler());
     CurrentHttpClient.DefaultRequestHeaders.Add("x-functions-key", apiKey);
 }
コード例 #30
0
 public ProductService(IHttpMessageHandlerFactory messageHandlerFactory)
     : base(messageHandlerFactory)
 {
 }
コード例 #31
0
 public IBotAuthenticationBuilder UseHttpMessageHandlerFactory(IHttpMessageHandlerFactory messageHandlerFactory)
 {
     HttpMessageHandlerFactory = messageHandlerFactory;
     return(this);
 }
コード例 #32
0
 public RideSharingLyft(IHttpMessageHandlerFactory httpMessageHandlerFactory, ConfigurationProviderLyft configurationProvider, LyftToGetARyderTransformer lyftToGetARyderTransformer)
     : base(httpMessageHandlerFactory)
 {
     this._lyftGatewayConfiguration   = configurationProvider.GetGatewayConfiguration();
     this._lyftToGetARydertransformer = lyftToGetARyderTransformer;
 }