Adding PdpStatus listener & handler to policy/pap 91/83991/1
authorramverma <ram.krishna.verma@est.tech>
Tue, 2 Apr 2019 17:50:15 +0000 (17:50 +0000)
committerramverma <ram.krishna.verma@est.tech>
Tue, 2 Apr 2019 17:50:15 +0000 (17:50 +0000)
commita47c4b53211a4ad6a448b3f6b28b683189f88c80
tree95b63f777514e069dfc775af7fdbba962bc00621
parentb1f91ce4ca751ab00fda6c81afed12476338288c
Adding PdpStatus listener & handler to policy/pap

1) Adding PdpHeartbeatListener to keep listening for PdpStatus messages
coming from Pdp's over DMaaP either for registration or just heartbeat.
2) Adding PdpStatusMessageHandler to handle new Pdp registration and
also heartbeat coming from Pdp's.
Registration Flow -
 1. Find the PdpSubgroup based on PdpType & SupportedPolicyTypes coming
    in PdpStatus message.
 2. If not found, don't register pdp and log the error message.
 3. If found, check if PdpInstance is already added.
 4. If not added, add PdpInstance to the subgroup and increment the
    currentInstanceCount.
 5. Create and send PdpUpdate & PdpStateChange message to the Pdp.
 6. Update the changes in DB.

Heatbeat Flow -
 1. Find the PdpInstance based on details in PdpStatus message.
 2. Validate the details from message to what in DB.
 3. If correct, persist the health & statistics information in DB.
 4. If not correct, send a PdpUpdate & PdpStateChange message to the Pdp.

3) Unit tests will come as seperate review.

Change-Id: If705193259999e2ab077b78961282c998b949f57
Issue-ID: POLICY-1443
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
main/src/main/java/org/onap/policy/pap/main/comm/PdpHeartbeatListener.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/comm/PdpStatusMessageHandler.java [new file with mode: 0644]
main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java