X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=POLICY-SDK-APP%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fcontroller%2FActionPolicyController.java;h=c83cb777df6efba2d30dbc3b1ee7c70ebf9262e5;hp=9f89ea0cf2566a2bed82f825f8ce1b25a472e9f0;hb=f36e53a3637e1204a42491ec0eeed7b3c763f681;hpb=b86c95c99240e8ed0ef91932a70ebed313dbd60c diff --git a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/ActionPolicyController.java b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/ActionPolicyController.java index 9f89ea0cf..c83cb777d 100644 --- a/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/ActionPolicyController.java +++ b/POLICY-SDK-APP/src/main/java/org/onap/policy/controller/ActionPolicyController.java @@ -8,9 +8,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -36,7 +36,6 @@ import oasis.names.tc.xacml._3_0.core.schema.wd_17.ApplyType; 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.ConditionType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionType; import oasis.names.tc.xacml._3_0.core.schema.wd_17.ObligationExpressionsType; @@ -66,6 +65,11 @@ public class ActionPolicyController extends RestrictedBaseController { // Default Constructor } + /** + * prePopulateActionPolicyData. + * + * @param policyAdapter PolicyRestAdapter + */ public void prePopulateActionPolicyData(PolicyRestAdapter policyAdapter) { ruleAlgorithmList = new ArrayList<>(); performer.put("PDP", "PDPAction"); @@ -152,11 +156,10 @@ public class ActionPolicyController extends RestrictedBaseController { policyAdapter.setPolicyDescription(description); } - private void setPolicyAdapterRuleAlgorithmschoices(PolicyRestAdapter policyAdapter, RuleType o) { - ConditionType condition = o.getCondition(); - if (condition != null) { + private void setPolicyAdapterRuleAlgorithmschoices(PolicyRestAdapter policyAdapter, RuleType ruleType) { + if (ruleType.getCondition() != null) { int index = 0; - ApplyType actionApply = (ApplyType) condition.getExpression().getValue(); + ApplyType actionApply = (ApplyType) ruleType.getCondition().getExpression().getValue(); ruleAlgorithmTracker = new LinkedList<>(); // Populating Rule Algorithms starting from compound. prePopulateCompoundRuleAlgorithm(index, actionApply);