From: GuangrongFu Date: Mon, 19 Jul 2021 11:12:58 +0000 (+0800) Subject: Updated holmes-actions to 1.3.5 X-Git-Tag: 9.0.0~5 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=holmes%2Frule-management.git;a=commitdiff_plain;h=af62330fbd26c576564a4170b2ff271ca606ee93 Updated holmes-actions to 1.3.5 Change-Id: Id310ceec3ab8d22032365742eac57f7ce2c3cc74 Issue-ID: HOLMES-461 Signed-off-by: GuangrongFu --- diff --git a/pom.xml b/pom.xml index bac7610..ec1c6d6 100644 --- a/pom.xml +++ b/pom.xml @@ -130,7 +130,7 @@ org.onap.holmes.common holmes-actions - 1.3.4 + 1.3.5 org.glassfish.jersey.containers 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 6769d65..2a618a7 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java @@ -68,14 +68,14 @@ public class Initializer { 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 + /* Following codes will cause an unregistration from MSB (due to MSB malfunction), comment them for now*/ 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")); + node.setCheckUrl(String.format(msbAddrTemplate, serviceIpAndPort[0], "9101")); node.setCheckTimeOut("60s"); node.setCheckInterval("60s"); - */ + nodes.add(node); msinfo.setNodes(nodes); return msinfo; diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java index 87d9e55..4b6e248 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java @@ -34,19 +34,19 @@ public class EngineService { private static final String COLON = ":"; protected boolean delete(String packageName, String ip) { - return new JerseyClient() + return JerseyClient.newInstance() .path(packageName) .delete(getUrl(ip)) != null; } protected boolean check(CorrelationCheckRule4Engine correlationCheckRule4Engine, String ip) { - return new JerseyClient() + return JerseyClient.newInstance() .header("Accept", MediaType.APPLICATION_JSON) .post(getUrl(ip), Entity.json(correlationCheckRule4Engine)) != null; } protected String deploy(CorrelationDeployRule4Engine correlationDeployRule4Engine, String ip) { - return new JerseyClient() + return JerseyClient.newInstance() .header("Accept", MediaType.APPLICATION_JSON) .put(getUrl(ip), Entity.json(correlationDeployRule4Engine)); } diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPolling.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPolling.java index 036bd9a..f07d8ac 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPolling.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPolling.java @@ -84,14 +84,14 @@ public class DcaeConfigurationPolling implements Runnable { } private RuleQueryListResponse getAllCorrelationRules() { - return new JerseyClient().get(url, RuleQueryListResponse.class); + return JerseyClient.newInstance().get(url, RuleQueryListResponse.class); } private boolean addAllCorrelationRules(DcaeConfigurations dcaeConfigurations) throws CorrelationException { boolean suc = false; for (Rule rule : dcaeConfigurations.getDefaultRules()) { RuleCreateRequest ruleCreateRequest = getRuleCreateRequest(rule); - suc = new JerseyClient().header("Accept", MediaType.APPLICATION_JSON) + suc = JerseyClient.newInstance().header("Accept", MediaType.APPLICATION_JSON) .put(url, Entity.json(ruleCreateRequest)) != null; if (!suc) { @@ -103,7 +103,7 @@ public class DcaeConfigurationPolling implements Runnable { private void deleteAllCorrelationRules(List ruleResult4APIs) { ruleResult4APIs.forEach(correlationRule -> { - if (null == new JerseyClient().delete(url + "/" + correlationRule.getRuleId())) { + if (null == JerseyClient.newInstance().delete(url + "/" + correlationRule.getRuleId())) { log.warn("Failed to delete rule, the rule id is: {}", correlationRule.getRuleId()); } });