diff options
author | 2020-04-16 12:09:24 +0200 | |
---|---|---|
committer | 2020-04-16 12:09:24 +0200 | |
commit | ab3eab60a0883ffa22eb12e2b8680088c9ad25a1 (patch) | |
tree | aa9c2ae4d9f8b49e43e9fcf0fe1cf53353290df1 /src/main/java/org | |
parent | edaf4f9e6d0f8e1b95115cc39492c84d730ba1a2 (diff) |
Remove policy from PEF when removing op policy
The operational policy must be removed from the PEF when the user remove an operational policy (at least attempt to purge the PEF)
Issue-ID: CLAMP-824
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: I442c0890c391d43e8fcbdb89189d6ad2581db3af
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/clamp/loop/Loop.java | 30 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/loop/LoopController.java | 4 | ||||
-rw-r--r-- | src/main/java/org/onap/clamp/loop/LoopService.java | 2 |
3 files changed, 33 insertions, 3 deletions
diff --git a/src/main/java/org/onap/clamp/loop/Loop.java b/src/main/java/org/onap/clamp/loop/Loop.java index 19a17dbb0..081331337 100644 --- a/src/main/java/org/onap/clamp/loop/Loop.java +++ b/src/main/java/org/onap/clamp/loop/Loop.java @@ -331,6 +331,36 @@ public class Loop extends AuditEntity implements Serializable { } /** + * Return the operationalPolicy object with the opPolicyName. + * + * @param opPolicyName The operationalPolicy name + * @return The OperationalPolicy object found in loop object + */ + public OperationalPolicy getOperationalPolicy(String opPolicyName) { + for (OperationalPolicy operationalPolicy : this.getOperationalPolicies()) { + if (operationalPolicy.getName().equals(opPolicyName)) { + return operationalPolicy; + } + } + return null; + } + + /** + * Return the microServicePolicy object with the msPolicyName. + * + * @param msPolicyName The microServicePolicy name + * @return The MicroServicePolicy object found in loop object + */ + public MicroServicePolicy getMicroServicePolicy(String msPolicyName) { + for (MicroServicePolicy microServicePolicy : this.getMicroServicePolicies()) { + if (microServicePolicy.getName().equals(msPolicyName)) { + return microServicePolicy; + } + } + return null; + } + + /** * Generate the loop name. * * @param serviceName The service name diff --git a/src/main/java/org/onap/clamp/loop/LoopController.java b/src/main/java/org/onap/clamp/loop/LoopController.java index a2a44631b..fad93bc7d 100644 --- a/src/main/java/org/onap/clamp/loop/LoopController.java +++ b/src/main/java/org/onap/clamp/loop/LoopController.java @@ -137,11 +137,11 @@ public class LoopController { } /** - * This method remove an operational policy to a loop instance. + * This method removes an operational policy from a loop instance. * * @param loopName The loop name * @param policyType The policy model type - * @param policyVersion The policy model version + * @param policyVersion The policy model version * @return The loop modified */ public Loop removeOperationalPolicy(String loopName, String policyType, String policyVersion) { diff --git a/src/main/java/org/onap/clamp/loop/LoopService.java b/src/main/java/org/onap/clamp/loop/LoopService.java index 6658c5a30..ca3681b62 100644 --- a/src/main/java/org/onap/clamp/loop/LoopService.java +++ b/src/main/java/org/onap/clamp/loop/LoopService.java @@ -131,7 +131,7 @@ public class LoopService { * * @param loopName The loop name * @param policyType The policy model type - * @param policyVersion The policy model version + * @param policyVersion The policy model version * @return The loop modified */ Loop removeOperationalPolicy(String loopName, String policyType, String policyVersion) { |