Code Review
/
holmes
/
engine-management.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
bugfix - added transactionID
[holmes/engine-management.git]
/
engine-d
/
src
/
main
/
java
/
org
/
onap
/
holmes
/
engine
/
dmaap
/
SubscriberAction.java
diff --git
a/engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
b/engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
index
1297f11
..
035b796
100644
(file)
--- a/
engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
+++ b/
engine-d/src/main/java/org/onap/holmes/engine/dmaap/SubscriberAction.java
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 2017
- 2021
ZTE Corporation.
+ * Copyright 2017
-2022
ZTE Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-15,26
+15,27
@@
*/
package org.onap.holmes.engine.dmaap;
*/
package org.onap.holmes.engine.dmaap;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import javax.annotation.PreDestroy;
-import javax.inject.Inject;
+import jakarta.annotation.PreDestroy;
import lombok.extern.slf4j.Slf4j;
import lombok.extern.slf4j.Slf4j;
-import org.jvnet.hk2.annotations.Service;
-import org.onap.holmes.common.utils.DbDaoUtil;
import org.onap.holmes.dsa.dmaappolling.Subscriber;
import org.onap.holmes.dsa.dmaappolling.Subscriber;
-import org.onap.holmes.engine.db.AlarmInfoDao;
+import org.onap.holmes.engine.db.AlarmInfoDao
Service
;
import org.onap.holmes.engine.manager.DroolsEngine;
import org.onap.holmes.engine.manager.DroolsEngine;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
-@
Service
+@
Component
@Slf4j
public class SubscriberAction {
@Slf4j
public class SubscriberAction {
- @
Inject
+ @
Autowired
private DroolsEngine droolsEngine;
private DroolsEngine droolsEngine;
- @Inject
- private DbDaoUtil daoUtil;
+ @Autowired
+ private AlarmInfoDaoService alarmInfoDaoService;
+
private HashMap<String, DMaaPAlarmPolling> pollingTasks = new HashMap<>();
public synchronized void addSubscriber(Subscriber subscriber) {
private HashMap<String, DMaaPAlarmPolling> pollingTasks = new HashMap<>();
public synchronized void addSubscriber(Subscriber subscriber) {
@@
-43,8
+44,7
@@
public class SubscriberAction {
if (pollingTasks.containsKey(topic)) {
removeSubscriber(subscriber);
}
if (pollingTasks.containsKey(topic)) {
removeSubscriber(subscriber);
}
- AlarmInfoDao alarmInfoDao = daoUtil.getJdbiDaoByOnDemand(AlarmInfoDao.class);
- DMaaPAlarmPolling pollingTask = new DMaaPAlarmPolling(subscriber, droolsEngine, alarmInfoDao);
+ DMaaPAlarmPolling pollingTask = new DMaaPAlarmPolling(subscriber, droolsEngine, alarmInfoDaoService);
Thread thread = new Thread(pollingTask);
thread.start();
pollingTasks.put(topic, pollingTask);
Thread thread = new Thread(pollingTask);
thread.start();
pollingTasks.put(topic, pollingTask);
@@
-67,7
+67,7
@@
public class SubscriberAction {
public void stopPollingTasks() {
Iterator iterator = pollingTasks.entrySet().iterator();
while (iterator.hasNext()) {
public void stopPollingTasks() {
Iterator iterator = pollingTasks.entrySet().iterator();
while (iterator.hasNext()) {
- Map.Entry entry = (Map.Entry)iterator.next();
+ Map.Entry entry = (Map.Entry)
iterator.next();
String key = (String) entry.getKey();
pollingTasks.get(key).stopTask();
}
String key = (String) entry.getKey();
pollingTasks.get(key).stopTask();
}