X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2Fdcae%2FDcaeConfigurationPolling.java;fp=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2Fdcae%2FDcaeConfigurationPolling.java;h=036bd9ae4f10109fb4f8cb5b24c5545575b13160;hb=8182df37f0308ad04433a47570e7ca9612fcfd84;hp=e6bc7903df0285880dd2d8f81ea792d70235ddbc;hpb=c2a7c78225a54445098d666d72c6e84c21ca70ca;p=holmes%2Frule-management.git 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 e6bc790..036bd9a 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 @@ -1,5 +1,5 @@ /** - * Copyright 2017-2020 ZTE Corporation. + * Copyright 2017-2021 ZTE Corporation. *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
@@ -14,29 +14,19 @@
package org.onap.holmes.rulemgt.dcae;
-import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.methods.HttpDelete;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpPut;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.CloseableHttpClient;
import org.onap.holmes.common.dcae.DcaeConfigurationQuery;
import org.onap.holmes.common.dcae.entity.DcaeConfigurations;
import org.onap.holmes.common.dcae.entity.Rule;
import org.onap.holmes.common.exception.CorrelationException;
-import org.onap.holmes.common.utils.GsonUtil;
-import org.onap.holmes.common.utils.HttpsUtils;
+import org.onap.holmes.common.utils.JerseyClient;
import org.onap.holmes.common.utils.Md5Util;
import org.onap.holmes.rulemgt.bean.request.RuleCreateRequest;
import org.onap.holmes.rulemgt.bean.response.RuleQueryListResponse;
import org.onap.holmes.rulemgt.bean.response.RuleResult4API;
+import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.HashMap;
import java.util.List;
@Slf4j
@@ -77,12 +67,8 @@ public class DcaeConfigurationPolling implements Runnable {
if (dcaeConfigurations != null) {
try {
ruleQueryListResponse = getAllCorrelationRules();
- } catch (CorrelationException e) {
- log.error("Failed to get right response!" + e.getMessage(), e);
- } catch (IOException e) {
- log.error("Failed to extract response entity. " + e.getMessage(), e);
} catch (Exception e) {
- log.error("Failed to build http client. " + e.getMessage(), e);
+ log.error("Failed to get deployed rules from the rule management module: " + e.getMessage(), e);
}
}
if (ruleQueryListResponse != null) {
@@ -97,53 +83,17 @@ public class DcaeConfigurationPolling implements Runnable {
}
}
- public RuleQueryListResponse getAllCorrelationRules() throws CorrelationException, IOException {
- HashMap