+ if("GUARD_YAML".equals(policyData.getRuleProvider()) || "GUARD_BL_YAML".equals(policyData.getRuleProvider())){
+ if(policyData.getYamlparams()==null){
+ responseString.append("<b> Guard Params are Required </b>" + "<br>");
+ valid = false;
+ }else{
+ if(policyData.getYamlparams().getActor()==null){
+ responseString.append("Guard Params <b>Actor</b> is Required " + "<br>");
+ valid = false;
+ }
+ if(policyData.getYamlparams().getRecipe()==null){
+ responseString.append("Guard Params <b>Recipe</b> is Required " + "<br>");
+ valid = false;
+ }
+ if(policyData.getYamlparams().getGuardActiveStart()==null){
+ responseString.append("Guard Params <b>Guard Active Start/b>is Required " + "<br>");
+ valid = false;
+ }
+ if(policyData.getYamlparams().getGuardActiveEnd()==null){
+ responseString.append("Guard Params <b>Guard Active End</b>is Required " + "<br>");
+ valid = false;
+ }
+ if("GUARD_YAML".equals(policyData.getRuleProvider())){
+ if(policyData.getYamlparams().getLimit()==null){
+ responseString.append(" Guard Params <b>Limit</b> is Required " + "<br>");
+ valid = false;
+ }else if(!isInteger(policyData.getYamlparams().getLimit())){
+ responseString.append(" Guard Params <b>Limit</b> Should be Integer " + "<br>");
+ valid = false;
+ }
+ if(policyData.getYamlparams().getTimeWindow()==null){
+ responseString.append("Guard Params <b>Time Window</b> is Required" + "<br>");
+ valid = false;
+ }
+ }else if("GUARD_BL_YAML".equals(policyData.getRuleProvider())){
+ if(policyData.getYamlparams().getBlackList()==null || policyData.getYamlparams().getBlackList().isEmpty()){
+ responseString.append(" Guard Params <b>BlackList</b> is Required " + "<br>");
+ valid = false;
+ }else{
+ for(String blackList: policyData.getYamlparams().getBlackList()){
+ if(blackList==null || !("success".equals(emptyValidator(blackList)))){
+ responseString.append(" Guard Params <b>BlackList</b> Should be valid String" + "<br>");
+ valid = false;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }