X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fhandler%2FSavePolicyHandler.java;fp=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fhandler%2FSavePolicyHandler.java;h=90f8b5a70b655f28c669c6446d2757138de47738;hb=2903daf20f5e473a96a36342151a26e9f2e55005;hp=2da84d75423a341f3d601b6da7fa5781d3fbbb8d;hpb=d71b3cf8a983a95fced20eed0cb09aea84aa1b3c;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java index 2da84d754..90f8b5a70 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/handler/SavePolicyHandler.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * ONAP-PAP-REST * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019 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. * 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. @@ -17,28 +17,25 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.onap.policy.pap.xacml.rest.handler; +import com.att.research.xacml.util.XACMLProperties; import java.io.IOException; import java.util.HashMap; - import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.parsers.ParserConfigurationException; - import org.onap.policy.common.logging.eelf.PolicyLogger; import org.onap.policy.common.logging.flexlogger.FlexLogger; import org.onap.policy.common.logging.flexlogger.Logger; -import org.onap.policy.pap.xacml.rest.XACMLPapServlet; import org.onap.policy.pap.xacml.rest.policycontroller.PolicyCreation; import org.onap.policy.rest.adapter.PolicyRestAdapter; import org.onap.policy.utils.PolicyUtils; import org.onap.policy.xacml.std.pap.StdPAPPolicy; import org.xml.sax.SAXException; -import com.att.research.xacml.util.XACMLProperties; - public class SavePolicyHandler { private static final Logger logger = FlexLogger.getLogger(SavePolicyHandler.class); private HashMap ErrorHeaders = null; @@ -76,7 +73,7 @@ public class SavePolicyHandler { try { PolicyLogger.info("SavePolicyHandler: Setting parameter values to PolicyAdapter"); policyAdapter = setDataToPolicyAdapter(policy, policyType, apiflag); - + if(!extendedPolicyOptions(policyAdapter, response)){ creation.savePolicy(policyAdapter, response); } @@ -106,7 +103,6 @@ public class SavePolicyHandler { policyAdapter.setPolicyType(policyType); policyAdapter.setDynamicFieldConfigAttributes(policy.getDynamicFieldConfigAttributes()); policyAdapter.setEditPolicy(policy.isEditPolicy()); - policyAdapter.setEntityManagerFactory(XACMLPapServlet.getEmf()); //Config Specific policyAdapter.setConfigName(policy.getConfigName()); //Base and Firewall policyAdapter.setConfigBodyData(policy.getConfigBodyData()); //Base @@ -139,7 +135,7 @@ public class SavePolicyHandler { policyAdapter.setDomainDir(policyAdapter.getPolicyScope()); policyAdapter.setRainydayMap(policy.getTreatments()); policyAdapter.setRawXacmlPolicy(policy.getRawXacmlPolicy()); - + return policyAdapter; }