summaryrefslogtreecommitdiffstats
path: root/rulemgt/src
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2021-07-19 19:12:58 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2021-07-19 19:12:58 +0800
commitaf62330fbd26c576564a4170b2ff271ca606ee93 (patch)
tree04af01d27c0e8fb9eaefb9387a656798bbf79f30 /rulemgt/src
parentf689d98b533d7687bbca01a8013bea5cc4e071cc (diff)
Updated holmes-actions to 1.3.5
Change-Id: Id310ceec3ab8d22032365742eac57f7ce2c3cc74 Issue-ID: HOLMES-461 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'rulemgt/src')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/Initializer.java6
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java6
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/dcae/DcaeConfigurationPolling.java6
3 files changed, 9 insertions, 9 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 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<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());
}
});