aboutsummaryrefslogtreecommitdiffstats
path: root/a1-policy-management/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'a1-policy-management/src/main')
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClient.java6
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java6
-rw-r--r--a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java3
3 files changed, 12 insertions, 3 deletions
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClient.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClient.java
index ad2e221f..c3be9b4d 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClient.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClient.java
@@ -42,7 +42,6 @@ import org.springframework.web.reactive.function.client.WebClientResponseExcepti
import reactor.core.publisher.Mono;
import reactor.netty.http.client.HttpClient;
-import reactor.netty.transport.ProxyProvider;
/**
* Generic reactive REST client.
@@ -211,8 +210,9 @@ public class AsyncRestClient {
}
if (isHttpProxyConfigured()) {
- httpClient = httpClient.proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP)
- .host(httpProxyConfig.httpProxyHost()).port(httpProxyConfig.httpProxyPort()));
+ httpClient = httpClient.proxy(proxy -> proxy.type(httpProxyConfig.httpProxyType()) //
+ .host(httpProxyConfig.httpProxyHost()) //
+ .port(httpProxyConfig.httpProxyPort()));
}
return httpClient;
}
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
index 170ade6f..3a245190 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ApplicationConfig.java
@@ -33,7 +33,9 @@ import org.onap.ccsdk.oran.a1policymanagementservice.configuration.WebClientConf
import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+
import reactor.core.publisher.Flux;
+import reactor.netty.transport.ProxyProvider;
@EnableConfigurationProperties
public class ApplicationConfig {
@@ -73,6 +75,9 @@ public class ApplicationConfig {
@Value("${app.webclient.http.proxy-port:0}")
private int httpProxyPort = 0;
+ @Value("${app.webclient.http.proxy-type:HTTP}")
+ private String httpProxyType = "HTTP";
+
private Map<String, RicConfig> ricConfigs = new HashMap<>();
@Getter
@@ -94,6 +99,7 @@ public class ApplicationConfig {
HttpProxyConfig httpProxyConfig = ImmutableHttpProxyConfig.builder() //
.httpProxyHost(this.httpProxyHost) //
.httpProxyPort(this.httpProxyPort) //
+ .httpProxyType(ProxyProvider.Proxy.valueOf(this.httpProxyType)) //
.build();
this.webClientConfig = ImmutableWebClientConfig.builder() //
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java
index beb6e51f..1e5d7ffa 100644
--- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java
+++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java
@@ -21,6 +21,7 @@
package org.onap.ccsdk.oran.a1policymanagementservice.configuration;
import org.immutables.value.Value;
+import reactor.netty.transport.ProxyProvider;
@Value.Immutable
@Value.Style(redactedMask = "####")
@@ -47,6 +48,8 @@ public interface WebClientConfig {
public String httpProxyHost();
public int httpProxyPort();
+
+ public ProxyProvider.Proxy httpProxyType();
}
public HttpProxyConfig httpProxyConfig();