diff options
author | Michael Mokry <mm117s@att.com> | 2018-03-16 20:50:41 -0500 |
---|---|---|
committer | Michael Mokry <mm117s@att.com> | 2018-03-26 09:43:24 -0500 |
commit | b6d9063e06ab8cdf2d97fc75810792659344e4a8 (patch) | |
tree | 189c47e59cef6650ba0d39bbee31dcdaaa3ddbc7 /PolicyEngineUtils/src/main | |
parent | c8bed1e392b935ec50aaeeb5fb82d25a9568b790 (diff) |
New Optimization Policy
This is the new Optimization Policy to support the Integration of
the OOF Policy Model into the Policy Platform.
Added changes from Frank Wang to fix the following issues with existing Model
Parser:
1. TOSCA Rendering issues
2. Matching Attributes support
3. ImportModelAPI to support TOSCA model upload via REST API
Running local Sonar tonight to start fixing Sonar issues
Added changes per review comments and fixed Sonar issues
Change-Id: Ia8ce09c28a718ce4460475e76a750caef774bd6b
Issue-ID: POLICY-622
Signed-off-by: Michael Mokry <mm117s@att.com>
Diffstat (limited to 'PolicyEngineUtils/src/main')
-rw-r--r-- | PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java index e17ddc681..06263853e 100644 --- a/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java +++ b/PolicyEngineUtils/src/main/java/org/onap/policy/utils/PolicyUtils.java @@ -158,6 +158,21 @@ public class PolicyUtils { } /** + * Validate a field (accepts Dash) if it contains unacceptable policy input and return "success" if good. + * + * @param field + * @return + */ + public static String policySpecialCharWithDashValidator(String field){ + String error; + if ("".equals(field) || !field.matches("^[a-zA-Z0-9_-]*$")) { + error = "The Value in Required Field will allow only '{0-9}, {a-z}, {A-Z}, _, -' following set of Combinations"; + return error; + } + return SUCCESS; + } + + /** * Validate the XACML description tag and return "success" if good. * * @param field |