diff options
Diffstat (limited to 'ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServlet.java')
-rw-r--r-- | ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/XACMLPapServlet.java | 8 |
1 files changed, 3 insertions, 5 deletions
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()); |