X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fcontroller%2FCreateBRMSParamController.java;h=265b7b7b264260040b3b8417c693419a3af15d30;hp=786e17a1603a0741e51ffa317922ec6196c9705e;hb=7e547eaa55920dfbc9691eab33bb728395b50cf2;hpb=dda032f8bb161d54eb1f59de2b4a3efb774fc4d1 diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java index 786e17a16..265b7b7b2 100644 --- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java +++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/CreateBRMSParamController.java @@ -57,6 +57,7 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.AdviceExpressionsType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.AllOfType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeAssignmentExpressionType; +import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeDesignatorType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.AttributeValueType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType; @@ -275,7 +276,6 @@ public class CreateBRMSParamController extends RestrictedBaseController { List allOfList = anyOf.getAllOf(); if (allOfList != null) { Iterator iterAllOf = allOfList.iterator(); - int index = 0; while (iterAllOf.hasNext()) { AllOfType allOf = iterAllOf.next(); // Under AllOFType we have Match @@ -285,29 +285,27 @@ public class CreateBRMSParamController extends RestrictedBaseController { while (iterMatch.hasNext()) { MatchType match = iterMatch.next(); // - // Under the match we have attributevalue and + // Under the match we have attribute value and // attributeDesignator. So,finally down to the actual attribute. // AttributeValueType attributeValue = match.getAttributeValue(); String value = (String) attributeValue.getContent().get(0); + AttributeDesignatorType designator = match.getAttributeDesignator(); + String attributeId = designator.getAttributeId(); - if (index == 3){ + if (attributeId.equals("RiskType")){ policyAdapter.setRiskType(value); } - - if (index == 4){ + if (attributeId.equals("RiskLevel")){ policyAdapter.setRiskLevel(value); } - - if (index == 5){ + if (attributeId.equals("guard")){ policyAdapter.setGuard(value); } - if (index == 6 && !value.contains("NA")){ + if (attributeId.equals("TTLDate") && !value.contains("NA")){ String newDate = convertDate(value, true); policyAdapter.setTtlDate(newDate); } - - index++; } } }