X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fcontroller%2FPolicyValidationController.java;h=eb144cc183f79b90d6702bfb53b056696bc3f676;hb=dda032f8bb161d54eb1f59de2b4a3efb774fc4d1;hp=55bff24a09d70611876343f6ce1720d5b7b537aa;hpb=a330af579866dacbe595e2e4ad1dd29cd3c96945;p=policy%2Fengine.git
diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java
index 55bff24a0..eb144cc18 100644
--- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java
+++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/PolicyValidationController.java
@@ -448,7 +448,44 @@ public class PolicyValidationController extends RestrictedBaseController {
responseString = responseString + "Ecomp Name: Ecomp Name Should not be empty" + "
";
valid = false;
}
-
+ if(policyData.getRuleProvider().equals("GUARD_YAML")){
+ if(policyData.getYamlparams()==null){
+ responseString = responseString + " Guard Params are Required " + "
";
+ valid = false;
+ }else{
+ if(policyData.getYamlparams().getActor()==null){
+ responseString = responseString + "Guard Params Actor is Required " + "
";
+ valid = false;
+ }
+ if(policyData.getYamlparams().getRecipe()==null){
+ responseString = responseString + "Guard Params Recipe is Required " + "
";
+ valid = false;
+ }
+ if(policyData.getYamlparams().getLimit()==null){
+ responseString = responseString + " Guard Params Limit is Required " + "
";
+ valid = false;
+ }else{
+ try{
+ Integer.parseInt(policyData.getYamlparams().getLimit());
+ }catch(NumberFormatException e){
+ responseString = responseString + " Guard Params Limit Should be Integer " + "
";
+ valid = false;
+ }
+ }
+ if(policyData.getYamlparams().getTimeWindow()==null){
+ responseString = responseString + "Guard Params Time Window is Required" + "
";
+ valid = false;
+ }
+ if(policyData.getYamlparams().getGuardActiveStart()==null){
+ responseString = responseString + "Guard Params Guard Active Start/b>is Required " + "
";
+ valid = false;
+ }
+ if(policyData.getYamlparams().getGuardActiveEnd()==null){
+ responseString = responseString + "Guard Params Guard Active Endis Required " + "
";
+ valid = false;
+ }
+ }
+ }
}
if(policyData.getPolicyType().equals(ACTION_POLICY)){