responseString.append("Guard Params <b>Time Units</b> is Required" + HTML_ITALICS_LNBREAK);
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 " + HTML_ITALICS_LNBREAK);
- valid = false;
- }else{
- for(String blackList: policyData.getYamlparams().getBlackList()){
- if(blackList==null || !(SUCCESS.equals(PolicyUtils.policySpecialCharValidator(blackList)))){
- responseString.append(" Guard Params <b>BlackList</b> Should be valid String" + HTML_ITALICS_LNBREAK);
- valid = false;
- break;
- }
- }
- }
- }
+ } else if ("GUARD_BL_YAML".equals(policyData.getRuleProvider())
+ && "Use Manual Entry".equals(policyData.getBlackListEntryType())) {
+ if (policyData.getYamlparams().getBlackList() == null
+ || policyData.getYamlparams().getBlackList().isEmpty()) {
+ responseString
+ .append(" Guard Params <b>BlackList</b> is Required " + HTML_ITALICS_LNBREAK);
+ valid = false;
+ } else {
+ for (String blackList : policyData.getYamlparams().getBlackList()) {
+ if (blackList == null
+ || !(SUCCESS.equals(PolicyUtils.policySpecialCharValidator(blackList)))) {
+ responseString.append(" Guard Params <b>BlackList</b> Should be valid String"
+ + HTML_ITALICS_LNBREAK);
+ valid = false;
+ break;
+ }
+ }
+ }
+ }
}
}
}
final JsonNode value = field.getValue();
if (value.isContainerNode() && !value.isArray()) {
+ jsonRequestMap.put(key, "containerNode");
pullModelJsonKeyPairs(value); // RECURSIVE CALL
} else if (value.isArray()) {
try {
+ jsonRequestMap.put(key, "array");
String stringValue = StringUtils.replaceEach(value.toString(), new String[]{"[", "]"}, new String[]{"",""});
ObjectMapper mapper = new ObjectMapper();
JsonNode newValue = mapper.readTree(stringValue);
} else {
jsonRequestMap.put(key, value.toString().trim());
}
- }
-
+ }
}
private JsonObject stringToJsonObject(String value) {