Fixed participant registration ACK 79/123679/3
authorsaul.gill <saul.gill@est.tech>
Fri, 27 Aug 2021 13:11:52 +0000 (14:11 +0100)
committersaul.gill <saul.gill@est.tech>
Mon, 30 Aug 2021 12:43:46 +0000 (13:43 +0100)
Particiapnts now send status message after registration
This adds participants to the DB in Runtime

Issue-ID: POLICY-3588
Change-Id: Idb62b429a6e2e0047d6946d9718c78560a7cd659
Signed-off-by: saul.gill <saul.gill@est.tech>
participant/participant-intermediary/src/main/java/org/onap/policy/clamp/controlloop/participant/intermediary/handler/ParticipantHandler.java

index 66e09e7..860df7f 100644 (file)
@@ -226,6 +226,14 @@ public class ParticipantHandler implements Closeable {
     public void handleParticipantRegisterAck(ParticipantRegisterAck participantRegisterAckMsg) {
         LOGGER.debug("ParticipantRegisterAck message received as responseTo {}",
                 participantRegisterAckMsg.getResponseTo());
+        if (ParticipantHealthStatus.UNKNOWN.equals(this.healthStatus)) {
+            this.healthStatus = ParticipantHealthStatus.HEALTHY;
+        }
+
+        if (ParticipantState.UNKNOWN.equals(this.state)) {
+            this.state = ParticipantState.PASSIVE;
+        }
+        sender.sendParticipantStatus(makeHeartbeat(false));
     }
 
     /**