X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2Fdcae%2FDcaeConfigurationPolling.java;h=8049e8f3f4b59892ae9bbb6cc673b31e457422d0;hb=5cc6fc1a762c547f420ce281deac69f02f6c2b83;hp=e6bc7903df0285880dd2d8f81ea792d70235ddbc;hpb=c0bc3d2de8e7694d272c1d53392feea73bec6c66;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..8049e8f 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,32 +14,23 @@
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
+@Deprecated
public class DcaeConfigurationPolling implements Runnable {
public static final long POLLING_PERIOD = 30 * 1000L;
@@ -77,12 +68,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 +84,17 @@ public class DcaeConfigurationPolling implements Runnable {
}
}
- public RuleQueryListResponse getAllCorrelationRules() throws CorrelationException, IOException {
- HashMap