diff options
author | 2019-11-20 13:48:16 -0500 | |
---|---|---|
committer | 2019-11-20 23:49:59 +0000 | |
commit | c9c5db71b36204cabbbb34e7caba625197968b8f (patch) | |
tree | 603233bbd5fa9e77a4cce706d0b4b604d3a9a6b9 /main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java | |
parent | 892ee586c85c7fc4cdd12d7f42a70a12f7006d77 (diff) |
Undeploy policies when deploy fails
Modified the code so that if a PDP fails to deploy one or more policies
specified in a PDP-UPDATE message, PAP will undeploy those policies that
failed to deploy to the PDP. This entails removing the policies from
the Pdp Group(s), issuing new PDP-UPDATE requests, and updating the
notification tracking data.
Issue-ID: POLICY-2155
Change-Id: I1740282385b0fa804254ebdf57537ef0f3a7a4c8
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java')
-rw-r--r-- | main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java b/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java index 1fc9784e..8af66362 100644 --- a/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java +++ b/main/src/main/java/org/onap/policy/pap/main/startstop/PapActivator.java @@ -57,6 +57,7 @@ import org.onap.policy.pap.main.rest.PolicyStatusControllerV1; import org.onap.policy.pap.main.rest.StatisticsRestControllerV1; import org.onap.policy.pap.main.rest.depundep.PdpGroupDeleteControllerV1; import org.onap.policy.pap.main.rest.depundep.PdpGroupDeployControllerV1; +import org.onap.policy.pap.main.rest.depundep.PolicyUndeployerImpl; /** * This class activates Policy Administration (PAP) as a complete service together with all its controllers, listeners & @@ -218,6 +219,9 @@ public class PapActivator extends ServiceManagerContainer { .setStateChangeTimers(pdpStChgTimers.get()) .setUpdateTimers(pdpUpdTimers.get()))); Registry.register(PapConstants.REG_PDP_MODIFY_MAP, requestMap.get()); + + // now that it's registered, we can attach a "policy undeploy" provider + requestMap.get().setPolicyUndeployer(new PolicyUndeployerImpl()); }, () -> Registry.unregister(PapConstants.REG_PDP_MODIFY_MAP)); |