<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>
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;
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
}
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) {
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());
}
});