Turn streams.Configuration into a record 36/104336/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 8 Feb 2023 22:51:52 +0000 (23:51 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 8 Feb 2023 23:28:02 +0000 (00:28 +0100)
This is a pure data holder, convert it to a record. Also rename to
StreamsConfiguration to ensure naming conflicts do not occur.

JIRA: NETCONF-958
Change-Id: I01a203aeab692911799eb24ac4bcadcb029bf1f4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/JaxRsNorthbound.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/RestconfApplication.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataStreamServiceImpl.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfInvokeOperationsServiceImpl.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfStreamsSubscriptionServiceImpl.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/Configuration.java [deleted file]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/StreamsConfiguration.java [new file with mode: 0644]
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/WebSocketInitializer.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/Netconf799Test.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImplTest.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfInvokeOperationsServiceImplTest.java
restconf/restconf-nb/src/test/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfStreamsSubscriptionServiceImplTest.java

index 8f3ca53fe3b010ea28774d6d7e07b475e7a0d14c..66e1132baa89ab61f9d4dbb33dc8420b70077c10 100644 (file)
@@ -32,7 +32,7 @@ import org.opendaylight.mdsal.dom.api.DOMRpcService;
 import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataStreamServiceImpl;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.restconf.nb.rfc8040.streams.WebSocketInitializer;
 import org.opendaylight.yangtools.concepts.Registration;
 
@@ -52,7 +52,8 @@ public final class JaxRsNorthbound implements AutoCloseable {
             final DatabindProvider databindProvider,
             final String pingNamePrefix, final int pingMaxThreadCount, final int maximumFragmentLength,
             final int heartbeatInterval, final int idleTimeout, final boolean useSSE) throws ServletException {
-        final var configuration = new Configuration(maximumFragmentLength, idleTimeout, heartbeatInterval, useSSE);
+        final var streamsConfiguration = new StreamsConfiguration(maximumFragmentLength, idleTimeout, heartbeatInterval,
+            useSSE);
         final var scheduledThreadPool = new ScheduledThreadPoolWrapper(pingMaxThreadCount,
             new NamingThreadPoolFactory(pingNamePrefix));
 
@@ -64,21 +65,21 @@ public final class JaxRsNorthbound implements AutoCloseable {
                 .addUrlPattern("/*")
                 .servlet(servletSupport.createHttpServletBuilder(
                     new RestconfApplication(databindProvider, mountPointService, dataBroker, rpcService, actionService,
-                        notificationService,schemaService, configuration)).build())
+                        notificationService,schemaService, streamsConfiguration)).build())
                 .asyncSupported(true)
                 .build())
             .addServlet(ServletDetails.builder()
                 .addUrlPattern("/" + NOTIF + "/*")
                 .servlet(servletSupport.createHttpServletBuilder(
                     new DataStreamApplication(databindProvider, mountPointService,
-                        new RestconfDataStreamServiceImpl(scheduledThreadPool, configuration))).build())
+                        new RestconfDataStreamServiceImpl(scheduledThreadPool, streamsConfiguration))).build())
                 .name("notificationServlet")
                 .asyncSupported(true)
                 .build())
             .addServlet(ServletDetails.builder()
                 .addUrlPattern("/" + DATA_SUBSCRIPTION + "/*")
                 .addUrlPattern("/" + NOTIFICATION_STREAM + "/*")
-                .servlet(new WebSocketInitializer(scheduledThreadPool, configuration))
+                .servlet(new WebSocketInitializer(scheduledThreadPool, streamsConfiguration))
                 .build())
 
             // Allows user to add javax.servlet.Filter(s) in front of REST services
