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%2Fcomponents%2FFirewallConfigPolicy.java;fp=ONAP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FFirewallConfigPolicy.java;h=d95b36709aa68c0f2596aff6b53d56d773bb8303;hb=24c6b1682bb59691f8d5e631b1074355b7d82a54;hp=0c8784c8151e76f2cdb82581def84b628c21854b;hpb=461b2b7eeca1586423349bc0c4c65f80f027292d;p=policy%2Fengine.git diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java index 0c8784c81..d95b36709 100644 --- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java +++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java @@ -62,6 +62,7 @@ import org.onap.policy.rest.jpa.ServiceList; import org.onap.policy.rest.jpa.TermList; import org.onap.policy.rest.jpa.UserInfo; +import com.att.research.xacml.api.pap.PAPException; import com.att.research.xacml.std.IdentifierImpl; import com.fasterxml.jackson.databind.JsonNode; import com.github.fge.jackson.JsonLoader; @@ -129,7 +130,7 @@ public class FirewallConfigPolicy extends Policy { } @Override - public Map savePolicies() throws Exception { + public Map savePolicies() throws PAPException { Map successMap = new HashMap<>(); if(isPolicyExists()){ successMap.put("EXISTS", "This Policy already exist on the PAP"); @@ -147,7 +148,11 @@ public class FirewallConfigPolicy extends Policy { if (policyAdapter.isEditPolicy()) { dbIsUpdated = updateFirewallDictionaryData(policyAdapter.getJsonBody(), policyAdapter.getPrevJsonBody()); } else { - dbIsUpdated = insertFirewallDicionaryData(policyAdapter.getJsonBody()); + try { + dbIsUpdated = insertFirewallDicionaryData(policyAdapter.getJsonBody()); + } catch (SQLException e) { + throw new PAPException(e); + } } } else { dbIsUpdated = true; @@ -174,7 +179,7 @@ public class FirewallConfigPolicy extends Policy { //This is the method for preparing the policy for saving. We have broken it out //separately because the fully configured policy is used for multiple things @Override - public boolean prepareToSave() throws Exception{ + public boolean prepareToSave() throws PAPException{ if(isPreparedToSave()){ //we have already done this