import javax.xml.bind.JAXBElement;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.rest.adapter.PolicyRestAdapter;
import org.onap.policy.rest.jpa.PolicyEntity;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.portalsdk.core.controller.RestrictedBaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.PolicyType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.RuleType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.TargetType;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
@Controller
@RequestMapping({ "/" })
PolicyType policy = (PolicyType) policyData;
policyAdapter.setOldPolicyFileName(policyAdapter.getPolicyName());
String policyNameValue = policyAdapter.getPolicyName()
- .substring(policyAdapter.getPolicyName().indexOf("_") + 1);
+ .substring(policyAdapter.getPolicyName().indexOf('_') + 1);
policyAdapter.setPolicyName(policyNameValue);
String description = "";
try {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Prepopulating Compound rule algorithm: " + index);
}
- Map<String, String> rule = new HashMap<String, String>();
+ Map<String, String> rule = new HashMap<>();
for (String key : PolicyController.getDropDownMap().keySet()) {
String keyValue = PolicyController.getDropDownMap().get(key);
if (keyValue.equals(actionApply.getFunctionId())) {
}
private void prePopulateRuleAlgorithms(int index, ApplyType actionApply, List<JAXBElement<?>> jaxbActionTypes) {
- Map<String, String> ruleMap = new HashMap<String, String>();
+ Map<String, String> ruleMap = new HashMap<>();
ruleMap.put("id", "A" + (index + 1));
// Populate combo box
Map<String, String> dropDownMap = PolicyController.getDropDownMap();
ruleMap.put("dynamicRuleAlgorithmField2", attributeValue);
}
// Rule Attribute added as value
- else if (((jaxbActionTypes.get(0).getValue()) instanceof AttributeValueType)) {
+ else if ((jaxbActionTypes.get(0).getValue()) instanceof AttributeValueType) {
AttributeValueType actionConditionAttributeValue = (AttributeValueType) jaxbActionTypes.get(0).getValue();
String attributeValue = (String) actionConditionAttributeValue.getContent().get(0);
ruleMap.put("dynamicRuleAlgorithmField2", attributeValue);