Fix Main Vulnerabilities
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / InternalServlet.java
index c35978b..0d8ed66 100644 (file)
@@ -156,6 +156,7 @@ import static org.onap.dmaap.datarouter.provisioning.utils.HttpServletUtils.send
 @SuppressWarnings("serial")
 public class InternalServlet extends ProxyServlet {
 
+    private static final Object lock = new Object();
     private static Integer logseq = 0; // another piece of info to make log spool file names unique
     //Adding EELF Logger Rally:US664892
     private static EELFLogger eelflogger = EELFManager.getInstance()
@@ -181,11 +182,7 @@ public class InternalServlet extends ProxyServlet {
         String path = req.getPathInfo();
         if (path.startsWith("/api/")) {
             if (isProxyOK(req) && isProxyServer()) {
-                try {
-                    super.doDelete(req, resp);
-                } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
-                }
+                super.doDelete(req, resp);
                 return;
             }
             String key = path.substring(5);
@@ -252,12 +249,8 @@ public class InternalServlet extends ProxyServlet {
         }
         if (path.equals("/prov")) {
             if (isProxyOK(req) && isProxyServer()) {
-                try {
-                    if (super.doGetWithFallback(req, resp)) {
-                        return;
-                    }
-                } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
+                if (super.doGetWithFallback(req, resp)) {
+                    return;
                 }
                 // fall back to returning the local data if the remote is unreachable
                 intlogger.info("Active server unavailable; falling back to local copy.");
@@ -304,11 +297,7 @@ public class InternalServlet extends ProxyServlet {
         }
         if (path.startsWith("/api/")) {
             if (isProxyOK(req) && isProxyServer()) {
-                try {
-                    super.doGet(req, resp);
-                } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
-                }
+                super.doGet(req, resp);
                 return;
             }
             String key = path.substring(5);
@@ -360,11 +349,7 @@ public class InternalServlet extends ProxyServlet {
         String path = req.getPathInfo();
         if (path.startsWith("/api/")) {
             if (isProxyOK(req) && isProxyServer()) {
-                try {
-                    super.doPut(req, resp);
-                } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
-                }
+                super.doPut(req, resp);
                 return;
             }
             String key = path.substring(5);
@@ -413,11 +398,7 @@ public class InternalServlet extends ProxyServlet {
         String path = req.getPathInfo();
         if (path.startsWith("/api/")) {
             if (isProxyOK(req) && isProxyServer()) {
-                try {
-                    super.doPost(req, resp);
-                } catch (IOException ioe) {
-                    intlogger.error("IOException" + ioe.getMessage());
-                }
+                super.doPost(req, resp);
                 return;
             }
             String key = path.substring(5);
@@ -454,7 +435,7 @@ public class InternalServlet extends ProxyServlet {
             }
             String spooldir = (new DB()).getProperties().getProperty("org.onap.dmaap.datarouter.provserver.spooldir");
             String spoolname = String.format("%d-%d-", System.currentTimeMillis(), Thread.currentThread().getId());
-            synchronized (logseq) {
+            synchronized (lock) {
                 // perhaps unnecessary, but it helps make the name unique
                 spoolname += logseq.toString();
                 logseq++;