diff options
author | 2017-09-07 19:21:28 -0400 | |
---|---|---|
committer | 2017-09-08 00:51:01 -0400 | |
commit | 24c6b1682bb59691f8d5e631b1074355b7d82a54 (patch) | |
tree | 50a5db354050faf79ccc7e7e9a08e488163651aa /ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java | |
parent | 461b2b7eeca1586423349bc0c4c65f80f027292d (diff) |
Sonar Fixes
Fixes to the sonar issues along with some cleanup code to remove warnings.
Issue-Id: POLICY-113
Change-Id: I826562f7509c346210ac865cc6b31bce26bee2cf
Signed-off-by: Tej, Tarun <tt3868@att.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java')
-rw-r--r-- | ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/components/FirewallConfigPolicy.java | 11 |
1 files changed, 8 insertions, 3 deletions
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<String, String> savePolicies() throws Exception { + public Map<String, String> savePolicies() throws PAPException { Map<String, String> 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 |