aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Dürre <michael.duerre@highstreet-technologies.com>2023-04-06 11:38:19 +0200
committerMichael Dürre <michael.duerre@highstreet-technologies.com>2023-04-06 11:38:30 +0200
commitb41fae1eee6521287a8f5a9ff0b9a2f33f7a4a5f (patch)
treed1e920c3950cae811235f1499445c4a8d8addf8f
parent122ea4172fc5497c51898f4d37315ebd71e1d01a (diff)
fix odlux core servlets
add whiteboard annotations Issue-ID: CCSDK-3886 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com> Change-Id: I40e85179f4d353adffede90e2e3f2c4c181b8ce2 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
-rw-r--r--sdnr/wt/odlux/core/provider/pom.xml10
-rw-r--r--sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java8
-rw-r--r--sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java7
-rw-r--r--sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml14
4 files changed, 25 insertions, 14 deletions
diff --git a/sdnr/wt/odlux/core/provider/pom.xml b/sdnr/wt/odlux/core/provider/pom.xml
index 0b07aa542..36a8df32b 100644
--- a/sdnr/wt/odlux/core/provider/pom.xml
+++ b/sdnr/wt/odlux/core/provider/pom.xml
@@ -72,8 +72,8 @@
<artifactId>guava</artifactId>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
+ <groupId>jakarta.servlet</groupId>
+ <artifactId>jakarta.servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
@@ -96,6 +96,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ <version>7.0.0</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<build>
diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java
index a7cc2ac82..b88a01225 100644
--- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java
+++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/IndexServlet.java
@@ -22,13 +22,21 @@ import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.nio.file.Files;
+import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletName;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletPattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@HttpWhiteboardServletPattern({"/favicon.ico","/index2.html"})
+@HttpWhiteboardServletName("IndexServlet")
+@Component(service = Servlet.class)
public class IndexServlet extends HttpServlet {
private static final long serialVersionUID = 3039669437157215355L;
diff --git a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
index c9d8a2d20..8d4e05a96 100644
--- a/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
+++ b/sdnr/wt/odlux/core/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/odlux/ResFilesServlet.java
@@ -22,14 +22,21 @@ import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
+import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletName;
+import org.osgi.service.http.whiteboard.propertytypes.HttpWhiteboardServletPattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@HttpWhiteboardServletPattern("/odlux/*")
+@HttpWhiteboardServletName("ResFilesServlet")
+@Component(service = Servlet.class)
public class ResFilesServlet extends HttpServlet {
private static final long serialVersionUID = -6807215213921798293L;
diff --git a/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml
index 250be6017..d06b77fb5 100644
--- a/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml
+++ b/sdnr/wt/odlux/core/provider/src/main/resources/OSGI-INF/blueprint/blueprint.xml
@@ -22,7 +22,7 @@
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
- <bean id="indexServlet"
+<!-- <bean id="indexServlet"
class="org.onap.ccsdk.features.sdnr.wt.odlux.IndexServlet">
</bean>
@@ -30,27 +30,17 @@
<service-properties>
<entry key="alias" value="/index2.html"/>
</service-properties>
- </service>
+ </service>-->
<bean id="indexServlet2"
class="org.onap.ccsdk.features.sdnr.wt.odlux.IndexServlet">
</bean>
- <service interface="javax.servlet.http.HttpServlet" ref="indexServlet2">
- <service-properties>
- <entry key="alias" value="/favicon.ico"/>
- </service-properties>
- </service>
<bean id="resFilesServlet"
class="org.onap.ccsdk.features.sdnr.wt.odlux.ResFilesServlet">
</bean>
- <service interface="javax.servlet.http.HttpServlet" ref="resFilesServlet">
- <service-properties>
- <entry key="alias" value="/odlux"/>
- </service-properties>
- </service>
<bean id="loadersvc" class="org.onap.ccsdk.features.sdnr.wt.odlux.OdluxBundleLoaderImpl"/>
<service id="serviceRegistration" interface="org.onap.ccsdk.features.sdnr.wt.odlux.model.bundles.OdluxBundleLoader" ref="loadersvc"/>