aboutsummaryrefslogtreecommitdiffstats
path: root/runtime-acm/src/main
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2023-07-18 13:47:55 +0100
committerFrancesco Fiora <francesco.fiora@est.tech>2023-07-18 12:49:59 +0000
commit1a5a1f51875433be47a697a2f2498a428c23d7e5 (patch)
tree4fda87f9b24cade9f62c0dd45c96ddd0cd6f2180 /runtime-acm/src/main
parent7815def0c52559f8c64b70f5f4df9648c7b8f70d (diff)
Fix OFF_LINE issue when Status message upcoming
Issue-ID: POLICY-4770 Change-Id: If5812e689fab5ebfcf3eb23c89dcbd556ad8f331 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'runtime-acm/src/main')
-rwxr-xr-x[-rw-r--r--]runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java14
-rwxr-xr-x[-rw-r--r--]runtime-acm/src/main/resources/application.yaml2
2 files changed, 11 insertions, 5 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
index e0d11ed9f..f8bc233e9 100644..100755
--- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
+++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionParticipantHandler.java
@@ -76,10 +76,7 @@ public class SupervisionParticipantHandler {
if (participantOpt.isPresent()) {
var participant = participantOpt.get();
- if (ParticipantState.OFF_LINE.equals(participant.getParticipantState())) {
- participant.setParticipantState(ParticipantState.ON_LINE);
- participantProvider.saveParticipant(participant);
- }
+ checkOnline(participant);
handleRestart(participant.getParticipantId());
} else {
var participant = createParticipant(participantRegisterMsg.getParticipantId(),
@@ -127,12 +124,21 @@ public class SupervisionParticipantHandler {
var participant = createParticipant(participantStatusMsg.getParticipantId(),
listToMap(participantStatusMsg.getParticipantSupportedElementType()));
participantProvider.saveParticipant(participant);
+ } else {
+ checkOnline(participantOpt.get());
}
if (!participantStatusMsg.getAutomationCompositionInfoList().isEmpty()) {
automationCompositionProvider.upgradeStates(participantStatusMsg.getAutomationCompositionInfoList());
}
}
+ private void checkOnline(Participant participant) {
+ if (ParticipantState.OFF_LINE.equals(participant.getParticipantState())) {
+ participant.setParticipantState(ParticipantState.ON_LINE);
+ participantProvider.saveParticipant(participant);
+ }
+ }
+
private void handleRestart(UUID participantId) {
var compositionIds = participantProvider.getCompositionIds(participantId);
for (var compositionId : compositionIds) {
diff --git a/runtime-acm/src/main/resources/application.yaml b/runtime-acm/src/main/resources/application.yaml
index faef54af0..8dd4b574a 100644..100755
--- a/runtime-acm/src/main/resources/application.yaml
+++ b/runtime-acm/src/main/resources/application.yaml
@@ -42,7 +42,7 @@ server:
runtime:
participantParameters:
heartBeatMs: 20000
- maxStatusWaitMs: 100000
+ maxStatusWaitMs: 200000
topicParameterGroup:
topicSources:
-