index 3405f1227232d5d1333745bfb317eea95f71f7f2..59f36b70bdaf9f3c6f7ce2d50cdb5ee2da01e5bc 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfInvokeOp
 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfOperationsServiceImpl;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfSchemaServiceImpl;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfStreamsSubscriptionServiceImpl;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 
 @Singleton
 public class RestconfApplication extends AbstractRestconfApplication {
@@ -32,7 +32,7 @@ public class RestconfApplication extends AbstractRestconfApplication {
             final RestconfStreamsSubscriptionService streamSubscription, final DOMDataBroker dataBroker,
             final DOMRpcService rpcService, final DOMActionService actionService,
             final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
-            final Configuration configuration) {
+            final StreamsConfiguration configuration) {
         super(databindProvider, mountPointService, List.of(
             streamSubscription,
             new RestconfDataServiceImpl(databindProvider, dataBroker, mountPointService, streamSubscription,
@@ -47,7 +47,7 @@ public class RestconfApplication extends AbstractRestconfApplication {
     public RestconfApplication(final DatabindProvider databindProvider, final DOMMountPointService mountPointService,
             final DOMDataBroker dataBroker, final DOMRpcService rpcService, final DOMActionService actionService,
             final DOMNotificationService notificationService, final DOMSchemaService domSchemaService,
-            final Configuration configuration) {
+            final StreamsConfiguration configuration) {
         this(databindProvider, mountPointService,
             new RestconfStreamsSubscriptionServiceImpl(dataBroker, notificationService, databindProvider,
                 configuration),
index 0e6b10108e729450f947b1fbf5d7e3f4396719b4..0eb3ab7ee63b0a34b41abcbf1a060735f807fd0e 100644 (file)
@@ -64,7 +64,7 @@ import org.opendaylight.restconf.nb.rfc8040.rests.utils.PlainPatchDataTransactio
 import org.opendaylight.restconf.nb.rfc8040.rests.utils.PostDataTransactionUtil;
 import org.opendaylight.restconf.nb.rfc8040.rests.utils.PutDataTransactionUtil;
 import org.opendaylight.restconf.nb.rfc8040.rests.utils.ReadDataTransactionUtil;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.NotificationListenerAdapter;
 import org.opendaylight.restconf.nb.rfc8040.utils.mapping.RestconfMappingNodeUtil;
 import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier;
@@ -110,14 +110,14 @@ public class RestconfDataServiceImpl implements RestconfDataService {
     public RestconfDataServiceImpl(final DatabindProvider databindProvider,
             final DOMDataBroker dataBroker, final DOMMountPointService  mountPointService,
             final RestconfStreamsSubscriptionService delegRestconfSubscrService,
-            final DOMActionService actionService, final Configuration configuration) {
+            final DOMActionService actionService, final StreamsConfiguration configuration) {
         this.databindProvider = requireNonNull(databindProvider);
         this.dataBroker = requireNonNull(dataBroker);
         restconfStrategy = new MdsalRestconfStrategy(dataBroker);
         this.mountPointService = requireNonNull(mountPointService);
         this.delegRestconfSubscrService = requireNonNull(delegRestconfSubscrService);
         this.actionService = requireNonNull(actionService);
-        streamUtils = configuration.isUseSSE() ? SubscribeToStreamUtil.serverSentEvents()
+        streamUtils = configuration.useSSE() ? SubscribeToStreamUtil.serverSentEvents()
                 : SubscribeToStreamUtil.webSockets();
     }
 
index 9aa37c73cb7cf013bdbebded253eda8ac5b85ad8..a461232b00f669118214a1908e65fa67433f6550 100644 (file)
@@ -17,8 +17,8 @@ import org.opendaylight.controller.config.threadpool.ScheduledThreadPool;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfDataStreamService;
 import org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsConstants;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
 import org.opendaylight.restconf.nb.rfc8040.streams.SSESessionHandler;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.BaseListenerInterface;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenersBroker;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
@@ -40,10 +40,10 @@ public class RestconfDataStreamServiceImpl implements RestconfDataStreamService
 
     @Inject
     public RestconfDataStreamServiceImpl(final ScheduledThreadPool scheduledThreadPool,
-            final Configuration configuration) {
+            final StreamsConfiguration configuration) {
         executorService = scheduledThreadPool.getExecutor();
-        heartbeatInterval = configuration.getHeartbeatInterval();
-        maximumFragmentLength = configuration.getMaximumFragmentLength();
+        heartbeatInterval = configuration.heartbeatInterval();
+        maximumFragmentLength = configuration.maximumFragmentLength();
     }
 
     @Override
index a25538794aee65d55dc668d8eb6fcac8f0678d58..e8b28f32521fd0866b34bc10381e30f6f9b6a088 100644 (file)
@@ -33,7 +33,7 @@ import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfInvokeOperationsService;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.device.notification.rev221106.SubscribeDeviceNotificationInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.remote.rev140114.CreateDataChangeEventSubscriptionInput;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
@@ -67,10 +67,10 @@ public class RestconfInvokeOperationsServiceImpl implements RestconfInvokeOperat
     private final SubscribeToStreamUtil streamUtils;
 
     public RestconfInvokeOperationsServiceImpl(final DOMRpcService rpcService,
-            final DOMMountPointService mountPointService, final Configuration configuration) {
+            final DOMMountPointService mountPointService, final StreamsConfiguration configuration) {
         this.rpcService = requireNonNull(rpcService);
         this.mountPointService = requireNonNull(mountPointService);
-        streamUtils = configuration.isUseSSE() ? SubscribeToStreamUtil.serverSentEvents()
+        streamUtils = configuration.useSSE() ? SubscribeToStreamUtil.serverSentEvents()
             : SubscribeToStreamUtil.webSockets();
     }
 
index 6a99a52c45e7954dd6c0d1db84ac667cd1fe2bd4..de030d0ea289e8f48e5e17e82f823b9231f2a78f 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.restconf.nb.rfc8040.databind.jaxrs.QueryParams;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService;
 import org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsConstants;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
@@ -48,13 +48,13 @@ public class RestconfStreamsSubscriptionServiceImpl implements RestconfStreamsSu
      * @param dataBroker {@link DOMDataBroker}
      * @param notificationService {@link DOMNotificationService}
      * @param databindProvider a {@link DatabindProvider}
-     * @param configuration configuration for RESTCONF {@link Configuration}}
+     * @param configuration configuration for RESTCONF {@link StreamsConfiguration}}
      */
     public RestconfStreamsSubscriptionServiceImpl(final DOMDataBroker dataBroker,
             final DOMNotificationService notificationService, final DatabindProvider databindProvider,
-            final Configuration configuration) {
+            final StreamsConfiguration configuration) {
         handlersHolder = new HandlersHolder(dataBroker, notificationService, databindProvider);
-        streamUtils = configuration.isUseSSE() ? SubscribeToStreamUtil.serverSentEvents()
+        streamUtils = configuration.useSSE() ? SubscribeToStreamUtil.serverSentEvents()
                 : SubscribeToStreamUtil.webSockets();
     }
 
diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/Configuration.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/Configuration.java
deleted file mode 100644 (file)
index e22f419..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright © 2019 FRINX s.r.o. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import com.google.common.base.MoreObjects;
-
-/**
- * Restconf configuration holder and verifier.
- */
-public class Configuration {
-
-    private static final int MAX_FRAGMENT_LENGTH = 65535;
-
-    private final int maximumFragmentLength;
-    private final int idleTimeout;
-    private final int heartbeatInterval;
-    private final boolean useSSE;
-
-    /**
-     * Creation of the restconf configuration holder with verification of input parameters.
-     *
-     * @param maximumFragmentLength Maximum web-socket fragment length in number of Unicode code units (characters)
-     *                              (exceeded message length leads to fragmentation of messages).
-     * @param idleTimeout           Maximum idle time of web-socket session before the session is closed (milliseconds).
-     * @param heartbeatInterval     Interval in milliseconds between sending of ping control frames.
-     * @param useSSE                when is true use SSE else use WS
-     */
-    public Configuration(final int maximumFragmentLength, final int idleTimeout, final int heartbeatInterval,
-            final boolean useSSE) {
-        checkArgument(idleTimeout > 0, "Idle timeout must be specified by positive value.");
-        checkArgument(maximumFragmentLength >= 0 && maximumFragmentLength < MAX_FRAGMENT_LENGTH,
-                "Maximum fragment length must be disabled (0) or specified by positive value less than 64 KB.");
-        checkArgument(heartbeatInterval >= 0, "Heartbeat ping interval must be "
-                + "disabled (0) or specified by positive value.");
-
-        this.maximumFragmentLength = maximumFragmentLength;
-        this.idleTimeout = idleTimeout;
-        this.heartbeatInterval = heartbeatInterval;
-        this.useSSE = useSSE;
-    }
-
-    public int getMaximumFragmentLength() {
-        return maximumFragmentLength;
-    }
-
-    public int getIdleTimeout() {
-        return idleTimeout;
-    }
-
-    public int getHeartbeatInterval() {
-        return heartbeatInterval;
-    }
-
-    /**
-     * Getter for useSSE.
-     *
-     * @return true in situation when we use SSE. False in situation when we use WS
-     */
-    public boolean isUseSSE() {
-        return useSSE;
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(this)
-                .add("maximumFragmentLength", maximumFragmentLength)
-                .add("idleTimeout", idleTimeout)
-                .add("heartbeatInterval", heartbeatInterval)
-                .add("useSSE", useSSE)
-                .toString();
-    }
-}
\ No newline at end of file
diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/StreamsConfiguration.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/StreamsConfiguration.java
new file mode 100644 (file)
index 0000000..b8b7002
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright © 2019 FRINX s.r.o. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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;
+
+import static com.google.common.base.Preconditions.checkArgument;
+
+/**
+ * RESTCONF configuration holder and verifier.
+ *
+ * @param maximumFragmentLength Maximum web-socket fragment length in number of Unicode code units (characters)
+ *                              (exceeded message length leads to fragmentation of messages).
+ * @param idleTimeout           Maximum idle time of web-socket session before the session is closed (milliseconds).
+ * @param heartbeatInterval     Interval in milliseconds between sending of ping control frames.
+ * @param useSSE                when is {@code true} use SSE else use WS
+ */
+public record StreamsConfiguration(int maximumFragmentLength, int idleTimeout, int heartbeatInterval, boolean useSSE) {
+    public StreamsConfiguration {
+        checkArgument(maximumFragmentLength >= 0 && maximumFragmentLength < 65535,
+            "Maximum fragment length must be disabled (0) or specified by positive value less than 64KiB");
+        checkArgument(idleTimeout > 0, "Idle timeout must be specified by positive value.");
+        checkArgument(heartbeatInterval >= 0,
+            "Heartbeat ping interval must be disabled (0) or specified by positive value.");
+    }
+}
\ No newline at end of file
index d0f3cefee23d06faa432d8e48dd497f60950e0e3..3398a337bddbc9e25fbe29ea13c9aa07493ea257 100644 (file)
@@ -44,11 +44,12 @@ public final class WebSocketInitializer extends WebSocketServlet {
      * @param configuration          Web-socket configuration holder.
      */
     @Inject
-    public WebSocketInitializer(final ScheduledThreadPool scheduledThreadPool, final Configuration configuration) {
+    public WebSocketInitializer(final ScheduledThreadPool scheduledThreadPool,
+            final StreamsConfiguration configuration) {
         executorService = scheduledThreadPool.getExecutor();
-        maximumFragmentLength = configuration.getMaximumFragmentLength();
-        heartbeatInterval = configuration.getHeartbeatInterval();
-        idleTimeoutMillis = configuration.getIdleTimeout();
+        maximumFragmentLength = configuration.maximumFragmentLength();
+        heartbeatInterval = configuration.heartbeatInterval();
+        idleTimeoutMillis = configuration.idleTimeout();
     }
 
     /**
index e1402a9207bf68222057334c7ea5b71841ca7ef2..034a026bd56507335f88fe0e54c8486bb845fe7f 100644 (file)
@@ -30,7 +30,7 @@ import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindContext;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
 import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -68,7 +68,7 @@ public class Netconf799Test {
 
         final RestconfDataServiceImpl dataService = new RestconfDataServiceImpl(
             () -> DatabindContext.ofModel(contextRef), mockDataBroker, mock(DOMMountPointService.class),
-            mock(RestconfStreamsSubscriptionService.class), actionService, mock(Configuration.class));
+            mock(RestconfStreamsSubscriptionService.class), actionService, new StreamsConfiguration(0, 1, 0, false));
 
         final var nodeAndStack = DataSchemaContextTree.from(contextRef).enterPath(ACTION_YII).orElseThrow();
         final var node = nodeAndStack.node().getDataSchemaNode();
index 5b37353bfdec8e88da75945f9f835e317bc53f0b..8b3e57fbca66bd58089844d2dd4002a8ea9b0294 100644 (file)
@@ -65,7 +65,7 @@ import org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSu
 import org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy;
 import org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy;
 import org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -125,8 +125,6 @@ public class RestconfDataServiceImplTest {
     @Mock
     private RestconfStreamsSubscriptionService delegRestconfSubscrService;
     @Mock
-    private Configuration configuration;
-    @Mock
     private MultivaluedMap<String, String> queryParamenters;
 
     @Before
@@ -191,7 +189,7 @@ public class RestconfDataServiceImplTest {
         doReturn(readWrite).when(mockDataBroker).newReadWriteTransaction();
 
         dataService = new RestconfDataServiceImpl(() -> DatabindContext.ofModel(contextRef), mockDataBroker,
-                mountPointService, delegRestconfSubscrService, actionService, configuration);
+                mountPointService, delegRestconfSubscrService, actionService, new StreamsConfiguration(0, 1, 0, false));
         doReturn(Optional.of(mountPoint)).when(mountPointService)
                 .getMountPoint(any(YangInstanceIdentifier.class));
         doReturn(Optional.of(FixedDOMSchemaService.of(contextRef))).when(mountPoint)
index 97e0ceecf9409bdf5f674e3a877dc445adfade3c..c83bbdb57e68fdb19477c92d2ef2f469d4f2ae89 100644 (file)
@@ -46,7 +46,7 @@ import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.QName;
@@ -89,7 +89,7 @@ public class RestconfInvokeOperationsServiceImplTest {
     @Before
     public void setup() {
         invokeOperationsService = new RestconfInvokeOperationsServiceImpl(rpcService, mountPointService,
-            mock(Configuration.class));
+            new StreamsConfiguration(0, 1, 0, false));
     }
 
     @Test
index 71ac4b9e45dbc65cb3d1127d958e7b03cd9f02ba..7749946fd4924f22c95f07bddfe59f2c5a688e19 100644 (file)
@@ -38,7 +38,7 @@ import org.opendaylight.restconf.nb.rfc8040.TestRestconfUtils;
 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindContext;
 import org.opendaylight.restconf.nb.rfc8040.databind.DatabindProvider;
 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
-import org.opendaylight.restconf.nb.rfc8040.streams.Configuration;
+import org.opendaylight.restconf.nb.rfc8040.streams.StreamsConfiguration;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenerAdapter;
 import org.opendaylight.restconf.nb.rfc8040.streams.listeners.ListenersBroker;
 import org.opendaylight.restconf.nb.rfc8040.utils.RestconfConstants;
@@ -66,8 +66,8 @@ public class RestconfStreamsSubscriptionServiceImplTest {
     @Mock
     private DOMNotificationService notificationService;
 
-    private Configuration configurationWs;
-    private Configuration configurationSse;
+    private StreamsConfiguration configurationWs;
+    private StreamsConfiguration configurationSse;
 
     private EffectiveModelContext modelContext;
     private DatabindProvider databindProvider;
@@ -91,8 +91,8 @@ public class RestconfStreamsSubscriptionServiceImplTest {
 
         modelContext = YangParserTestUtils.parseYangFiles(TestRestconfUtils.loadFiles("/notifications"));
         databindProvider = () -> DatabindContext.ofModel(modelContext);
-        configurationWs = new Configuration(0, 100, 10, false);
-        configurationSse = new Configuration(0, 100, 10, true);
+        configurationWs = new StreamsConfiguration(0, 100, 10, false);
+        configurationSse = new StreamsConfiguration(0, 100, 10, true);
     }
 
     @BeforeClass