Convert to jersey 2 45/72245/4
authorTom Pantelis <tompantelis@gmail.com>
Thu, 24 May 2018 17:32:29 +0000 (13:32 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Wed, 30 May 2018 18:06:38 +0000 (14:06 -0400)
JIRA: TSC-113

Change-Id: Iaed173f251fc1a38dc42d10b9257cd4531598ed5
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
16 files changed:
features/restconf/odl-restconf-common/pom.xml
netconf/netconf-impl/pom.xml
netconf/netconf-ssh/pom.xml
netconf/yanglib/pom.xml
netconf/yanglib/src/main/java/org/opendaylight/yanglib/impl/WebInitializer.java
netconf/yanglib/src/main/resources/org/opendaylight/blueprint/yanglib.xml
restconf/restconf-nb-bierman02/pom.xml
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/web/Bierman02WebRegistrarImpl.java
restconf/restconf-nb-bierman02/src/main/resources/org/opendaylight/blueprint/restconf-config.xml
restconf/restconf-nb-rfc8040/pom.xml
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/web/WebInitializer.java
restconf/restconf-nb-rfc8040/src/main/resources/org/opendaylight/blueprint/restconf-bp.xml
restconf/restconf-parent/pom.xml
restconf/sal-rest-docgen/pom.xml
restconf/sal-rest-docgen/src/main/java/org/opendaylight/netconf/sal/rest/doc/jaxrs/WebInitializer.java
restconf/sal-rest-docgen/src/main/resources/org/opendaylight/blueprint/blueprint.xml

index 0df0d3940d92838f183b4c9750cd214d212ccf0e..ca460e29e8b8f49b8bb48fb4af3d4f0282ebd1c1 100644 (file)
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-server</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-servlet</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
index b449c573b657e9736ef2177b6709ae8a13c0a49b..28d8905249a09be3d748d562a53110ad3b358179 100644 (file)
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.compendium</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
index 3b854f85c38cbee3c7b6074695f0a2ed25f20b48..71938675361f093222175a103ebe0f49cfde2fd1 100644 (file)
         <groupId>org.osgi</groupId>
         <artifactId>org.osgi.compendium</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>org.osgi.core</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
index 787d901cfba2c5f8fd11222704ffaab1af2bfb0a..cb301d47f1906f118b8112d22f52456b341bbfbe 100644 (file)
             <artifactId>mockito-core</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.jboss.resteasy</groupId>
-            <artifactId>jaxrs-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-parser-impl</artifactId>
         <dependency>
             <groupId>org.opendaylight.aaa.web</groupId>
             <artifactId>web-api</artifactId>
-            </dependency>
+        </dependency>
         <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-servlet</artifactId>
+            <groupId>org.opendaylight.aaa.web</groupId>
+            <artifactId>servlet-api</artifactId>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
index b91791bee89b204e29ea6607a9b65ec602267012..87fe75cd491eeec9bb2564b367a153603aaa4ed9 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.aaa.web.WebContextBuilder;
 import org.opendaylight.aaa.web.WebContextRegistration;
 import org.opendaylight.aaa.web.WebContextSecurer;
 import org.opendaylight.aaa.web.WebServer;
+import org.opendaylight.aaa.web.servlet.ServletSupport;
 
 /**
  * Initializes the wep app.
@@ -24,11 +25,10 @@ import org.opendaylight.aaa.web.WebServer;
 public class WebInitializer {
     private final WebContextRegistration registration;
 
-    public WebInitializer(WebServer webServer,  WebContextSecurer webContextSecurer, Application webApp)
-            throws ServletException {
+    public WebInitializer(WebServer webServer,  WebContextSecurer webContextSecurer, ServletSupport servletSupport,
+            Application webApp) throws ServletException {
         WebContextBuilder webContextBuilder = WebContext.builder().contextPath("yanglib").supportsSessions(true)
-            .addServlet(ServletDetails.builder().servlet(
-                new com.sun.jersey.spi.container.servlet.ServletContainer(webApp))
+            .addServlet(ServletDetails.builder().servlet(servletSupport.createHttpServletBuilder(webApp).build())
                     .addUrlPattern("/*").build());
 
         webContextSecurer.requireAuthentication(webContextBuilder, "/*");
index 2b4fa600040de9c2a63fbc3e9736e13f29adac42..f4d9c1968b91c9c8be389e33eaee96010dff748b 100644 (file)
@@ -16,6 +16,7 @@
   <reference id="dataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
   <reference id="webServer" interface="org.opendaylight.aaa.web.WebServer"/>
   <reference id="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer"/>
+  <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
 
   <bean id="schemaRepository" class="org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository">
     <argument value="yang-library"/>
@@ -40,6 +41,7 @@
       destroy-method="close">
     <argument ref="webServer"/>
     <argument ref="webContextSecurer"/>
+    <argument ref="servletSupport"/>
     <argument ref="yangLibRestApp"/>
   </bean>
 </blueprint>
index 55bc5aab277517e28515ef14ac96197f7ce9ca7a..18f702c26f587d2f941fd9c24aec04ea4a5dce98 100644 (file)
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>restconf-common-models</artifactId>
-      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>restconf-common</artifactId>
-      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.glassfish.jersey.bundles.repackaged</groupId>
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>ietf-yang-library</artifactId>
-      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>ietf-restconf-monitoring</artifactId>
-      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.netconf</groupId>
       <artifactId>ietf-restconf</artifactId>
-      <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>net.java.dev.stax-utils</groupId>
     <dependency>
       <groupId>org.opendaylight.aaa.web</groupId>
       <artifactId>web-api</artifactId>
-      <version>0.8.0-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>org.opendaylight.aaa</groupId>
-      <artifactId>aaa-filterchain</artifactId>
+      <groupId>org.opendaylight.aaa.web</groupId>
+      <artifactId>servlet-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
+      <groupId>org.opendaylight.aaa</groupId>
+      <artifactId>aaa-filterchain</artifactId>
     </dependency>
     <dependency>
       <groupId>org.eclipse.jetty</groupId>
     <dependency>
       <groupId>org.skyscreamer</groupId>
       <artifactId>jsonassert</artifactId>
-      <version>1.5.0</version>
     </dependency>
   </dependencies>
 
index 034e26869fe9906535efa29e406a1d74ed22b767..9e41c62e06290c1cc2ddb07a0e43be93e57c9d66 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.aaa.web.WebContextBuilder;
 import org.opendaylight.aaa.web.WebContextRegistration;
 import org.opendaylight.aaa.web.WebContextSecurer;
 import org.opendaylight.aaa.web.WebServer;
+import org.opendaylight.aaa.web.servlet.ServletSupport;
 
 /**
  * Implementation of Bierman02WebRegistrar.
@@ -29,13 +30,16 @@ public class Bierman02WebRegistrarImpl implements Bierman02WebRegistrar {
     private WebContextRegistration registraton;
     private final WebServer webServer;
     private final WebContextSecurer webContextSecurer;
+    private final ServletSupport servletSupport;
     private final Application webApp;
     private final CustomFilterAdapterConfiguration customFilterAdapterConfig;
 
     public Bierman02WebRegistrarImpl(WebServer webServer,  WebContextSecurer webContextSecurer,
-            Application webApp, CustomFilterAdapterConfiguration customFilterAdapterConfig) {
+            ServletSupport servletSupport, Application webApp,
+            CustomFilterAdapterConfiguration customFilterAdapterConfig) {
         this.webServer = webServer;
         this.webContextSecurer = webContextSecurer;
+        this.servletSupport = servletSupport;
         this.webApp = webApp;
         this.customFilterAdapterConfig = customFilterAdapterConfig;
     }
@@ -58,8 +62,7 @@ public class Bierman02WebRegistrarImpl implements Bierman02WebRegistrar {
 
     private void register(boolean authenticate) {
         WebContextBuilder webContextBuilder = WebContext.builder().contextPath("restconf").supportsSessions(true)
-                .addServlet(ServletDetails.builder().servlet(
-                        new com.sun.jersey.spi.container.servlet.ServletContainer(webApp))
+                .addServlet(ServletDetails.builder().servlet(servletSupport.createHttpServletBuilder(webApp).build())
                     .addUrlPattern("/*").build())
 
                 // Allows user to add javax.servlet.Filter(s) in front of REST services
index afdc803d770f5185dd9cc6fc2e262f2caa1727f2..75163a821cf0db7750faadd37ea14583b9506597 100644 (file)
 
   <reference id="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer" />
 
+  <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
+
   <bean id="webRegistrar" class="org.opendaylight.netconf.sal.restconf.web.Bierman02WebRegistrarImpl"
           destroy-method="close">
     <argument ref="webServer"/>
     <argument ref="webContextSecurer"/>
+    <argument ref="servletSupport"/>
     <argument ref="restconfApplication"/>
     <argument ref="customFilterAdapterConfig"/>
   </bean>
index 9130a59986912ab92b8437fae198b617a670cd2a..83f562986968beae8f29c7a7bcc251c510ee7d9a 100644 (file)
     <dependency>
       <groupId>org.opendaylight.aaa.web</groupId>
       <artifactId>web-api</artifactId>
-      <version>0.8.0-SNAPSHOT</version>
     </dependency>
 
     <dependency>
-      <groupId>org.opendaylight.aaa</groupId>
-      <artifactId>aaa-filterchain</artifactId>
+      <groupId>org.opendaylight.aaa.web</groupId>
+      <artifactId>servlet-api</artifactId>
     </dependency>
 
     <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
+      <groupId>org.opendaylight.aaa</groupId>
+      <artifactId>aaa-filterchain</artifactId>
     </dependency>
 
     <dependency>
index 5339adc0ab3789bc239bb2f6f03236537cb51304..4f6b47a9b2412339c8158f235498f3fca082eec3 100644 (file)
@@ -18,6 +18,7 @@ import org.opendaylight.aaa.web.WebContextBuilder;
 import org.opendaylight.aaa.web.WebContextRegistration;
 import org.opendaylight.aaa.web.WebContextSecurer;
 import org.opendaylight.aaa.web.WebServer;
+import org.opendaylight.aaa.web.servlet.ServletSupport;
 
 /**
  * Initializes the rfc8040 web app endpoint.
@@ -27,11 +28,10 @@ import org.opendaylight.aaa.web.WebServer;
 public class WebInitializer {
     private final WebContextRegistration registration;
 
-    public WebInitializer(WebServer webServer,  WebContextSecurer webContextSecurer,
+    public WebInitializer(WebServer webServer,  WebContextSecurer webContextSecurer, ServletSupport servletSupport,
             Application webApp, CustomFilterAdapterConfiguration customFilterAdapterConfig) throws ServletException {
         WebContextBuilder webContextBuilder = WebContext.builder().contextPath("rests").supportsSessions(true)
-                .addServlet(ServletDetails.builder().servlet(
-                        new com.sun.jersey.spi.container.servlet.ServletContainer(webApp))
+                .addServlet(ServletDetails.builder().servlet(servletSupport.createHttpServletBuilder(webApp).build())
                     .addUrlPattern("/*").build())
 
                 // Allows user to add javax.servlet.Filter(s) in front of REST services
index e7719c4fa9bf88933f07717b6b2237086f775423..0a3a31e73922d6a70eda3752b4b6d2cbe33639b4 100644 (file)
 
   <reference id="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer" />
 
+  <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
+
   <bean id="webInitializer" class="org.opendaylight.restconf.nb.rfc8040.web.WebInitializer"
           destroy-method="close">
     <argument ref="webServer"/>
     <argument ref="webContextSecurer"/>
+    <argument ref="servletSupport"/>
     <argument ref="restconfApplication"/>
     <argument ref="customFilterAdapterConfig"/>
   </bean>
index a67a90c935e41edfcc3a8d64aa3984227b42caf4..d1c2ac50bb8d995e8e16c0df7acb2cc049ee8cce 100644 (file)
 
   <build>
     <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <configuration>
-          <classpathDependencyExcludes>
-            <!-- Removes com.sun.jersey from testing classpath so there is no conflict with org.glassfish.jersey -->
-            <classpathDependencyExclude>com.sun.jersey</classpathDependencyExclude>
-          </classpathDependencyExcludes>
-        </configuration>
-      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-checkstyle-plugin</artifactId>
index a4a3e1ffd3be333557fe7a837a1a79b120aa26d9..aaf67c3f18ca7b770ac3c48238b75a4e1b63f866 100644 (file)
       <artifactId>guava</artifactId>
     </dependency>
 
-    <!-- Jax rs -->
-    <dependency>
-      <groupId>org.jboss.resteasy</groupId>
-      <artifactId>jaxrs-api</artifactId>
-    </dependency>
-
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-core-api</artifactId>
     <dependency>
       <groupId>org.opendaylight.aaa</groupId>
       <artifactId>aaa-shiro</artifactId>
-      <version>0.8.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.aaa.web</groupId>
       <artifactId>web-api</artifactId>
-      <version>0.8.0-SNAPSHOT</version>
     </dependency>
     <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-servlet</artifactId>
+      <groupId>org.opendaylight.aaa.web</groupId>
+      <artifactId>servlet-api</artifactId>
     </dependency>
   </dependencies>
 
index d33524f87dbabad5ae17add34988aeed2e109906..5a17fd7ec6f9f6ae429376351583cb7fdd4d2274 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.aaa.web.WebContextBuilder;
 import org.opendaylight.aaa.web.WebContextRegistration;
 import org.opendaylight.aaa.web.WebContextSecurer;
 import org.opendaylight.aaa.web.WebServer;
+import org.opendaylight.aaa.web.servlet.ServletSupport;
 
 /**
  * Initializes the wep app.
@@ -25,11 +26,10 @@ import org.opendaylight.aaa.web.WebServer;
 public class WebInitializer {
     private final WebContextRegistration registration;
 
-    public WebInitializer(WebServer webServer,  WebContextSecurer webContextSecurer, Application webApp)
-            throws ServletException {
+    public WebInitializer(WebServer webServer,  WebContextSecurer webContextSecurer, ServletSupport servletSupport,
+            Application webApp) throws ServletException {
         WebContextBuilder webContextBuilder = WebContext.builder().contextPath("apidoc").supportsSessions(true)
-            .addServlet(ServletDetails.builder().servlet(
-                new com.sun.jersey.spi.container.servlet.ServletContainer(webApp))
+            .addServlet(ServletDetails.builder().servlet(servletSupport.createHttpServletBuilder(webApp).build())
                     .addUrlPattern("/apis/*").addUrlPattern("/18/apis/*").build())
             .addResource(ResourceDetails.builder().name("/explorer").build())
             .addResource(ResourceDetails.builder().name("/18/explorer").build());
index f365c1825f88247e472d9aebe7dbcf7c3b631d57..8fa2d15ce45591ea6367568882f1dc70eae04950 100644 (file)
@@ -15,6 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <reference id="domMountPointService" interface="org.opendaylight.controller.md.sal.dom.api.DOMMountPointService"/>
     <reference id="webServer" interface="org.opendaylight.aaa.web.WebServer"/>
     <reference id="webContextSecurer" interface="org.opendaylight.aaa.web.WebContextSecurer"/>
+    <reference id="servletSupport" interface="org.opendaylight.aaa.web.servlet.ServletSupport" />
 
     <bean id="mountPointDraft02" class="org.opendaylight.netconf.sal.rest.doc.impl.MountPointSwaggerGeneratorDraft02"
             destroy-method="close">
@@ -51,6 +52,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
             destroy-method="close">
         <argument ref="webServer"/>
         <argument ref="webContextSecurer"/>
+        <argument ref="servletSupport"/>
         <argument ref="apiDocApplication"/>
   </bean>
 </blueprint>