Merge "cleanup apigateway code"
diff --git a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/AaiServlet.java b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/AaiServlet.java
index 0cdf79d..219e75a 100644
--- a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/AaiServlet.java
+++ b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/AaiServlet.java
@@ -27,9 +27,6 @@
public class AaiServlet extends BaseServlet {
- /**
- *
- */
private static final long serialVersionUID = 5946205120796162644L;
private static final String OFFLINE_RESPONSE_MESSAGE = "AAI interface is offline";
private static boolean trustAll = false;
diff --git a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/BaseServlet.java b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/BaseServlet.java
index dab7ad7..7c8a9a1 100644
--- a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/BaseServlet.java
+++ b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/BaseServlet.java
@@ -32,7 +32,6 @@
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
-
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
@@ -41,15 +40,11 @@
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class BaseServlet extends HttpServlet {
- /**
- *
- */
private static final long serialVersionUID = 7403047480257892794L;
private static Logger LOG = LoggerFactory.getLogger(BaseServlet.class);
private static SSLContext sc;
@@ -66,11 +61,6 @@
protected abstract String getRemoteUrl(String uri);
- /**
- *
- * @throws NoSuchAlgorithmException
- * @throws KeyManagementException
- */
private static void setupSslTrustAll(boolean trustall) throws NoSuchAlgorithmException, KeyManagementException {
sc = SSLContext.getInstance("TLSv1.2");
diff --git a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/EsServlet.java b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/EsServlet.java
index 5db305e..f3871a5 100644
--- a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/EsServlet.java
+++ b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/EsServlet.java
@@ -25,17 +25,10 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
public class EsServlet extends BaseServlet {
- /**
- *
- */
private static final long serialVersionUID = -3996363343749995011L;
private static final String OFFLINE_RESPONSE_MESSAGE = "Database interface is offline";
- private static Logger LOG = LoggerFactory.getLogger(EsServlet.class);
private static boolean trustAll = false;
diff --git a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/MyProperties.java b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/MyProperties.java
index d49b4dc..d644c63 100644
--- a/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/MyProperties.java
+++ b/sdnr/wt/apigateway/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/apigateway/MyProperties.java
@@ -28,7 +28,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,12 +42,6 @@
private static final String DEFAULT_ESDATABASE = "http://sdnrdb:9200";
private static final String DEFAULT_AAI = "off";
- @Override
- public String toString() {
- return "MyProperties [aaiBase=" + aaiBase + ", aaiHeaders=" + aaiHeaders + ", esBase=" + esBase
- + ", trustInsecure=" + trustInsecure + ", corsEnabled=" + corsEnabled + "]";
- }
-
private static MyProperties mObj;
private String aaiBase;
@@ -168,4 +161,9 @@
return mObj;
}
+ @Override
+ public String toString() {
+ return "MyProperties [aaiBase=" + aaiBase + ", aaiHeaders=" + aaiHeaders + ", esBase=" + esBase
+ + ", trustInsecure=" + trustInsecure + ", corsEnabled=" + corsEnabled + "]";
+ }
}
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestAaiServlet.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestAaiServlet.java
index 06bf2c1..3436c36 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestAaiServlet.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestAaiServlet.java
@@ -23,9 +23,7 @@
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
-
import javax.servlet.ServletException;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestDatabaseServlet.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestDatabaseServlet.java
index bc6859a..45eac88 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestDatabaseServlet.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestDatabaseServlet.java
@@ -26,7 +26,6 @@
import org.onap.ccsdk.features.sdnr.wt.apigateway.MyProperties;
import org.onap.ccsdk.features.sdnr.wt.apigateway.test.helper.HelpEsServlet;
import org.onap.ccsdk.features.sdnr.wt.apigateway.test.helper.HelpServletBase;
-
import java.io.*;
import javax.servlet.ServletException;
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestProperties.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestProperties.java
index 6fad884..761afe2 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestProperties.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/TestProperties.java
@@ -21,12 +21,10 @@
package org.onap.ccsdk.features.sdnr.wt.apigateway.test;
import static org.junit.Assert.*;
-
import java.io.ByteArrayInputStream;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
-
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpAaiServlet.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpAaiServlet.java
index f6987b2..5d4c8f5 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpAaiServlet.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpAaiServlet.java
@@ -21,15 +21,14 @@
package org.onap.ccsdk.features.sdnr.wt.apigateway.test.helper;
import java.io.IOException;
-
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import org.onap.ccsdk.features.sdnr.wt.apigateway.AaiServlet;
public class HelpAaiServlet extends AaiServlet implements IPublicServlet {
+ private static final long serialVersionUID = 1L;
public static final String RESPONSE_GET = "This is the response get";
public static final String RESPONSE_POST = "This is the response post";
public static final String RESPONSE_PUT = "This is the response put";
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpEsServlet.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpEsServlet.java
index 901dd58..fe89c9f 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpEsServlet.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpEsServlet.java
@@ -21,15 +21,15 @@
package org.onap.ccsdk.features.sdnr.wt.apigateway.test.helper;
import java.io.IOException;
-
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import org.onap.ccsdk.features.sdnr.wt.apigateway.EsServlet;
public class HelpEsServlet extends EsServlet implements IPublicServlet {
+ private static final long serialVersionUID = 6502905928958752573L;
+
public static final String RESPONSE_GET = "This is the response get";
public static final String RESPONSE_POST = "This is the response post";
public static final String RESPONSE_PUT = "This is the response put";
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServlet.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServlet.java
index ddab06a..eeff762 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServlet.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServlet.java
@@ -25,12 +25,13 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-
import org.onap.ccsdk.features.sdnr.wt.apigateway.EsServlet;
public class HelpServlet extends EsServlet {
- @Override
+ private static final long serialVersionUID = 1L;
+
+ @Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doGet(req, resp);
}
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServletBase.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServletBase.java
index 0bc42c3..b12281e 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServletBase.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/HelpServletBase.java
@@ -49,6 +49,7 @@
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
+@SuppressWarnings("restriction")
public class HelpServletBase {
public static final String HTTPMETHOD_GET = "GET";
diff --git a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/IPublicServlet.java b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/IPublicServlet.java
index 86a9467..bf7fc56 100644
--- a/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/IPublicServlet.java
+++ b/sdnr/wt/apigateway/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/apigateway/test/helper/IPublicServlet.java
@@ -23,7 +23,6 @@
package org.onap.ccsdk.features.sdnr.wt.apigateway.test.helper;
import java.io.IOException;
-
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;