Search in sources :

Example 1 with ClientHttpConnector

use of cn.taketoday.http.client.reactive.ClientHttpConnector in project today-infrastructure by TAKETODAY.

the class DefaultWebClientBuilder method build.

@Override
public WebClient build() {
    ClientHttpConnector connectorToUse = (this.connector != null ? this.connector : initConnector());
    ExchangeFunction exchange = (this.exchangeFunction == null ? ExchangeFunctions.create(connectorToUse, initExchangeStrategies()) : this.exchangeFunction);
    ExchangeFunction filteredExchange = (this.filters != null ? this.filters.stream().reduce(ExchangeFilterFunction::andThen).map(filter -> filter.apply(exchange)).orElse(exchange) : exchange);
    HttpHeaders defaultHeaders = copyDefaultHeaders();
    MultiValueMap<String, String> defaultCookies = copyDefaultCookies();
    return new DefaultWebClient(filteredExchange, initUriBuilderFactory(), defaultHeaders, defaultCookies, this.defaultRequest, new DefaultWebClientBuilder(this));
}
Also used : ClientHttpConnector(cn.taketoday.http.client.reactive.ClientHttpConnector) ClientCodecConfigurer(cn.taketoday.http.codec.ClientCodecConfigurer) LinkedMultiValueMap(cn.taketoday.core.LinkedMultiValueMap) Arrays(java.util.Arrays) Assert(cn.taketoday.lang.Assert) CollectionUtils(cn.taketoday.util.CollectionUtils) JettyClientHttpConnector(cn.taketoday.http.client.reactive.JettyClientHttpConnector) ClassUtils(cn.taketoday.util.ClassUtils) UriBuilderFactory(cn.taketoday.web.util.UriBuilderFactory) ArrayList(java.util.ArrayList) ReactorClientHttpConnector(cn.taketoday.http.client.reactive.ReactorClientHttpConnector) LinkedHashMap(java.util.LinkedHashMap) Consumer(java.util.function.Consumer) List(java.util.List) HttpHeaders(cn.taketoday.http.HttpHeaders) Nullable(cn.taketoday.lang.Nullable) Map(java.util.Map) HttpComponentsClientHttpConnector(cn.taketoday.http.client.reactive.HttpComponentsClientHttpConnector) MultiValueMap(cn.taketoday.core.MultiValueMap) DefaultUriBuilderFactory(cn.taketoday.web.util.DefaultUriBuilderFactory) JdkClientHttpConnector(cn.taketoday.http.client.reactive.JdkClientHttpConnector) HttpHeaders(cn.taketoday.http.HttpHeaders) ClientHttpConnector(cn.taketoday.http.client.reactive.ClientHttpConnector) JettyClientHttpConnector(cn.taketoday.http.client.reactive.JettyClientHttpConnector) ReactorClientHttpConnector(cn.taketoday.http.client.reactive.ReactorClientHttpConnector) HttpComponentsClientHttpConnector(cn.taketoday.http.client.reactive.HttpComponentsClientHttpConnector) JdkClientHttpConnector(cn.taketoday.http.client.reactive.JdkClientHttpConnector)

Example 2 with ClientHttpConnector

use of cn.taketoday.http.client.reactive.ClientHttpConnector in project today-framework by TAKETODAY.

the class DefaultWebClientBuilder method build.

@Override
public WebClient build() {
    ClientHttpConnector connectorToUse = (this.connector != null ? this.connector : initConnector());
    ExchangeFunction exchange = (this.exchangeFunction == null ? ExchangeFunctions.create(connectorToUse, initExchangeStrategies()) : this.exchangeFunction);
    ExchangeFunction filteredExchange = (this.filters != null ? this.filters.stream().reduce(ExchangeFilterFunction::andThen).map(filter -> filter.apply(exchange)).orElse(exchange) : exchange);
    HttpHeaders defaultHeaders = copyDefaultHeaders();
    MultiValueMap<String, String> defaultCookies = copyDefaultCookies();
    return new DefaultWebClient(filteredExchange, initUriBuilderFactory(), defaultHeaders, defaultCookies, this.defaultRequest, new DefaultWebClientBuilder(this));
}
Also used : ClientHttpConnector(cn.taketoday.http.client.reactive.ClientHttpConnector) ClientCodecConfigurer(cn.taketoday.http.codec.ClientCodecConfigurer) LinkedMultiValueMap(cn.taketoday.core.LinkedMultiValueMap) Arrays(java.util.Arrays) Assert(cn.taketoday.lang.Assert) CollectionUtils(cn.taketoday.util.CollectionUtils) JettyClientHttpConnector(cn.taketoday.http.client.reactive.JettyClientHttpConnector) ClassUtils(cn.taketoday.util.ClassUtils) UriBuilderFactory(cn.taketoday.web.util.UriBuilderFactory) ArrayList(java.util.ArrayList) ReactorClientHttpConnector(cn.taketoday.http.client.reactive.ReactorClientHttpConnector) LinkedHashMap(java.util.LinkedHashMap) Consumer(java.util.function.Consumer) List(java.util.List) HttpHeaders(cn.taketoday.http.HttpHeaders) Nullable(cn.taketoday.lang.Nullable) Map(java.util.Map) HttpComponentsClientHttpConnector(cn.taketoday.http.client.reactive.HttpComponentsClientHttpConnector) MultiValueMap(cn.taketoday.core.MultiValueMap) DefaultUriBuilderFactory(cn.taketoday.web.util.DefaultUriBuilderFactory) JdkClientHttpConnector(cn.taketoday.http.client.reactive.JdkClientHttpConnector) HttpHeaders(cn.taketoday.http.HttpHeaders) ClientHttpConnector(cn.taketoday.http.client.reactive.ClientHttpConnector) JettyClientHttpConnector(cn.taketoday.http.client.reactive.JettyClientHttpConnector) ReactorClientHttpConnector(cn.taketoday.http.client.reactive.ReactorClientHttpConnector) HttpComponentsClientHttpConnector(cn.taketoday.http.client.reactive.HttpComponentsClientHttpConnector) JdkClientHttpConnector(cn.taketoday.http.client.reactive.JdkClientHttpConnector)

Aggregations

LinkedMultiValueMap (cn.taketoday.core.LinkedMultiValueMap)2 MultiValueMap (cn.taketoday.core.MultiValueMap)2 HttpHeaders (cn.taketoday.http.HttpHeaders)2 ClientHttpConnector (cn.taketoday.http.client.reactive.ClientHttpConnector)2 HttpComponentsClientHttpConnector (cn.taketoday.http.client.reactive.HttpComponentsClientHttpConnector)2 JdkClientHttpConnector (cn.taketoday.http.client.reactive.JdkClientHttpConnector)2 JettyClientHttpConnector (cn.taketoday.http.client.reactive.JettyClientHttpConnector)2 ReactorClientHttpConnector (cn.taketoday.http.client.reactive.ReactorClientHttpConnector)2 ClientCodecConfigurer (cn.taketoday.http.codec.ClientCodecConfigurer)2 Assert (cn.taketoday.lang.Assert)2 Nullable (cn.taketoday.lang.Nullable)2 ClassUtils (cn.taketoday.util.ClassUtils)2 CollectionUtils (cn.taketoday.util.CollectionUtils)2 DefaultUriBuilderFactory (cn.taketoday.web.util.DefaultUriBuilderFactory)2 UriBuilderFactory (cn.taketoday.web.util.UriBuilderFactory)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 Map (java.util.Map)2