summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java
diff options
context:
space:
mode:
authortang peng <tang.peng5@zte.com.cn>2021-06-02 17:14:36 +0800
committertang peng <tang.peng5@zte.com.cn>2021-06-03 19:45:36 +0800
commit8182df37f0308ad04433a47570e7ca9612fcfd84 (patch)
tree384e0319e8be5c6578192c657f2fb32e9df0517a /rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java
parentc2a7c78225a54445098d666d72c6e84c21ca70ca (diff)
Removed Dependency: httpclient
Issue-ID: HOLMES-414 Signed-off-by: tang peng <tang.peng5@zte.com.cn> Change-Id: I3d7771d25d4bd0f67a2e02373ceb2ec392ad4f40
Diffstat (limited to 'rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java
index 92c77ab..6769d65 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java
@@ -19,7 +19,7 @@ package org.onap.holmes.rulemgt;
import org.jvnet.hk2.annotations.Service;
import org.onap.holmes.common.config.MicroServiceConfig;
import org.onap.holmes.common.exception.CorrelationException;
-import org.onap.holmes.common.utils.HttpsUtils;
+import org.onap.holmes.common.utils.CommonUtils;
import org.onap.holmes.common.utils.MsbRegister;
import org.onap.msb.sdk.discovery.entity.MicroServiceInfo;
import org.onap.msb.sdk.discovery.entity.Node;
@@ -31,7 +31,8 @@ import javax.inject.Inject;
import java.util.HashSet;
import java.util.Set;
-import static org.onap.holmes.common.config.MicroServiceConfig.*;
+import static org.onap.holmes.common.utils.CommonUtils.getEnv;
+import static org.onap.holmes.common.utils.CommonUtils.isIpAddress;
@Service
public class Initializer {
@@ -62,13 +63,13 @@ public class Initializer {
msinfo.setProtocol("REST");
msinfo.setVisualRange("0|1");
msinfo.setLb_policy("round-robin");
- msinfo.setEnable_ssl(HttpsUtils.isHttpsEnabled());
+ msinfo.setEnable_ssl(CommonUtils.isHttpsEnabled());
Set<Node> nodes = new HashSet<>();
Node node = new Node();
node.setIp(isIpAddress(serviceIpAndPort[0]) ? serviceIpAndPort[0] : getEnv("HOLMES_RULE_MGMT_SERVICE_HOST"));
node.setPort("9101");
/* Following codes will cause an unregistration from MSB (due to MSB malfunction), comment them for now
- String msbAddrTemplate = (HttpsUtils.isHttpsEnabled() ? "https" : "http")
+ String msbAddrTemplate = (CommonUtils.isHttpsEnabled() ? "https" : "http")
+ "://%s:%s/api/holmes-rule-mgmt/v1/healthcheck";
node.setCheckType("HTTP");
node.setCheckUrl(String.format(msbAddrTemplate, serviceAddrInfo[0], "9101"));