diff options
author | 2019-06-07 11:33:59 -0400 | |
---|---|---|
committer | 2019-06-07 11:52:37 -0400 | |
commit | de6a7d44138a968b798eab678f20885e7d48ebc9 (patch) | |
tree | 778941f47eb01cabeb200eeff02fb79a340fcd2d /main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java | |
parent | 9f41ede37c78dd5dcea1851e114b7bdf9a5df7a5 (diff) |
Undeploy all versions of a policy
Modified the code to undeploy all versions of a policy if the
version is not specified.
Change-Id: Ic3815733b918e1cff8f381d54bceb710a35319b7
Issue-ID: POLICY-1782
Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java')
-rw-r--r-- | main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java b/main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java index d3f0d13e..70ccd7ab 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/depundep/ProviderBase.java @@ -140,7 +140,7 @@ public abstract class ProviderBase { + desiredPolicy.getName() + " " + desiredPolicy.getVersion()); } - BiFunction<PdpGroup, PdpSubGroup, Boolean> updater = makeUpdater(policy); + BiFunction<PdpGroup, PdpSubGroup, Boolean> updater = makeUpdater(policy, desiredPolicy); for (PdpGroup group : groups) { upgradeGroup(data, group, updater); @@ -153,9 +153,11 @@ public abstract class ProviderBase { * necessary/appropriate. * * @param policy policy to be added to or removed from each subgroup + * @param desiredPolicy request policy * @return a function to update a subgroup */ - protected abstract BiFunction<PdpGroup, PdpSubGroup, Boolean> makeUpdater(ToscaPolicy policy); + protected abstract BiFunction<PdpGroup, PdpSubGroup, Boolean> makeUpdater(ToscaPolicy policy, + ToscaPolicyIdentifierOptVersion desiredPolicy); /** * Finds the active PDP group(s) that supports the given policy type. |