Move SSEStreamService 90/112690/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 22 Jul 2024 17:06:17 +0000 (19:06 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 22 Jul 2024 17:08:11 +0000 (19:08 +0200)
We have specific implementation requirements around SSE integration in
JAX-RS, most notably SSESender which uses a PingExecutor.

Separate these out into restconf.nb.jaxrs to reduce their exposure.

JIRA: NETCONF-773
Change-Id: Ia29e258e6b2f00297ec2a2d8bdc9df7dd83a1773
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/DefaultPingExecutor.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/DefaultPingExecutor.java with 97% similarity]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/PingExecutor.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/PingExecutor.java with 91% similarity]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/SSESender.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/SSESender.java with 99% similarity]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/SSEStreamService.java [moved from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/SSEStreamService.java with 94% similarity]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/OSGiNorthbound.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/DefaultRestconfStreamServletFactory.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/SSESessionHandlerTest.java [moved from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/SSESessionHandlerTest.java with 99% similarity]

similarity index 97%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/DefaultPingExecutor.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/DefaultPingExecutor.java
index 1b3a74e185fa63b47e38424bd5457ca93515db40..028f221dd176cc0a5661c65904e0584765945929 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.nb.rfc8040.streams;
+package org.opendaylight.restconf.nb.jaxrs;
 
 import static java.util.Objects.requireNonNull;
 
similarity index 91%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/PingExecutor.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/PingExecutor.java
index 864430ac75b734e8eac95788597373a0f5f6c1f1..fdcc6af355284d59101a6963a1bd0b4527f816f9 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.nb.rfc8040.streams;
+package org.opendaylight.restconf.nb.jaxrs;
 
 import java.util.concurrent.TimeUnit;
 import org.eclipse.jdt.annotation.NonNullByDefault;
similarity index 99%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/SSESender.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/SSESender.java
index e2972e782cc20d2153f8cabcb013c5fccbaf7f50..4fc0e4d0e2a7ab9c2c7c3e011d34aac5eac3521a 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.nb.rfc8040.streams;
+package org.opendaylight.restconf.nb.jaxrs;
 
 import static java.util.Objects.requireNonNull;
 
similarity index 94%
rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/SSEStreamService.java
rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/SSEStreamService.java
index 1df73145b89374e1eeea3f02eeb6ebf188cbeccd..a7485a98d96ff08db277b7e74514341174cc63dd 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.nb.rfc8040.streams;
+package org.opendaylight.restconf.nb.jaxrs;
 
 import static java.util.Objects.requireNonNull;
 
@@ -23,6 +23,7 @@ import javax.ws.rs.sse.Sse;
 import javax.ws.rs.sse.SseEventSink;
 import javax.xml.xpath.XPathExpressionException;
 import org.opendaylight.restconf.api.QueryParameters;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.restconf.server.api.EventStreamGetParams;
 import org.opendaylight.restconf.server.spi.RestconfStream;
 import org.opendaylight.restconf.server.spi.RestconfStream.EncodingName;
@@ -42,7 +43,7 @@ public final class SSEStreamService {
     private final int maximumFragmentLength;
     private final int heartbeatInterval;
 
-    SSEStreamService(final RestconfStream.Registry streamRegistry, final PingExecutor pingExecutor,
+    public SSEStreamService(final RestconfStream.Registry streamRegistry, final PingExecutor pingExecutor,
             final StreamsConfiguration configuration) {
         this.streamRegistry = requireNonNull(streamRegistry);
         this.pingExecutor = requireNonNull(pingExecutor);
index ac0779e86b87b1c8e98966f91e95c6d5b3c4375d..48eddb19cfa0e520eac207c9db4581f71b99c903 100644 (file)
@@ -11,7 +11,7 @@ import static java.util.Objects.requireNonNull;
 
 import java.util.Map;
 import org.opendaylight.restconf.api.query.PrettyPrintParam;
-import org.opendaylight.restconf.nb.rfc8040.streams.DefaultPingExecutor;
+import org.opendaylight.restconf.nb.jaxrs.DefaultPingExecutor;
 import org.opendaylight.restconf.nb.rfc8040.streams.DefaultRestconfStreamServletFactory;
 import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.osgi.framework.FrameworkUtil;
index 386f5c5c426c73193a419bda5f8120135ad7c3c7..c921c88322a351a3eda31127760746c86ee86324 100644 (file)
@@ -16,6 +16,8 @@ import javax.ws.rs.core.Application;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.aaa.web.servlet.ServletSupport;
 import org.opendaylight.restconf.api.query.PrettyPrintParam;
+import org.opendaylight.restconf.nb.jaxrs.DefaultPingExecutor;
+import org.opendaylight.restconf.nb.jaxrs.SSEStreamService;
 import org.opendaylight.restconf.nb.rfc8040.ErrorTagMapping;
 import org.opendaylight.restconf.server.spi.RestconfStream;
 import org.osgi.service.component.annotations.Activate;
similarity index 99%
rename from restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/streams/SSESessionHandlerTest.java
rename to restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/jaxrs/SSESessionHandlerTest.java
index feca29166938d88b4aee48042dfbcc8219696d31..96774825ef6f08ca1a6d9cd3f69c97568b779338 100644 (file)
@@ -5,7 +5,7 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-package org.opendaylight.restconf.nb.rfc8040.streams;
+package org.opendaylight.restconf.nb.jaxrs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;