aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-intermediary
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-intermediary')
-rw-r--r--participant/participant-intermediary/pom.xml2
-rw-r--r--participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java19
2 files changed, 12 insertions, 9 deletions
diff --git a/participant/participant-intermediary/pom.xml b/participant/participant-intermediary/pom.xml
index aac80a4a2..0b111fbcc 100644
--- a/participant/participant-intermediary/pom.xml
+++ b/participant/participant-intermediary/pom.xml
@@ -25,7 +25,7 @@
<parent>
<groupId>org.onap.policy.clamp.participant</groupId>
<artifactId>policy-clamp-participant</artifactId>
- <version>6.1.2-SNAPSHOT</version>
+ <version>6.1.3-SNAPSHOT</version>
</parent>
<artifactId>policy-clamp-participant-intermediary</artifactId>
diff --git a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java
index 8bdf91824..30a06ba22 100644
--- a/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java
+++ b/participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ControlLoopHandler.java
@@ -103,9 +103,11 @@ public class ControlLoopHandler {
return null;
}
+ // Update states of ControlLoopElement in controlLoopMap
for (var controlLoop : controlLoopMap.values()) {
var element = controlLoop.getElements().get(id);
if (element != null) {
+ element.setOrderedState(orderedState);
element.setState(newState);
}
var checkOpt = controlLoop.getElements().values().stream()
@@ -116,6 +118,7 @@ public class ControlLoopHandler {
}
}
+ // Update states of ControlLoopElement in elementsOnThisParticipant
var clElement = elementsOnThisParticipant.get(id);
if (clElement != null) {
var controlLoopStateChangeAck = new ControlLoopAck(ParticipantMessageType.CONTROLLOOP_STATECHANGE_ACK);
@@ -339,16 +342,16 @@ public class ControlLoopHandler {
return;
}
- for (var clElementListener : listeners) {
- try {
- for (var element : controlLoop.getElements().values()) {
- clElementListener.controlLoopElementStateChange(controlLoop.getDefinition(), element.getId(),
- element.getState(), orderedState);
+ controlLoop.getElements().values().stream().forEach(clElement -> {
+ for (var clElementListener : listeners) {
+ try {
+ clElementListener.controlLoopElementStateChange(controlLoop.getDefinition(),
+ clElement.getId(), clElement.getState(), orderedState);
+ } catch (PfModelException e) {
+ LOGGER.debug("Control loop element update failed {}", controlLoop.getDefinition());
}
- } catch (PfModelException e) {
- LOGGER.debug("Control loop element update failed {}", controlLoop.getDefinition());
}
- }
+ });
}
/**