summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/clamp/loop/LoopService.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/onap/clamp/loop/LoopService.java b/src/main/java/org/onap/clamp/loop/LoopService.java
index 6658c5a3..d14667ea 100644
--- a/src/main/java/org/onap/clamp/loop/LoopService.java
+++ b/src/main/java/org/onap/clamp/loop/LoopService.java
@@ -118,6 +118,12 @@ public class LoopService {
Loop addOperationalPolicy(String loopName, String policyType, String policyVersion) throws IOException {
Loop loop = getLoop(loopName);
PolicyModel policyModel = policyModelsService.getPolicyModel(policyType, policyVersion);
+ Set<OperationalPolicy> opPolicySet = loop.getOperationalPolicies();
+ for (OperationalPolicy opPolicy : opPolicySet) {
+ if (opPolicy.getPolicyModel().equals(policyModel)) {
+ throw new IllegalArgumentException("This type of Operational Policy is already added to the loop. Please choose another one.");
+ }
+ }
if (policyModel == null) {
return null;
}