X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FCreateBRMSRuleTemplate.java;h=45080cee9c057892859d6652a98497ab9e72dda3;hb=ccc932599675c927519040399b031ff1d10d9510;hp=7c0d2683cd24f605186eff4da25e3e7d1fac91ab;hpb=47c1630d48e40e1fbc051fa6eae251ffbe1d4945;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java index 7c0d2683c..45080cee9 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/CreateBRMSRuleTemplate.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,4 +70,14 @@ public class CreateBRMSRuleTemplate { return responseMap; } + public static boolean validateRuleParams(String rule) { + CreateBrmsParamPolicy policy = new CreateBrmsParamPolicy(); + Map paramValues = policy.findType(rule); + for(String key : paramValues.keySet()) { + if(!PolicyUtils.SUCCESS.equals(PolicyUtils.policySpecialCharValidator(key))){ + return false; + } + } + return true; + } }