Updated holmes-actions to 1.3.5 94/122694/1
authorGuangrongFu <fu.guangrong@zte.com.cn>
Mon, 19 Jul 2021 11:12:58 +0000 (19:12 +0800)
committerGuangrongFu <fu.guangrong@zte.com.cn>
Mon, 19 Jul 2021 11:12:58 +0000 (19:12 +0800)
Change-Id: Id310ceec3ab8d22032365742eac57f7ce2c3cc74
Issue-ID: HOLMES-461
Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
pom.xml
rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java
rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java
rulemgt/src/main/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPolling.java

diff --git a/pom.xml b/pom.xml
index bac7610..ec1c6d6 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <dependency>
             <groupId>org.onap.holmes.common</groupId>
             <artifactId>holmes-actions</artifactId>
-            <version>1.3.4</version>
+            <version>1.3.5</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.glassfish.jersey.containers</groupId>
index 6769d65..2a618a7 100644 (file)
@@ -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;
index 87d9e55..4b6e248 100644 (file)
@@ -34,19 +34,19 @@ public class EngineService {
     private static final String COLON = ":";\r
 \r
     protected boolean delete(String packageName, String ip) {\r
-        return new JerseyClient()\r
+        return JerseyClient.newInstance()\r
                 .path(packageName)\r
                 .delete(getUrl(ip)) != null;\r
     }\r
 \r
     protected boolean check(CorrelationCheckRule4Engine correlationCheckRule4Engine, String ip) {\r
-        return new JerseyClient()\r
+        return JerseyClient.newInstance()\r
                 .header("Accept", MediaType.APPLICATION_JSON)\r
                 .post(getUrl(ip), Entity.json(correlationCheckRule4Engine)) != null;\r
     }\r
 \r
     protected String deploy(CorrelationDeployRule4Engine correlationDeployRule4Engine, String ip) {\r
-        return new JerseyClient()\r
+        return JerseyClient.newInstance()\r
                 .header("Accept", MediaType.APPLICATION_JSON)\r
                 .put(getUrl(ip), Entity.json(correlationDeployRule4Engine));\r
     }\r
index 036bd9a..f07d8ac 100644 (file)
@@ -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<RuleResult4API> 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());
             }
         });