summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main/java/org/onap
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2020-06-22 14:28:34 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2020-06-22 14:28:34 +0800
commitabdc7bfcaf9431fd507f0e9cd7fbdb96413386cd (patch)
treed6a81fafc141e15465e8bf4f3a5150e6f794c7c0 /rulemgt/src/main/java/org/onap
parent18a28b93a3c41df917865ee897bd0f51bed760d6 (diff)
Updated to Java 11
Change-Id: I890cabaecf65588739d4e6281ec9b32087e334ea Issue-ID: HOLMES-302 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
Diffstat (limited to 'rulemgt/src/main/java/org/onap')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java11
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java2
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineInsQueryTool.java34
3 files changed, 22 insertions, 25 deletions
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
index 058aea7..21855f8 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleActiveApp.java
@@ -17,7 +17,6 @@
package org.onap.holmes.rulemgt;
import io.dropwizard.setup.Environment;
-import lombok.extern.slf4j.Slf4j;
import org.onap.holmes.common.config.MicroServiceConfig;
import org.onap.holmes.common.dropwizard.ioc.bundle.IOCApplication;
import org.onap.holmes.common.exception.CorrelationException;
@@ -29,6 +28,8 @@ import org.onap.holmes.rulemgt.msb.MsbQuery;
import org.onap.holmes.rulemgt.resources.RuleMgtResources;
import org.onap.msb.sdk.discovery.entity.MicroServiceInfo;
import org.onap.msb.sdk.discovery.entity.Node;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.servlet.DispatcherType;
import java.util.EnumSet;
@@ -38,19 +39,15 @@ import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
-@Slf4j
public class RuleActiveApp extends IOCApplication<RuleAppConfig> {
+ private Logger log = LoggerFactory.getLogger(RuleActiveApp.class);
+
public static void main(String[] args) throws Exception {
new RuleActiveApp().run(args);
}
@Override
- public String getName() {
- return "Holmes Rule Management ActiveApp APP ";
- }
-
- @Override
public void run(RuleAppConfig configuration, Environment environment) throws Exception {
super.run(configuration, environment);
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java
index b0f0b96..104f74d 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/db/CorrelationRuleQueryDao.java
@@ -97,7 +97,7 @@ public class CorrelationRuleQueryDao {
if (field.getName().contains("jacoco")) {
continue;
}
- PropertyDescriptor pd = new PropertyDescriptor(field.getName(),
+ PropertyDescriptor pd = new PropertyDescriptor((String)field.getName(),
clazz);
Method getMethod = pd.getReadMethod();
Object o = getMethod.invoke(ruleQueryCondition);
diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineInsQueryTool.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineInsQueryTool.java
index a0eee1f..36b5b6f 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineInsQueryTool.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/msb/EngineInsQueryTool.java
@@ -46,24 +46,24 @@ public class EngineInsQueryTool {
}
public List<String> getInstanceList() throws Exception {
- String response;
- HttpGet httpGet = new HttpGet(url);
- try (CloseableHttpClient httpClient = HttpsUtils.getConditionalHttpsClient(HttpsUtils.DEFUALT_TIMEOUT)) {
- HttpResponse httpResponse = HttpsUtils.get(httpGet, new HashMap<>(), httpClient);
- response = HttpsUtils.extractResponseEntity(httpResponse);
- } catch (Exception e) {
- throw e;
- } finally {
- httpGet.releaseConnection();
+ String response;
+ HttpGet httpGet = new HttpGet(url);
+ try (CloseableHttpClient httpClient = HttpsUtils.getConditionalHttpsClient(HttpsUtils.DEFUALT_TIMEOUT)) {
+ HttpResponse httpResponse = HttpsUtils.get(httpGet, new HashMap<>(), httpClient);
+ response = HttpsUtils.extractResponseEntity(httpResponse);
+ } catch (Exception e) {
+ throw e;
+ } finally {
+ httpGet.releaseConnection();
- }
- ServiceEntity service = GsonUtil.jsonToBean(response, ServiceEntity.class);
- List<ServiceNode4Query> nodesList = service.getNodes();
- List<String> ipList = new ArrayList<>();
- for (ServiceNode4Query node : nodesList) {
- ipList.add(node.getIp());
- }
- return ipList;
+ }
+ ServiceEntity service = GsonUtil.jsonToBean(response, ServiceEntity.class);
+ List<ServiceNode4Query> nodesList = service.getNodes();
+ List<String> ipList = new ArrayList<>();
+ for (ServiceNode4Query node : nodesList) {
+ ipList.add(node.getIp());
+ }
+ return ipList;
}