X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ECOMP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fpap%2Fxacml%2Frest%2FXACMLPapServlet.java;h=c681c932534d5052af45da9cdec4cece860b2fa2;hb=a084c4de015521f842a3fef0d7f1f7c340237bc3;hp=4ceae062b15243ca7fc1bb342ed6ce6f2d4824d4;hpb=685ed1545ed28b777a3ba6e7d315b78f355154cb;p=policy%2Fengine.git diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServlet.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServlet.java index 4ceae062b..c681c9325 100644 --- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServlet.java +++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServlet.java @@ -1495,6 +1495,7 @@ public class XACMLPapServlet extends HttpServlet implements StdItemSetChangeList try{ doACPostTransaction.movePdp(pdp, group, "XACMLPapServlet.doACPost"); }catch(Exception e){ + doACPostTransaction.rollbackTransaction(); PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "XACMLPapServlet", " Error while moving pdp in the database: " +"pdp="+pdp.getId()+",to group="+group.getId()); @@ -1520,9 +1521,6 @@ public class XACMLPapServlet extends HttpServlet implements StdItemSetChangeList return; } } catch (PAPException e) { - if(doACPostTransaction != null){ - doACPostTransaction.rollbackTransaction(); - } PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "XACMLPapServlet", " AC POST exception"); loggingContext.transactionEnded(); PolicyLogger.audit("Transaction Failed - See Error.log"); @@ -1748,11 +1746,11 @@ public class XACMLPapServlet extends HttpServlet implements StdItemSetChangeList if (papEngine.getPDP(pdpId) == null) { // this is a request to create a new PDP object try{ - acPutTransaction.addPdpToGroup(pdp == null ? "PDP is null" : pdp.getId(), group.getId(), pdp.getName(), + acPutTransaction.addPdpToGroup(pdp.getId(), group.getId(), pdp.getName(), pdp.getDescription(), pdp.getJmxPort(),"XACMLPapServlet.doACPut"); } catch(Exception e){ PolicyLogger.error(MessageCodes.ERROR_PROCESS_FLOW, e, "XACMLPapServlet", " Error while adding pdp to group in the database: " - +"pdp="+ (pdp == null ? "PDP is null" : pdp.getId()) +",to group="+group.getId()); + +"pdp="+ (pdp.getId()) +",to group="+group.getId()); throw new PAPException(e.getMessage()); } papEngine.newPDP(pdp.getId(), group, pdp.getName(), pdp.getDescription(), pdp.getJmxPort());