diff options
author | Guangrong Fu <fu.guangrong@zte.com.cn> | 2019-04-02 01:13:40 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-02 01:13:40 +0000 |
commit | 2cb2e9902f2bb2bd3c84c64e8682891decae8fcb (patch) | |
tree | 91fbf99de886d61884172fc06a60a8408db7a20d /engine-d/src/main | |
parent | bc1bf79f7d237400e4eef4ef8ba090396d7f9f1b (diff) | |
parent | 3f438510b3aae2372b33d4d976cd10482a07492a (diff) |
Merge "HTTP/S Modifications"
Diffstat (limited to 'engine-d/src/main')
-rw-r--r-- | engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java | 2 | ||||
-rw-r--r-- | engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java b/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java index 160fc38..245647d 100644 --- a/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java +++ b/engine-d/src/main/java/org/onap/holmes/dsa/dmaappolling/Subscriber.java @@ -87,7 +87,7 @@ public class Subscriber { CloseableHttpClient closeableHttpClient = null; HttpGet httpGet = new HttpGet(url + "/" + consumerGroup + "/" + consumer + "?timeout=" + period); try { - closeableHttpClient = HttpsUtils.getHttpClient(timeout); + closeableHttpClient = HttpsUtils.getConditionalHttpsClient(timeout); HttpResponse httpResponse = HttpsUtils .get(httpGet, new HashMap<>(), closeableHttpClient); response = HttpsUtils.extractResponseEntity(httpResponse); diff --git a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java index c045050..9417242 100644 --- a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java +++ b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java @@ -16,19 +16,11 @@ package org.onap.holmes.engine; import io.dropwizard.setup.Environment; - -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import javax.servlet.DispatcherType; - import lombok.extern.slf4j.Slf4j; import org.onap.holmes.common.config.MicroServiceConfig; import org.onap.holmes.common.dropwizard.ioc.bundle.IOCApplication; import org.onap.holmes.common.exception.CorrelationException; +import org.onap.holmes.common.utils.HttpsUtils; import org.onap.holmes.common.utils.MSBRegisterUtil; import org.onap.holmes.common.utils.transactionid.TransactionIdFilter; import org.onap.holmes.engine.dcae.DcaeConfigurationPolling; @@ -36,6 +28,14 @@ import org.onap.holmes.engine.resources.EngineResources; import org.onap.msb.sdk.discovery.entity.MicroServiceInfo; import org.onap.msb.sdk.discovery.entity.Node; +import javax.servlet.DispatcherType; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + @Slf4j public class EngineDActiveApp extends IOCApplication<EngineDAppConfig> { @@ -66,6 +66,8 @@ public class EngineDActiveApp extends IOCApplication<EngineDAppConfig> { } private MicroServiceInfo createMicroServiceInfo() { + String msbAddrTemplate = (HttpsUtils.isHttpsEnabled() ? "https" : "http") + + "://%s:%s/api/holmes-engine-mgmt/v1/healthcheck"; String[] serviceAddrInfo = MicroServiceConfig.getMicroServiceIpAndPort(); MicroServiceInfo msinfo = new MicroServiceInfo(); msinfo.setServiceName("holmes-engine-mgmt"); @@ -73,13 +75,13 @@ public class EngineDActiveApp extends IOCApplication<EngineDAppConfig> { msinfo.setUrl("/api/holmes-engine-mgmt/v1"); msinfo.setProtocol("REST"); msinfo.setVisualRange("0|1"); - msinfo.setEnable_ssl(true); + msinfo.setEnable_ssl(HttpsUtils.isHttpsEnabled()); Set<Node> nodes = new HashSet<>(); Node node = new Node(); node.setIp(serviceAddrInfo[0]); node.setPort("9102"); node.setCheckType("HTTP"); - node.setCheckUrl(String.format("https://%s:%s/api/holmes-engine-mgmt/v1/healthcheck", serviceAddrInfo[0], "9102")); + node.setCheckUrl(String.format(msbAddrTemplate, serviceAddrInfo[0], "9102")); node.setCheckTimeOut("60s"); node.setCheckInterval("60s"); nodes.add(node); |