diff options
Diffstat (limited to 'src/main/java/org/onap')
-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) { |