diff --git a/lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-module/src/main/java/io/lighty/applications/rcgnmi/module/RcGnmiAppModule.java b/lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-module/src/main/java/io/lighty/applications/rcgnmi/module/RcGnmiAppModule.java index e7fa9171b8..ec98a7bb8d 100644 --- a/lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-module/src/main/java/io/lighty/applications/rcgnmi/module/RcGnmiAppModule.java +++ b/lighty-applications/lighty-rcgnmi-app-aggregator/lighty-rcgnmi-app-module/src/main/java/io/lighty/applications/rcgnmi/module/RcGnmiAppModule.java @@ -110,7 +110,7 @@ private LightyController initController(final ControllerConfiguration config) th private CommunityRestConf initRestconf(final RestConfConfiguration config, final LightyServices services) { final RestConfConfiguration conf = RestConfConfigUtils.getRestConfConfiguration(config, services); - return CommunityRestConfBuilder.from(conf).withScheduledThreadPool(services.getScheduledThreadPool()).build(); + return CommunityRestConfBuilder.from(conf).build(); } private GnmiSouthboundModule initGnmiModule(final LightyServices services, diff --git a/lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/main/java/io/lighty/applications/rnc/module/RncLightyModule.java b/lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/main/java/io/lighty/applications/rnc/module/RncLightyModule.java index dfba218522..f3b3f1585e 100644 --- a/lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/main/java/io/lighty/applications/rnc/module/RncLightyModule.java +++ b/lighty-applications/lighty-rnc-app-aggregator/lighty-rnc-module/src/main/java/io/lighty/applications/rnc/module/RncLightyModule.java @@ -131,7 +131,6 @@ private CommunityRestConf initRestconf(final RestConfConfiguration rcConfig, fin return CommunityRestConfBuilder.from(restConfConfiguration) .withLightyServer(jettyServerBuilder) - .withScheduledThreadPool(services.getScheduledThreadPool()) .build(); } diff --git a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java index a03d200a8b..a336a822f1 100644 --- a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java +++ b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java @@ -16,7 +16,6 @@ import java.util.stream.Collectors; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.netconf.api.DocumentedException; -import org.opendaylight.netconf.api.xml.MissingNameSpaceException; import org.opendaylight.netconf.api.xml.XmlElement; import org.opendaylight.netconf.api.xml.XmlUtil; import org.opendaylight.yangtools.yang.common.QName; @@ -91,20 +90,15 @@ public static Optional loadNotification( * @return {@link QName} for input data or empty. */ public static Optional getRpcQName(final XmlElement xmlElement) { - String optionalNamespace = null; - try { - optionalNamespace = xmlElement.getNamespace(); - } catch (MissingNameSpaceException e) { - throw new RuntimeException(e); - } + String nxmlNamespace = xmlElement.namespace(); String name = xmlElement.getName(); if (Strings.isNullOrEmpty(name)) { return Optional.empty(); } String revision = null; String namespace; - if (optionalNamespace != null) { - String[] split = optionalNamespace.split("\\?"); + if (nxmlNamespace != null) { + String[] split = nxmlNamespace.split("\\?"); if (split.length > 1 && split[1].contains("revision=")) { revision = split[1].replace("revision=", ""); diff --git a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java index 04d2fd2847..3bd0325526 100644 --- a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java +++ b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java @@ -28,9 +28,9 @@ import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; import org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.impl.schema.NormalizationResultHolder; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; @@ -160,8 +160,8 @@ public Writer serializeRpc(final Inference inference, public NormalizedNode deserialize(final Inference inference, final Reader inputData) throws DeserializationException { if (inference.statementPath().isEmpty()) { - final DataContainerNodeBuilder resultBuilder = Builders.containerBuilder() - .withNodeIdentifier(NodeIdentifier.create(SchemaContext.NAME)); + final DataContainerNodeBuilder resultBuilder = + ImmutableNodes.newContainerBuilder().withNodeIdentifier(NodeIdentifier.create(SchemaContext.NAME)); parseToResult(ImmutableNormalizedNodeStreamWriter.from(resultBuilder), inputData, inference); return resultBuilder.build(); } else { diff --git a/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/AbstractCodecTest.java b/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/AbstractCodecTest.java index f135bb1c9d..5d6d32a849 100644 --- a/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/AbstractCodecTest.java +++ b/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/AbstractCodecTest.java @@ -41,9 +41,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableContainerNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableMapEntryNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableSystemMapNodeBuilder; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.parser.api.YangParserException; import org.opendaylight.yangtools.yang.parser.impl.DefaultYangParserFactory; @@ -124,7 +121,7 @@ private static List loadModuleInfos() { } private static NormalizedNode topLevelContainerNode() { - return new ImmutableContainerNodeBuilder().withNodeIdentifier(NodeIdentifier.create(Toaster.QNAME)) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NodeIdentifier.create(Toaster.QNAME)) .withValue(List.of( ImmutableNodes.leafNode( NodeIdentifier.create(qOfToasterModel("toasterManufacturer")), "manufacturer"), @@ -136,7 +133,7 @@ private static NormalizedNode topLevelContainerNode() { } private static NormalizedNode rpcLeafInputNode() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(SimpleInputOutputRpcInput.QNAME)) .withChild(ImmutableNodes.leafNode( NodeIdentifier.create(qOfTestModel("input-obj")), "testValue")) @@ -144,7 +141,7 @@ private static NormalizedNode rpcLeafInputNode() { } private static NormalizedNode rpcLeafOutputNode() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(SimpleInputOutputRpcOutput.QNAME)) .withChild(ImmutableNodes.leafNode( NodeIdentifier.create(qOfTestModel("output-obj")), "testValue")) @@ -152,7 +149,7 @@ private static NormalizedNode rpcLeafOutputNode() { } private static NormalizedNode notificationContainer() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(ToasterRestocked.QNAME)) .withChild(ImmutableNodes.leafNode( NodeIdentifier.create(qOfToasterModel("amountOfBread")), 1)).build(); @@ -160,7 +157,7 @@ private static NormalizedNode notificationContainer() { private static NormalizedNode listEntryNode() { final QName key = qOfTestModel("name"); - return new ImmutableMapEntryNodeBuilder() + return ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(NodeIdentifierWithPredicates.of( SampleList.QNAME, key, "nameValue")) .withValue(List.of( @@ -171,12 +168,12 @@ private static NormalizedNode listEntryNode() { } private static NormalizedNode listNode() { - return new ImmutableSystemMapNodeBuilder().withNodeIdentifier(new NodeIdentifier(SampleList.QNAME)) + return ImmutableNodes.newSystemMapBuilder().withNodeIdentifier(new NodeIdentifier(SampleList.QNAME)) .withChild((MapEntryNode) listEntryNode()).build(); } private static NormalizedNode innerContainerNode() { - return new ImmutableContainerNodeBuilder().withNodeIdentifier(NodeIdentifier.create(SampleContainer.QNAME)) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NodeIdentifier.create(SampleContainer.QNAME)) .withValue(List.of( org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes.leafNode( NodeIdentifier.create(qOfTestModel("name")), "name"))) diff --git a/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/JsonNodeConverterTest.java b/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/JsonNodeConverterTest.java index d596513592..0c8bc2fc8f 100644 --- a/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/JsonNodeConverterTest.java +++ b/lighty-core/lighty-codecs-util/src/test/java/io/lighty/codecs/util/JsonNodeConverterTest.java @@ -30,7 +30,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute; import org.opendaylight.yangtools.yang.parser.api.YangParserException; @@ -166,17 +166,17 @@ public void testDeserializeListMultipleEntries() throws DeserializationException } private static NormalizedNode expectedToasterContainerNN() { - return wrapWithBaseContainer(Builders.containerBuilder() + return wrapWithBaseContainer(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(Toaster.QNAME)) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfToasterModel("toasterManufacturer"))) .withValue("manufacturer") .build()) - .withChild((Builders.leafBuilder() + .withChild((ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfToasterModel("toasterStatus"))) .withValue("up") .build())) - .withChild((Builders.leafBuilder() + .withChild((ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfToasterModel("darknessFactor"))) .withValue(Uint32.valueOf(201392110)) .build())) @@ -184,9 +184,9 @@ private static NormalizedNode expectedToasterContainerNN() { } private static NormalizedNode expectedRpcInputNN() { - return Builders.containerBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(SimpleInputOutputRpcInput.QNAME)) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("input-obj"))) .withValue("a") .build()) @@ -194,9 +194,9 @@ private static NormalizedNode expectedRpcInputNN() { } private static NormalizedNode expectedRpcOutputNN() { - return Builders.containerBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(SimpleInputOutputRpcOutput.QNAME)) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("output-obj"))) .withValue("a") .build()) @@ -204,24 +204,24 @@ private static NormalizedNode expectedRpcOutputNN() { } private static NormalizedNode expectedRpcContainerInputNN() { - return Builders.containerBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(ContainerIoRpcInput.QNAME)) .withChild(expectedInnerContainerNN()) .build(); } private static NormalizedNode expectedTopLevelContainerNN() { - return wrapWithBaseContainer(Builders.containerBuilder() + return wrapWithBaseContainer(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(TopLevelContainer.QNAME)) .withChild(expectedInnerContainerNN()) .build()); } private static DataContainerChild expectedInnerContainerNN() { - return Builders.containerBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(SampleContainer.QNAME)) .withChild(expectedInnerLeafNN()) - .withChild((Builders.leafBuilder() + .withChild((ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("value"))) .withValue(Uint32.valueOf(1)) .build())) @@ -229,19 +229,19 @@ private static DataContainerChild expectedInnerContainerNN() { } private static DataContainerChild expectedInnerLeafNN() { - return Builders.leafBuilder() + return ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("name"))) .withValue("name") .build(); } private static NormalizedNode expectedListSingleEntryNN() { - return wrapWithBaseContainer(Builders.mapBuilder() + return wrapWithBaseContainer(ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(NodeIdentifier.create(SampleList.QNAME)) - .withChild(Builders.mapEntryBuilder() + .withChild(ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(NodeIdentifierWithPredicates.of(SampleList.QNAME, qOfTestModel("name"), "test")) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("name"))) .withValue("test") .build()) @@ -250,12 +250,12 @@ private static NormalizedNode expectedListSingleEntryNN() { } private static NormalizedNode expectedTestListNN() { - return Builders.mapBuilder() + return ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(NodeIdentifier.create(TestList.QNAME)) - .withChild(Builders.mapEntryBuilder() + .withChild(ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(NodeIdentifierWithPredicates.of(TestList.QNAME, qOfTestModel("test-name"), "test")) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("test-name"))) .withValue("test") .build()) @@ -264,20 +264,20 @@ private static NormalizedNode expectedTestListNN() { } private static NormalizedNode expectedListMultipleEntriesNN() { - return wrapWithBaseContainer(Builders.mapBuilder() + return wrapWithBaseContainer(ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(NodeIdentifier.create(SampleList.QNAME)) - .withChild(Builders.mapEntryBuilder() + .withChild(ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(NodeIdentifierWithPredicates.of(SampleList.QNAME, qOfTestModel("name"), "test")) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("name"))) .withValue("test") .build()) .build()) - .withChild(Builders.mapEntryBuilder() + .withChild(ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(NodeIdentifierWithPredicates.of(SampleList.QNAME, qOfTestModel("name"), "test2")) - .withChild(Builders.leafBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(qOfTestModel("name"))) .withValue("test2") .build()) @@ -286,7 +286,7 @@ private static NormalizedNode expectedListMultipleEntriesNN() { } private static NormalizedNode wrapWithBaseContainer(final DataContainerChild child) { - return Builders.containerBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(SchemaContext.NAME)) .withChild(child) .build(); diff --git a/lighty-core/lighty-controller-guice-di/src/main/java/io/lighty/core/controller/guice/LightyControllerModule.java b/lighty-core/lighty-controller-guice-di/src/main/java/io/lighty/core/controller/guice/LightyControllerModule.java index 08178b551c..e49739423a 100644 --- a/lighty-core/lighty-controller-guice-di/src/main/java/io/lighty/core/controller/guice/LightyControllerModule.java +++ b/lighty-core/lighty-controller-guice-di/src/main/java/io/lighty/core/controller/guice/LightyControllerModule.java @@ -13,9 +13,6 @@ import io.lighty.core.controller.api.LightyServices; import io.netty.channel.EventLoopGroup; import io.netty.util.Timer; -import io.netty.util.concurrent.EventExecutor; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ScheduledExecutorService; import org.opendaylight.controller.cluster.ActorSystemProvider; import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface; import org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService; @@ -65,8 +62,6 @@ protected void configure() { .toInstance(lightyServices.getActorSystemProvider()); bind(DOMSchemaService.class) .toInstance(lightyServices.getDOMSchemaService()); - bind(DOMSchemaService.YangTextSourceExtension.class) - .toInstance(lightyServices.getYangTextSourceExtension()); bind(DOMNotificationRouter.class) .toInstance(lightyServices.getDOMNotificationRouter()); bind(DistributedDataStoreInterface.class) @@ -87,18 +82,12 @@ protected void configure() { .toInstance(lightyServices.getClusterAdminRPCService()); bind(ClusterSingletonServiceProvider.class) .toInstance(lightyServices.getClusterSingletonServiceProvider()); - bind(EventExecutor.class) - .toInstance(lightyServices.getEventExecutor()); bind(EventLoopGroup.class) .annotatedWith(Names.named("BossGroup")) .toInstance(lightyServices.getBossGroup()); bind(EventLoopGroup.class) .annotatedWith(Names.named("WorkerGroup")) .toInstance(lightyServices.getWorkerGroup()); - bind(ExecutorService.class) - .toInstance(lightyServices.getThreadPool()); - bind(ScheduledExecutorService.class) - .toInstance(lightyServices.getScheduledThreadPool()); bind(Timer.class) .toInstance(lightyServices.getTimer()); bind(DOMMountPointService.class) diff --git a/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/GuiceDITest.java b/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/GuiceDITest.java index 6b7f9f76ae..f47a082e22 100644 --- a/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/GuiceDITest.java +++ b/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/GuiceDITest.java @@ -77,11 +77,6 @@ public void testDIDomSchemaService() { assertNotNull(testService.getDomSchemaService()); } - @Test - public void testDIDomYangTextSourceProvider() { - assertNotNull(testService.getDomYangTextSourceProvider()); - } - @Test public void testDIDomNotificationSubscriptionListenerRegistry() { assertNotNull(testService.getDomNotificationSubscriptionListenerRegistry()); @@ -127,11 +122,6 @@ public void testDIClusterSingletonServiceProvider() { assertNotNull(testService.getClusterSingletonServiceProvider()); } - @Test - public void testDIEventExecutor() { - assertNotNull(testService.getEventExecutor()); - } - @Test public void testDIEventLoopGroupBoss() { assertNotNull(testService.getEventLoopGroupBoss()); @@ -142,16 +132,6 @@ public void testDIEventLoopGroupWorker() { assertNotNull(testService.getEventLoopGroupWorker()); } - @Test - public void testDIThreadPool() { - assertNotNull(testService.getThreadPool()); - } - - @Test - public void testDIScheduledThreadPool() { - assertNotNull(testService.getScheduledThreadPool()); - } - @Test public void testDITimer() { assertNotNull(testService.getTimer()); diff --git a/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/TestService.java b/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/TestService.java index b7878387b7..e103cdf9a9 100644 --- a/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/TestService.java +++ b/lighty-core/lighty-controller-guice-di/src/test/java/io/lighty/core/controller/guice/tests/TestService.java @@ -11,11 +11,8 @@ import io.lighty.core.controller.api.LightyServices; import io.netty.channel.EventLoopGroup; import io.netty.util.Timer; -import io.netty.util.concurrent.EventExecutor; import jakarta.inject.Inject; import jakarta.inject.Named; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ScheduledExecutorService; import org.opendaylight.controller.cluster.ActorSystemProvider; import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface; import org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService; @@ -51,9 +48,6 @@ public class TestService { @Inject private DOMSchemaService domSchemaService; - @Inject - private DOMSchemaService.YangTextSourceExtension domYangTextSourceProvider; - @Inject private DOMNotificationRouter domNotificationSubscriptionListenerRegistry; @@ -83,9 +77,6 @@ public class TestService { @Inject private ClusterSingletonServiceProvider clusterSingletonServiceProvider; - @Inject - private EventExecutor eventExecutor; - @Inject @Named("BossGroup") private EventLoopGroup eventLoopGroupBoss; @@ -94,12 +85,6 @@ public class TestService { @Named("WorkerGroup") private EventLoopGroup eventLoopGroupWorker; - @Inject - private ExecutorService threadPool; - - @Inject - private ScheduledExecutorService scheduledThreadPool; - @Inject private Timer timer; @@ -160,10 +145,6 @@ public DOMSchemaService getDomSchemaService() { return domSchemaService; } - public DOMSchemaService.YangTextSourceExtension getDomYangTextSourceProvider() { - return domYangTextSourceProvider; - } - public DOMNotificationRouter getDomNotificationSubscriptionListenerRegistry() { return domNotificationSubscriptionListenerRegistry; } @@ -200,10 +181,6 @@ public ClusterSingletonServiceProvider getClusterSingletonServiceProvider() { return clusterSingletonServiceProvider; } - public EventExecutor getEventExecutor() { - return eventExecutor; - } - public EventLoopGroup getEventLoopGroupBoss() { return eventLoopGroupBoss; } @@ -212,14 +189,6 @@ public EventLoopGroup getEventLoopGroupWorker() { return eventLoopGroupWorker; } - public ExecutorService getThreadPool() { - return threadPool; - } - - public ScheduledExecutorService getScheduledThreadPool() { - return scheduledThreadPool; - } - public Timer getTimer() { return timer; } diff --git a/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java b/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java index 4070a814c0..fae59b59de 100644 --- a/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java +++ b/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java @@ -11,11 +11,8 @@ import io.lighty.core.controller.api.LightyModuleRegistryService; import io.netty.channel.EventLoopGroup; import io.netty.util.Timer; -import io.netty.util.concurrent.EventExecutor; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ScheduledExecutorService; import org.opendaylight.controller.cluster.ActorSystemProvider; import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface; import org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService; @@ -250,11 +247,6 @@ public DataBroker getBindingDataBroker() { return this.lightyController.getServices().getBindingDataBroker(); } - @Bean(destroyMethod = "") - public EventExecutor eventExecutor() { - return this.lightyController.getServices().getEventExecutor(); - } - @Bean(name = "BossGroup", destroyMethod = "") public EventLoopGroup bossGroup() { return this.lightyController.getServices().getBossGroup(); @@ -265,17 +257,6 @@ public EventLoopGroup workerGroup() { return this.lightyController.getServices().getWorkerGroup(); } - @Bean(destroyMethod = "") - @Primary - public ExecutorService threadPool() { - return this.lightyController.getServices().getThreadPool(); - } - - @Bean(destroyMethod = "") - public ScheduledExecutorService scheduledThreadPool() { - return this.lightyController.getServices().getScheduledThreadPool(); - } - @Bean(destroyMethod = "") public Timer timer() { return this.lightyController.getServices().getTimer(); diff --git a/lighty-core/lighty-controller-spring-di/src/test/java/io/lighty/core/controller/spring/LightyCoreSpringConfigurationTest.java b/lighty-core/lighty-controller-spring-di/src/test/java/io/lighty/core/controller/spring/LightyCoreSpringConfigurationTest.java index f8110dd389..ffbbd882e9 100644 --- a/lighty-core/lighty-controller-spring-di/src/test/java/io/lighty/core/controller/spring/LightyCoreSpringConfigurationTest.java +++ b/lighty-core/lighty-controller-spring-di/src/test/java/io/lighty/core/controller/spring/LightyCoreSpringConfigurationTest.java @@ -18,11 +18,8 @@ import io.lighty.core.controller.impl.util.ControllerConfigUtils; import io.netty.channel.EventLoopGroup; import io.netty.util.Timer; -import io.netty.util.concurrent.EventExecutor; import java.util.Collections; import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ScheduledExecutorService; import org.junit.jupiter.api.Test; import org.opendaylight.controller.cluster.ActorSystemProvider; import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface; @@ -146,9 +143,6 @@ public class LightyCoreSpringConfigurationTest extends AbstractJUnit4SpringConte @Autowired DataBroker bindingDataBrokerTestProperty; - @Autowired - EventExecutor eventExecutorTestProperty; - @Autowired @Qualifier("BossGroup") EventLoopGroup bossGroupTestProperty; @@ -157,13 +151,6 @@ public class LightyCoreSpringConfigurationTest extends AbstractJUnit4SpringConte @Qualifier("WorkerGroup") EventLoopGroup workerGroupTestProperty; - @Autowired - ExecutorService threadPoolTestProperty; - - @Autowired - @Qualifier("scheduledThreadPool") - ScheduledExecutorService scheduledThreadPoolTestProperty; - @Autowired Timer timerTestProperty; @@ -195,11 +182,8 @@ public void testLightyBeansExists() { assertNotNull(notificationServiceTestProperty); assertNotNull(bindingNotificationPublishServiceTestProperty); assertNotNull(bindingDataBrokerTestProperty); - assertNotNull(eventExecutorTestProperty); assertNotNull(bossGroupTestProperty); assertNotNull(workerGroupTestProperty); - assertNotNull(threadPoolTestProperty); - assertNotNull(scheduledThreadPoolTestProperty); assertNotNull(timerTestProperty); } diff --git a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/LightyServices.java b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/LightyServices.java index c395e01fbb..fec4c1c51b 100644 --- a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/LightyServices.java +++ b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/LightyServices.java @@ -10,9 +10,6 @@ import io.lighty.core.controller.impl.services.LightySystemReadyService; import io.netty.channel.EventLoopGroup; import io.netty.util.Timer; -import io.netty.util.concurrent.EventExecutor; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ScheduledExecutorService; import org.opendaylight.controller.cluster.ActorSystemProvider; import org.opendaylight.controller.cluster.datastore.DistributedDataStoreInterface; import org.opendaylight.controller.cluster.datastore.admin.ClusterAdminRpcService; @@ -84,16 +81,10 @@ public interface LightyServices extends LightyModuleRegistryService { ClusterSingletonServiceProvider getClusterSingletonServiceProvider(); - EventExecutor getEventExecutor(); - EventLoopGroup getBossGroup(); EventLoopGroup getWorkerGroup(); - ExecutorService getThreadPool(); - - ScheduledExecutorService getScheduledThreadPool(); - Timer getTimer(); DOMMountPointService getDOMMountPointService(); diff --git a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/LightyControllerImpl.java b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/LightyControllerImpl.java index 3647474fdb..7f0c8678ae 100644 --- a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/LightyControllerImpl.java +++ b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/LightyControllerImpl.java @@ -29,9 +29,6 @@ import io.netty.channel.nio.NioEventLoopGroup; import io.netty.util.HashedWheelTimer; import io.netty.util.Timer; -import io.netty.util.concurrent.DefaultEventExecutor; -import io.netty.util.concurrent.DefaultThreadFactory; -import io.netty.util.concurrent.EventExecutor; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -44,9 +41,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import org.eclipse.jdt.annotation.Nullable; @@ -171,11 +165,8 @@ public class LightyControllerImpl extends AbstractLightyModule implements Lighty private NotificationPublishService notificationPublishService; private DataBroker dataBroker; private final LightyDiagStatusServiceImpl lightyDiagStatusService; - private EventExecutor eventExecutor; private EventLoopGroup bossGroup; private EventLoopGroup workerGroup; - private ExecutorService threadPool; - private ScheduledExecutorService scheduledThreadPool; private Timer timer; private ModuleInfoSnapshot moduleInfoSnapshot; private ModuleInfoSnapshotResolver snapshotResolver; @@ -349,12 +340,7 @@ protected boolean initProcedure() { this.bossGroup = new NioEventLoopGroup(); this.workerGroup = new NioEventLoopGroup(); - this.eventExecutor = new DefaultEventExecutor(); this.timer = new HashedWheelTimer(); - this.threadPool = - Executors.newFixedThreadPool(2, new DefaultThreadFactory("default-pool")); - this.scheduledThreadPool = - new ScheduledThreadPoolExecutor(2, new DefaultThreadFactory("default-scheduled-pool")); this.yangLibraryWriter = new YangLibraryWriterSingleton(clusterSingletonServiceProvider, schemaService, dataBroker, true); yangLibraryWriter.instantiateServiceInstance(); @@ -398,12 +384,6 @@ protected boolean stopProcedure() throws InterruptedException, ExecutionExceptio if (this.timer != null) { this.timer.stop(); } - if (this.threadPool != null) { - this.threadPool.shutdown(); - } - if (this.scheduledThreadPool != null) { - this.scheduledThreadPool.shutdown(); - } if (this.clusterSingletonServiceProvider != null) { this.clusterSingletonServiceProvider.close(); } @@ -568,11 +548,6 @@ public ClusterSingletonServiceProvider getClusterSingletonServiceProvider() { return this.clusterSingletonServiceProvider; } - @Override - public EventExecutor getEventExecutor() { - return this.eventExecutor; - } - @Override public EventLoopGroup getBossGroup() { return this.bossGroup; @@ -583,16 +558,6 @@ public EventLoopGroup getWorkerGroup() { return this.workerGroup; } - @Override - public ExecutorService getThreadPool() { - return this.threadPool; - } - - @Override - public ScheduledExecutorService getScheduledThreadPool() { - return this.scheduledThreadPool; - } - @Override public Timer getTimer() { return this.timer; diff --git a/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerNotificationTest.java b/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerNotificationTest.java index 0c073533d8..3d96c16122 100644 --- a/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerNotificationTest.java +++ b/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerNotificationTest.java @@ -15,7 +15,7 @@ import org.opendaylight.mdsal.dom.api.DOMNotificationService; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableContainerNodeBuilder; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute; import org.testng.Assert; import org.testng.annotations.Test; @@ -36,7 +36,7 @@ public Absolute getType() { @Override public ContainerNode getBody() { - return new ImmutableContainerNodeBuilder().build(); + return ImmutableNodes.newContainerBuilder().build(); } }; final int[] listenerMethodsCalled = { 0 }; diff --git a/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerTest.java b/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerTest.java index dee774a344..274d7e1ed2 100644 --- a/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerTest.java +++ b/lighty-core/lighty-controller/src/test/java/io/lighty/core/controller/impl/tests/LightyControllerTest.java @@ -36,11 +36,8 @@ public void controllerSimpleTest() { Assert.assertNotNull(lightyController.getServices().getEntityOwnershipService()); Assert.assertNotNull(lightyController.getServices().getClusterAdminRPCService()); Assert.assertNotNull(lightyController.getServices().getClusterSingletonServiceProvider()); - Assert.assertNotNull(lightyController.getServices().getEventExecutor()); Assert.assertNotNull(lightyController.getServices().getBossGroup()); Assert.assertNotNull(lightyController.getServices().getWorkerGroup()); - Assert.assertNotNull(lightyController.getServices().getThreadPool()); - Assert.assertNotNull(lightyController.getServices().getScheduledThreadPool()); Assert.assertNotNull(lightyController.getServices().getTimer()); Assert.assertNotNull(lightyController.getServices().getDOMMountPointService()); Assert.assertNotNull(lightyController.getServices().getDOMNotificationPublishService()); diff --git a/lighty-examples/lighty-bgp-community-restconf-app/src/main/java/io/lighty/examples/controllers/bgpapp/Main.java b/lighty-examples/lighty-bgp-community-restconf-app/src/main/java/io/lighty/examples/controllers/bgpapp/Main.java index 171688943d..05fa541cac 100644 --- a/lighty-examples/lighty-bgp-community-restconf-app/src/main/java/io/lighty/examples/controllers/bgpapp/Main.java +++ b/lighty-examples/lighty-bgp-community-restconf-app/src/main/java/io/lighty/examples/controllers/bgpapp/Main.java @@ -111,7 +111,6 @@ public synchronized void start(String[] args) throws InterruptedException, Execu restconf = CommunityRestConfBuilder .from(RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration, controller.getServices())) - .withScheduledThreadPool(controller.getServices().getScheduledThreadPool()) .build(); Preconditions.checkState(startLightyModule(restconf, modulesConfig.getModuleTimeoutSeconds()), "Unable to start restconf module"); diff --git a/lighty-examples/lighty-community-aaa-restconf-app/src/main/java/io/lighty/kit/examples/community/aaa/restconf/Main.java b/lighty-examples/lighty-community-aaa-restconf-app/src/main/java/io/lighty/kit/examples/community/aaa/restconf/Main.java index 9fbfb32755..9d0b4729ec 100644 --- a/lighty-examples/lighty-community-aaa-restconf-app/src/main/java/io/lighty/kit/examples/community/aaa/restconf/Main.java +++ b/lighty-examples/lighty-community-aaa-restconf-app/src/main/java/io/lighty/kit/examples/community/aaa/restconf/Main.java @@ -114,7 +114,6 @@ private void startLighty(final ControllerConfiguration controllerConfiguration, .from(RestConfConfigUtils.getRestConfConfiguration(restconfConfiguration, this.lightyController.getServices())) .withLightyServer(jettyServerBuilder) - .withScheduledThreadPool(this.lightyController.getServices().getScheduledThreadPool()) .build(); final boolean restconfStartOk = this.restconf.start() .get(modulesConfig.getModuleTimeoutSeconds(), TimeUnit.SECONDS); diff --git a/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/Main.java b/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/Main.java index 76fb55352e..3921d57a7e 100644 --- a/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/Main.java +++ b/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/Main.java @@ -156,7 +156,6 @@ private void startLighty(final ControllerConfiguration controllerConfiguration, .from(RestConfConfigUtils.getRestConfConfiguration(restconfConfiguration, this.lightyController.getServices())) .withLightyServer(jettyServerBuilder) - .withScheduledThreadPool(lightyController.getServices().getScheduledThreadPool()) .build(); //3. start openApi and RestConf server diff --git a/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/dom/DeviceStartActionImpl.java b/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/dom/DeviceStartActionImpl.java index c114353c90..c1b02a4c1a 100644 --- a/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/dom/DeviceStartActionImpl.java +++ b/lighty-examples/lighty-community-restconf-actions-app/src/main/java/io/lighty/examples/controllers/actions/dom/DeviceStartActionImpl.java @@ -19,7 +19,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute; /** @@ -34,9 +34,9 @@ public ListenableFuture invokeAction(final Absolute t final DOMDataTreeIdentifier path, final ContainerNode input) { final var inputValue = input.findChildByArg(NodeIdentifier.create(INPUT_LEAF_QNAME)) .map(NormalizedNode::body).orElseThrow(); - return Futures.immediateFuture(new SimpleDOMActionResult(Builders.containerBuilder() + return Futures.immediateFuture(new SimpleDOMActionResult(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(StartOutput.QNAME)) - .withChild(Builders.leafBuilder().withNodeIdentifier(NodeIdentifier.create(OUTPUT_LEAF_QNAME)) + .withChild(ImmutableNodes.newLeafBuilder().withNodeIdentifier(NodeIdentifier.create(OUTPUT_LEAF_QNAME)) .withValue(inputValue) .build()) .build())); diff --git a/lighty-examples/lighty-community-restconf-netconf-app/src/main/java/io/lighty/examples/controllers/restconfapp/Main.java b/lighty-examples/lighty-community-restconf-netconf-app/src/main/java/io/lighty/examples/controllers/restconfapp/Main.java index 8d75f7228d..7a7855cf86 100644 --- a/lighty-examples/lighty-community-restconf-netconf-app/src/main/java/io/lighty/examples/controllers/restconfapp/Main.java +++ b/lighty-examples/lighty-community-restconf-netconf-app/src/main/java/io/lighty/examples/controllers/restconfapp/Main.java @@ -153,7 +153,6 @@ private void startLighty(final ControllerConfiguration controllerConfiguration, .from(RestConfConfigUtils.getRestConfConfiguration(restconfConfiguration, this.lightyController.getServices())) .withLightyServer(jettyServerBuilder) - .withScheduledThreadPool(lightyController.getServices().getScheduledThreadPool()) .build(); //3. start openApi and RestConf server diff --git a/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/LightyTestUtils.java b/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/LightyTestUtils.java index 69e0e8b798..d4e1c36282 100644 --- a/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/LightyTestUtils.java +++ b/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/LightyTestUtils.java @@ -69,7 +69,6 @@ public static CommunityRestConf startRestconf(RestConfConfiguration restConfConf final CommunityRestConf communityRestConf = CommunityRestConfBuilder .from(RestConfConfigUtils.getRestConfConfiguration(restConfConfiguration, services)) - .withScheduledThreadPool(services.getScheduledThreadPool()) .build(); LOG.info("Starting CommunityRestConf"); diff --git a/lighty-modules/lighty-bgp/src/main/java/io/lighty/modules/bgp/deployer/BgpModule.java b/lighty-modules/lighty-bgp/src/main/java/io/lighty/modules/bgp/deployer/BgpModule.java index 60a09f422f..ec6e55d186 100644 --- a/lighty-modules/lighty-bgp/src/main/java/io/lighty/modules/bgp/deployer/BgpModule.java +++ b/lighty-modules/lighty-bgp/src/main/java/io/lighty/modules/bgp/deployer/BgpModule.java @@ -151,7 +151,7 @@ protected boolean stopProcedure() { try { bgpNettyGroups.close(); } catch (Exception e) { - LOG.warn("Failed to stop BGP dispatcher", e); + LOG.warn("Failed to stop BGP Netty groups", e); closeSuccess = false; } try { diff --git a/lighty-modules/lighty-gnmi/lighty-gnmi-commons/src/main/java/io/lighty/modules/gnmi/commons/util/DataConverter.java b/lighty-modules/lighty-gnmi/lighty-gnmi-commons/src/main/java/io/lighty/modules/gnmi/commons/util/DataConverter.java index 2e58847374..cc6cce6fa8 100644 --- a/lighty-modules/lighty-gnmi/lighty-gnmi-commons/src/main/java/io/lighty/modules/gnmi/commons/util/DataConverter.java +++ b/lighty-modules/lighty-gnmi/lighty-gnmi-commons/src/main/java/io/lighty/modules/gnmi/commons/util/DataConverter.java @@ -33,8 +33,8 @@ import org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier; import org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.data.util.DataSchemaContextTree; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.api.Module; @@ -121,8 +121,8 @@ private static NormalizedNode fromJson(final String inputJson, final Inference i Write result into container builder with identifier (netconf:base)data. Makes possible to write multiple top level elements. */ - final DataContainerNodeBuilder resultBuilder = Builders.containerBuilder() - .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(SchemaContext.NAME)); + final DataContainerNodeBuilder resultBuilder = ImmutableNodes + .newContainerBuilder().withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(SchemaContext.NAME)); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(resultBuilder); final JSONCodecFactory jsonCodecFactory = diff --git a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/mountpoint/broker/GnmiDataBroker.java b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/mountpoint/broker/GnmiDataBroker.java index a1b6fdcc44..5334c9c2b1 100644 --- a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/mountpoint/broker/GnmiDataBroker.java +++ b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/mountpoint/broker/GnmiDataBroker.java @@ -8,14 +8,13 @@ package io.lighty.gnmi.southbound.mountpoint.broker; -import com.google.common.util.concurrent.FutureCallback; +import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import io.lighty.gnmi.southbound.mountpoint.ops.GnmiGet; import io.lighty.gnmi.southbound.mountpoint.ops.GnmiSet; import io.lighty.gnmi.southbound.mountpoint.transactions.ReadOnlyTx; import io.lighty.gnmi.southbound.mountpoint.transactions.ReadWriteTx; import io.lighty.gnmi.southbound.mountpoint.transactions.WriteOnlyTx; -import java.util.concurrent.Executor; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction; import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction; @@ -51,19 +50,10 @@ public DOMDataTreeReadWriteTransaction newReadWriteTransaction() { return GnmiDataBroker.this.newReadWriteTransaction(); } - @Override - public void addCallback(FutureCallback callback) { - DOMTransactionChain.super.addCallback(callback); - } - - @Override - public void addCallback(FutureCallback callback, Executor executor) { - DOMTransactionChain.super.addCallback(callback, executor); - } - + //Since transactions are not chained, just return completed future. @Override public @NonNull ListenableFuture future() { - return createMergingTransactionChain().future(); + return Futures.immediateFuture(Empty.value()); } @Override diff --git a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/schema/certstore/rpc/CertificationStorageServiceRpcImpl.java b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/schema/certstore/rpc/CertificationStorageServiceRpcImpl.java index 586cac0870..0fcc6842ba 100644 --- a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/schema/certstore/rpc/CertificationStorageServiceRpcImpl.java +++ b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/main/java/io/lighty/gnmi/southbound/schema/certstore/rpc/CertificationStorageServiceRpcImpl.java @@ -9,8 +9,6 @@ package io.lighty.gnmi.southbound.schema.certstore.rpc; -import com.google.common.collect.ClassToInstanceMap; -import com.google.common.collect.ImmutableClassToInstanceMap; import com.google.common.util.concurrent.FutureCallback; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; @@ -18,6 +16,8 @@ import com.google.common.util.concurrent.SettableFuture; import io.lighty.gnmi.southbound.schema.certstore.service.CertificationStorageService; import java.security.GeneralSecurityException; +import java.util.Collection; +import java.util.List; import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.yang.gen.v1.urn.lighty.gnmi.certificate.storage.rev210504.AddKeystoreCertificate; import org.opendaylight.yang.gen.v1.urn.lighty.gnmi.certificate.storage.rev210504.AddKeystoreCertificateInput; @@ -90,10 +90,9 @@ public void onFailure(final Throwable throwable) { return rpcResult; } - public ClassToInstanceMap> getRpcClassToInstanceMap() { - return ImmutableClassToInstanceMap.>builder() - .put(AddKeystoreCertificate.class, this::addKeystoreCertificate) - .put(RemoveKeystoreCertificate.class, this::removeKeystoreCertificate) - .build(); + public Collection> getRpcClassToInstanceMap() { + return List.of( + (AddKeystoreCertificate) this::addKeystoreCertificate, + (RemoveKeystoreCertificate) this::removeKeystoreCertificate); } } diff --git a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/testcases/CodecTestCasesBase.java b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/testcases/CodecTestCasesBase.java index dfd4bfbfc8..09403b9163 100644 --- a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/testcases/CodecTestCasesBase.java +++ b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/codecs/testcases/CodecTestCasesBase.java @@ -28,9 +28,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableContainerNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableMapEntryNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableSystemMapNodeBuilder; import org.opendaylight.yangtools.yang.model.api.SchemaContext; /** @@ -91,7 +88,7 @@ protected ImmutablePair listEntryCase(fi .node(getMapEntryIdentifierOfNodeInModule(OC_INTERFACES_ID, "interface", "name", "eth3")); return ImmutablePair.of(identifier, wrapInMapNode - ? new ImmutableSystemMapNodeBuilder() + ? ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_INTERFACES_ID, "interface")) .withValue(List.of(interfaceEth3Node())).build() : interfaceEth3Node()); @@ -237,7 +234,7 @@ public QNameModule getQNameOfModule(final String moduleName) { } private NormalizedNode makeRoot() { - final NormalizedNode normalizedNode = new ImmutableContainerNodeBuilder() + final NormalizedNode normalizedNode = ImmutableNodes.newContainerBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(SchemaContext.NAME)) .withChild((DataContainerChild) makeInterfaces()) .withChild((DataContainerChild) makeComponents()).build(); @@ -245,15 +242,15 @@ private NormalizedNode makeRoot() { } private NormalizedNode makeComponents() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_PLATFORM_ID, "components")) - .withChild(new ImmutableSystemMapNodeBuilder() + .withChild(ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_PLATFORM_ID, "component")) - .withChild(new ImmutableMapEntryNodeBuilder() + .withChild(ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(getMapEntryIdentifierOfNodeInModule(OC_PLATFORM_ID, "component", "name", "admin")) .withChild(makeLeafNode(OC_PLATFORM_ID,"name","admin")) - .withChild(new ImmutableContainerNodeBuilder() + .withChild(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_PLATFORM_ID, "config")) .withChild(makeLeafNode(OC_PLATFORM_ID,"name","admin")) .build()) @@ -263,27 +260,27 @@ private NormalizedNode makeComponents() { } public NormalizedNode makeInterfaces() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_INTERFACES_ID, "interfaces")) - .withChild(new ImmutableSystemMapNodeBuilder() + .withChild(ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_INTERFACES_ID, "interface")) .withChild(interfaceEth3Node()) - .withChild(new ImmutableMapEntryNodeBuilder() + .withChild(ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(getMapEntryIdentifierOfNodeInModule(OC_INTERFACES_ID, "interface", "name", "br0")) .withChild(makeLeafNode(OC_INTERFACES_ID, "name", "br0")) .withChild(interfaceConfigNode()) - .withChild(new ImmutableContainerNodeBuilder() + .withChild(ImmutableNodes.newContainerBuilder() .withNodeIdentifier( getNodeIdentifierOfNodeInModule(OC_IF_ETHERNET_ID, "ethernet")) .withChild(ethConfigNode()) .withChild(switchedVlanNode()) .build()) - .withChild(new ImmutableContainerNodeBuilder() + .withChild(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create( QName.create(getQNameOfModule(OC_IF_AGGREGATE_ID), "aggregation"))) - .withChild(new ImmutableContainerNodeBuilder() + .withChild(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule( OC_IF_AGGREGATE_ID, "config")) .withValue(List.of( @@ -299,7 +296,7 @@ public NormalizedNode makeInterfaces() { } private ContainerNode ethConfigNode() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier( getNodeIdentifierOfNodeInModule(OC_IF_ETHERNET_ID, "config")) .withValue(List.of( @@ -313,7 +310,7 @@ private ContainerNode ethConfigNode() { } public MapEntryNode interfaceEth3Node() { - return new ImmutableMapEntryNodeBuilder() + return ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier( getMapEntryIdentifierOfNodeInModule(OC_INTERFACES_ID, "interface", "name", "eth3")) .withChild(interfaceConfigNode()) @@ -322,7 +319,7 @@ public MapEntryNode interfaceEth3Node() { } public ContainerNode interfaceConfigNode() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_INTERFACES_ID, "config")) .withValue(List.of( makeLeafNode(OC_INTERFACES_ID, "name", "admin"), @@ -334,9 +331,9 @@ public ContainerNode interfaceConfigNode() { } public ContainerNode switchedVlanNode() { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_VLAN_ID, "switched-vlan")) - .withChild(new ImmutableContainerNodeBuilder() + .withChild(ImmutableNodes.newContainerBuilder() .withNodeIdentifier(getNodeIdentifierOfNodeInModule(OC_VLAN_ID, "config")) .withValue(List.of( makeLeafNode(OC_VLAN_ID, "native-vlan", Uint16.valueOf(37)), diff --git a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/transactions/WriteTransactionTest.java b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/transactions/WriteTransactionTest.java index 1643607bb6..4f45fa4548 100644 --- a/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/transactions/WriteTransactionTest.java +++ b/lighty-modules/lighty-gnmi/lighty-gnmi-sb/src/test/java/io/lighty/gnmi/southbound/mountpoint/transactions/WriteTransactionTest.java @@ -64,9 +64,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableContainerNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableMapEntryNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableSystemMapNodeBuilder; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.skyscreamer.jsonassert.JSONAssert; @@ -212,7 +209,7 @@ private static ContainerNode getTestDataContainerNode() { YangInstanceIdentifier.NodeIdentifier.create(CONFIG_NAME_QN), NAME_KEY_VALUE); final LeafNode loopbackNode = ImmutableNodes.leafNode( YangInstanceIdentifier.NodeIdentifier.create(CONFIG_LOOPBACK_QN), true); - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(CONFIG_CONTAINER_QN)) .withChild(configName) .withChild(loopbackNode) @@ -222,26 +219,26 @@ private static ContainerNode getTestDataContainerNode() { private static ContainerNode getPrepareListNode() { final LeafNode node = ImmutableNodes.leafNode( YangInstanceIdentifier.NodeIdentifier.create(NAME_QN), NAME_KEY_VALUE); - final MapEntryNode name = new ImmutableMapEntryNodeBuilder() + final MapEntryNode name = ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifierWithPredicates .of(INTERFACE_LIST_QN, NAME_QN, NAME_KEY_VALUE)) .withChild(node) .build(); - final MapNode mapNode = new ImmutableSystemMapNodeBuilder() + final MapNode mapNode = ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(INTERFACE_LIST_QN)) .withChild(name) .build(); - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withChild(mapNode) .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(INTERFACES_CONTAINER_QN)) .build(); } private static ContainerNode getEmptyPrepareListNode() { - final MapNode build = new ImmutableSystemMapNodeBuilder() + final MapNode build = ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(INTERFACE_LIST_QN)) .build(); - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withChild(build) .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(INTERFACES_CONTAINER_QN)) .build(); diff --git a/lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/GnmiWithoutRestconfTest.java b/lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/GnmiWithoutRestconfTest.java index 7a21efd5ce..1b763a00d9 100644 --- a/lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/GnmiWithoutRestconfTest.java +++ b/lighty-modules/lighty-gnmi/lighty-gnmi-test/src/test/java/io/lighty/modules/gnmi/test/gnmi/GnmiWithoutRestconfTest.java @@ -102,10 +102,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableContainerNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableLeafNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableLeafSetEntryNodeBuilder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableSystemLeafSetNodeBuilder; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; public class GnmiWithoutRestconfTest { private static final String INITIAL_JSON_DATA_PATH = "src/test/resources/json/initData"; @@ -338,17 +335,17 @@ public void testUpdatingYangModels() throws ExecutionException, InterruptedExcep private ContainerNode getYangModelInput(final String yangName, final String yangBody, final String yangVersion) { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(UPLOAD_YANG_INPUT_QN)) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(YANG_NAME_QN)) .withValue(yangName) .build()) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(YANG_BODY_QN)) .withValue(yangBody) .build()) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(YANG_VERSION_QN)) .withValue(yangVersion) .build()) @@ -357,25 +354,25 @@ private ContainerNode getYangModelInput(final String yangName, final String yang private ContainerNode getCertificateInput(final String certId, final String ca, final String clientCert, final String certKey, final String passphrase) { - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(ADD_KEYSTORE_INPUT_QN)) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(KEYSTORE_ID_QN)) .withValue(certId) .build()) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(CA_CERT_QN)) .withValue(ca) .build()) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(CLIENT_CERT_QN)) .withValue(clientCert) .build()) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(CLIENT_KEY_QN)) .withValue(certKey) .build()) - .withChild(new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(PASSPHRASE_QN)) .withValue(passphrase) .build()) @@ -460,37 +457,37 @@ private static Node createNode(final String nameOfNode, final String address, fi } private static ContainerNode getTestDataContainerNode() { - final var firstEntryValue = new ImmutableLeafSetEntryNodeBuilder() + final var firstEntryValue = ImmutableNodes.newLeafSetEntryBuilder() .withValue(FIRST_VALUE) - .withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(TEST_LEAF_LIST_QN, FIRST_VALUE)) + .withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue<>(TEST_LEAF_LIST_QN, FIRST_VALUE)) .build(); - final var secondEntryValues = new ImmutableLeafSetEntryNodeBuilder() + final var secondEntryValues = ImmutableNodes.newLeafSetEntryBuilder() .withValue(SECOND_VALUE) - .withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(TEST_LEAF_LIST_QN, SECOND_VALUE)) + .withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue<>(TEST_LEAF_LIST_QN, SECOND_VALUE)) .build(); - final var leafSetNode = new ImmutableSystemLeafSetNodeBuilder() + final var leafSetNode = ImmutableNodes.newSystemLeafSetBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(TEST_LEAF_LIST_QN)) - .withChild((LeafSetEntryNode) firstEntryValue) - .withChild((LeafSetEntryNode) secondEntryValues) + .withChild(firstEntryValue) + .withChild(secondEntryValues) .build(); - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withChild(leafSetNode) .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(TEST_DATA_CONTAINER_QN)) .build(); } private static ContainerNode getUpdateTestDataContainerNode() { - final var thirdEntryValue = new ImmutableLeafSetEntryNodeBuilder() + final var thirdEntryValue = ImmutableNodes.newLeafSetEntryBuilder() .withValue(THIRD_VALUE) - .withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue(TEST_LEAF_LIST_QN, THIRD_VALUE)) + .withNodeIdentifier(new YangInstanceIdentifier.NodeWithValue<>(TEST_LEAF_LIST_QN, THIRD_VALUE)) .build(); - final LeafSetNode leafSetNode = new ImmutableSystemLeafSetNodeBuilder() + final LeafSetNode leafSetNode = ImmutableNodes.newSystemLeafSetBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(TEST_LEAF_LIST_QN)) - .withChild((LeafSetEntryNode) thirdEntryValue) + .withChild(thirdEntryValue) .build(); - return new ImmutableContainerNodeBuilder() + return ImmutableNodes.newContainerBuilder() .withChild(leafSetNode) .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier.create(TEST_DATA_CONTAINER_QN)) .build(); diff --git a/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfNmdaBaseServiceImpl.java b/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfNmdaBaseServiceImpl.java index f9b2086d84..82bda5b3ec 100755 --- a/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfNmdaBaseServiceImpl.java +++ b/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfNmdaBaseServiceImpl.java @@ -10,6 +10,7 @@ import static java.util.Objects.requireNonNull; import static org.opendaylight.netconf.client.mdsal.impl.NetconfMessageTransformUtil.NETCONF_RUNNING_NODEID; import static org.opendaylight.netconf.client.mdsal.impl.NetconfMessageTransformUtil.toId; +import static org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId; import com.google.common.base.Preconditions; import com.google.common.util.concurrent.ListenableFuture; @@ -46,12 +47,10 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter; import org.opendaylight.yangtools.yang.data.api.schema.stream.YangInstanceIdentifierWriter; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; -import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedMetadata; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.impl.schema.NormalizationResultHolder; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableAnydataNodeBuilder; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack; @@ -145,12 +144,12 @@ public ListenableFuture editData(QName targetDatastore, .orElse(null); final SchemaInferenceStack stack = SchemaInferenceStack.of(getEffectiveModelContext()); stack.enterSchemaTree(editNNContent.name().getNodeType()); - final AnydataNode editContent = new ImmutableAnydataNodeBuilder<>(NormalizedAnydata.class) + final AnydataNode editContent = ImmutableNodes.newAnydataBuilder(NormalizedAnydata.class) .withNodeIdentifier(NETCONF_EDIT_DATA_CONFIG_NODEID) .withValue(NormalizedAnydata.of(stack.toInference(), editNNContent, metadata)) .build(); - ChoiceNode editStructure = Builders.choiceBuilder().withNodeIdentifier(toId(EditContent.QNAME)) + ChoiceNode editStructure = ImmutableNodes.newChoiceBuilder().withNodeIdentifier(toId(EditContent.QNAME)) .withChild(editContent).build(); Preconditions.checkNotNull(editStructure); return getDOMRpcService().invokeRpc(NETCONF_EDIT_DATA_QNAME, @@ -169,55 +168,55 @@ public ListenableFuture deleteConfig(QName targetDatasto } private DataContainerChild getDatastoreNode(QName datastore) { - return Builders.leafBuilder().withNodeIdentifier(NETCONF_DATASTORE_NODEID) + return ImmutableNodes.newLeafBuilder().withNodeIdentifier(NETCONF_DATASTORE_NODEID) .withValue(datastore).build(); } private DataContainerChild getConfigFilterNode(Boolean configFilter) { - return Builders.leafBuilder().withNodeIdentifier(NETCONF_CONFIG_FILTER_NODEID) + return ImmutableNodes.newLeafBuilder().withNodeIdentifier(NETCONF_CONFIG_FILTER_NODEID) .withValue(configFilter).build(); } private DataContainerChild getMaxDepthNode(Integer maxDepth) { - return Builders.leafBuilder().withNodeIdentifier(NETCONF_MAX_DEPTH_NODEID) + return ImmutableNodes.newLeafBuilder().withNodeIdentifier(NETCONF_MAX_DEPTH_NODEID) .withValue(maxDepth).build(); } private DataContainerChild getOriginFilterNode(Set originFilter) { List> leafSetEntryNodes = new ArrayList<>(); originFilter.forEach(originFilterEntry -> { - leafSetEntryNodes.add((LeafSetEntryNode) Builders.leafSetEntryBuilder() + leafSetEntryNodes.add((LeafSetEntryNode) ImmutableNodes.newLeafSetEntryBuilder() .withNodeIdentifier(new NodeWithValue(NETCONF_ORIGIN_FILTER_NODEID.getNodeType(), originFilterEntry)) .withValue(originFilterEntry) .build()); }); - return Builders.leafSetBuilder().withNodeIdentifier(NETCONF_ORIGIN_FILTER_NODEID) + return ImmutableNodes.newSystemLeafSetBuilder().withNodeIdentifier(NETCONF_ORIGIN_FILTER_NODEID) .withValue(leafSetEntryNodes).build(); } private DataContainerChild getNegatedOriginFilterNode(Set negatedOriginFilter) { List> leafSetEntryNodes = new ArrayList<>(); negatedOriginFilter.forEach(negatedOriginFilterEntry -> { - leafSetEntryNodes.add((LeafSetEntryNode) Builders.leafSetEntryBuilder() + leafSetEntryNodes.add((LeafSetEntryNode) ImmutableNodes.newLeafSetEntryBuilder() .withNodeIdentifier(new NodeWithValue(NETCONF_NEGATED_ORIGIN_FILTER_NODEID.getNodeType(), negatedOriginFilterEntry)) .withValue(negatedOriginFilterEntry) .build()); }); - return Builders.leafSetBuilder().withNodeIdentifier(NETCONF_NEGATED_ORIGIN_FILTER_NODEID) + return ImmutableNodes.newSystemLeafSetBuilder().withNodeIdentifier(NETCONF_NEGATED_ORIGIN_FILTER_NODEID) .withValue(leafSetEntryNodes).build(); } private DataContainerChild getWithOriginNode() { - return Builders.leafBuilder().withNodeIdentifier(NETCONF_WITH_ORIGIN_NODEID) + return ImmutableNodes.newLeafBuilder().withNodeIdentifier(NETCONF_WITH_ORIGIN_NODEID) .withValue(Empty.value()) .build(); } private DataContainerChild getDefaultOperationNode(EffectiveOperation defaultEffectiveOperation) { final String opString = defaultEffectiveOperation.name().toLowerCase(Locale.US); - return Builders.leafBuilder().withNodeIdentifier(NodeIdentifier.create( + return ImmutableNodes.newLeafBuilder().withNodeIdentifier(NodeIdentifier.create( org.opendaylight.yang.svc.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.nmda.rev190107 .YangModuleInfoImpl.qnameOf("default-operation"))) .withValue(opString).build(); @@ -257,22 +256,22 @@ private ChoiceNode getOriginFilterSpecChoiceNode(final Set originFilter, } else { originFilterChild = getOriginFilterNode(originFilter); } - return Builders.choiceBuilder() + return ImmutableNodes.newChoiceBuilder() .withNodeIdentifier(NETCONF_ORIGIN_FILTERS_CHOICE_NODEID) .withChild(originFilterChild) .build(); } private ChoiceNode getFilterSpecChoiceNode(final YangInstanceIdentifier filterYII) { - final NormalizedNode filterNN = ImmutableNodes.fromInstanceId(getEffectiveModelContext(), filterYII); + final NormalizedNode filterNN = fromInstanceId(getEffectiveModelContext(), filterYII); final SchemaInferenceStack stack = SchemaInferenceStack.of(getEffectiveModelContext()); stack.enterSchemaTree(filterNN.name().getNodeType()); final AnydataNode subtreeFilter = - (AnydataNode) new ImmutableAnydataNodeBuilder(NormalizedAnydata.class) + ImmutableNodes.newAnydataBuilder(NormalizedAnydata.class) .withNodeIdentifier(NETCONF_FILTER_NODEID) .withValue(NormalizedAnydata.of(stack.toInference(), filterNN)) .build(); - return Builders.choiceBuilder() + return ImmutableNodes.newChoiceBuilder() .withNodeIdentifier(NETCONF_FILTER_CHOICE_NODEID) .withChild(subtreeFilter) .build(); diff --git a/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfTopologyPlugin.java b/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfTopologyPlugin.java index 4848d10f8c..f2c65473d3 100644 --- a/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfTopologyPlugin.java +++ b/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/NetconfTopologyPlugin.java @@ -55,10 +55,8 @@ protected boolean initProcedure() { lightyServices.getBindingDataBroker(), lightyServices.getRpcProviderService(), lightyServices.getClusterSingletonServiceProvider(), encryptionService); final NetconfClientFactory netconfFactory = new NetconfClientFactoryImpl(new DefaultNetconfTimer()); - final CredentialProvider credentialProvider - = new DefaultCredentialProvider(service); - final SslContextFactoryProvider factoryProvider - = new DefaultSslContextFactoryProvider(service); + final CredentialProvider credentialProvider = new DefaultCredentialProvider(service); + final SslContextFactoryProvider factoryProvider = new DefaultSslContextFactoryProvider(service); final NetconfClientConfigurationBuilderFactory factory = new NetconfClientConfigurationBuilderFactoryImpl( encryptionService, credentialProvider, factoryProvider); final NetconfTopologySchemaAssembler assembler = new NetconfTopologySchemaAssembler(1,1,10, TimeUnit.SECONDS); diff --git a/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/util/NetconfUtils.java b/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/util/NetconfUtils.java index fe8ded85c6..a7082e80f2 100644 --- a/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/util/NetconfUtils.java +++ b/lighty-modules/lighty-netconf-sb/src/main/java/io/lighty/modules/southbound/netconf/impl/util/NetconfUtils.java @@ -51,7 +51,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes; import org.opendaylight.yangtools.yang.data.api.schema.builder.DataContainerNodeBuilder; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; public final class NetconfUtils { @@ -107,27 +107,28 @@ public static DataContainerChild createEditConfigStructure(final EffectiveModelC final YangInstanceIdentifier dataPath) { final AnyxmlNode configContent = NetconfMessageTransformUtil .createEditConfigAnyxml(effectiveModelContext, dataPath, operation, lastChild); - return Builders.choiceBuilder().withNodeIdentifier(EDIT_CONTENT_NODEID).withChild(configContent).build(); + return ImmutableNodes.newChoiceBuilder() + .withNodeIdentifier(EDIT_CONTENT_NODEID).withChild(configContent).build(); } public static ContainerNode getEditConfigContent( final QName targetDatastore, final DataContainerChild editStructure, final Optional defaultOperation, final boolean rollback) { final DataContainerNodeBuilder editBuilder = - Builders.containerBuilder().withNodeIdentifier(NETCONF_EDIT_CONFIG_NODEID); + ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_EDIT_CONFIG_NODEID); // Target editBuilder.withChild(getTargetNode(targetDatastore)); // Default operation if (defaultOperation.isPresent()) { - editBuilder.withChild(Builders.leafBuilder().withNodeIdentifier(NETCONF_DEFAULT_OPERATION_NODEID) + editBuilder.withChild(ImmutableNodes.newLeafBuilder().withNodeIdentifier(NETCONF_DEFAULT_OPERATION_NODEID) .withValue(defaultOperation.get().name().toLowerCase(Locale.US)).build()); } // Error option if (rollback) { - editBuilder.withChild(Builders.leafBuilder().withNodeIdentifier(NETCONF_ERROR_OPTION_NODEID) + editBuilder.withChild(ImmutableNodes.newLeafBuilder().withNodeIdentifier(NETCONF_ERROR_OPTION_NODEID) .withValue("rollback-on-error").build()); } @@ -137,43 +138,43 @@ public static ContainerNode getEditConfigContent( } public static DataContainerChild getSourceNode(final QName sourceDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_SOURCE_NODEID) - .withChild(Builders.choiceBuilder().withNodeIdentifier(CONFIG_SOURCE_NODEID).withChild( - Builders.leafBuilder().withNodeIdentifier(new NodeIdentifier(sourceDatastore)) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_SOURCE_NODEID) + .withChild(ImmutableNodes.newChoiceBuilder().withNodeIdentifier(CONFIG_SOURCE_NODEID).withChild( + ImmutableNodes.newLeafBuilder().withNodeIdentifier(new NodeIdentifier(sourceDatastore)) .withValue(Empty.value()).build()) .build()).build(); } public static ContainerNode getLockContent(final QName targetDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_LOCK_NODEID) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_LOCK_NODEID) .withChild(getTargetNode(targetDatastore)).build(); } public static DataContainerChild getTargetNode(final QName targetDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_TARGET_NODEID) - .withChild(Builders.choiceBuilder().withNodeIdentifier(CONFIG_TARGET_NODEID).withChild( - Builders.leafBuilder().withNodeIdentifier(new NodeIdentifier(targetDatastore)) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_TARGET_NODEID) + .withChild(ImmutableNodes.newChoiceBuilder().withNodeIdentifier(CONFIG_TARGET_NODEID).withChild( + ImmutableNodes.newLeafBuilder().withNodeIdentifier(new NodeIdentifier(targetDatastore)) .withValue(Empty.value()).build()) .build()).build(); } public static ContainerNode getCopyConfigContent(final QName sourceDatastore, final QName targetDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_COPY_CONFIG_NODEID) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_COPY_CONFIG_NODEID) .withChild(getTargetNode(targetDatastore)).withChild(getSourceNode(sourceDatastore)).build(); } public static ContainerNode getDeleteConfigContent(final QName targetDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_DELETE_CONFIG_NODEID) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_DELETE_CONFIG_NODEID) .withChild(getTargetNode(targetDatastore)).build(); } public static ContainerNode getValidateContent(final QName sourceDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_VALIDATE_NODEID) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_VALIDATE_NODEID) .withChild(getSourceNode(sourceDatastore)).build(); } public static ContainerNode getUnLockContent(final QName targetDatastore) { - return Builders.containerBuilder().withNodeIdentifier(NETCONF_UNLOCK_NODEID) + return ImmutableNodes.newContainerBuilder().withNodeIdentifier(NETCONF_UNLOCK_NODEID) .withChild(getTargetNode(targetDatastore)).build(); } } diff --git a/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceTest.java b/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceTest.java index c7dd553e3e..b4fd3e8f0f 100755 --- a/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceTest.java +++ b/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfBaseServiceTest.java @@ -36,8 +36,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; -import org.opendaylight.yangtools.yang.data.spi.node.impl.ImmutableLeafNodeBuilder; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.testng.annotations.Test; import org.w3c.dom.Element; @@ -142,10 +141,10 @@ public void testBaseServiceEditConfigMock() { final String editVersionValue = "test_version_x_x_x"; - MapEntryNode schema = Builders.mapEntryBuilder() + MapEntryNode schema = ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifierWithPredicates .of(Schema.QNAME, QName.create(Schema.QNAME, "identifier"), "listkeyvalue1")) - .withChild((DataContainerChild) new ImmutableLeafNodeBuilder() + .withChild(ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(QName.create(Schema.QNAME, "version"))) .withValue(editVersionValue) .build()) diff --git a/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfNmdaBaseServiceTest.java b/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfNmdaBaseServiceTest.java index 929aba45a7..a535868927 100755 --- a/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfNmdaBaseServiceTest.java +++ b/lighty-modules/lighty-netconf-sb/src/test/java/io/lighty/modules/southbound/netconf/tests/NetconfNmdaBaseServiceTest.java @@ -43,7 +43,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.testng.annotations.Test; import org.w3c.dom.Element; @@ -141,7 +141,7 @@ public void testBaseServiceGetDataFullMock() { @Test public void testBaseServiceEditDataMock() { - MapEntryNode schema = Builders.mapEntryBuilder() + MapEntryNode schema = ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(YangInstanceIdentifier.NodeIdentifierWithPredicates .of(Schema.QNAME, TEST_SCHEMA_KEYS)) .build(); diff --git a/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConf.java b/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConf.java index 8e14a88420..1180b8db46 100644 --- a/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConf.java +++ b/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConf.java @@ -16,7 +16,6 @@ import java.net.InetAddress; import java.net.InetSocketAddress; import java.util.Set; -import java.util.concurrent.ScheduledExecutorService; import javax.ws.rs.core.Application; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandlerCollection; @@ -57,14 +56,13 @@ public class CommunityRestConf extends AbstractLightyModule { private final String restconfServletContextPath; private Server jettyServer; private LightyServerBuilder lightyServerBuilder; - private final ScheduledExecutorService scheduledThreadPool; public CommunityRestConf(final DOMDataBroker domDataBroker, final DOMRpcService domRpcService, final DOMActionService domActionService, final DOMNotificationService domNotificationService, final DOMMountPointService domMountPointService, final DOMSchemaService domSchemaService, final InetAddress inetAddress, final int httpPort, final String restconfServletContextPath, - final LightyServerBuilder serverBuilder, final ScheduledExecutorService threadPool) { + final LightyServerBuilder serverBuilder) { this.domDataBroker = domDataBroker; this.domRpcService = domRpcService; this.domActionService = domActionService; @@ -75,17 +73,16 @@ public CommunityRestConf(final DOMDataBroker domDataBroker, final DOMRpcService this.httpPort = httpPort; this.inetAddress = inetAddress; this.restconfServletContextPath = restconfServletContextPath; - this.scheduledThreadPool = threadPool; } public CommunityRestConf(final DOMDataBroker domDataBroker, final DOMRpcService domRpcService, final DOMActionService domActionService, final DOMNotificationService domNotificationService, final DOMMountPointService domMountPointService, final DOMSchemaService domSchemaService, final InetAddress inetAddress, final int httpPort, - final String restconfServletContextPath, final ScheduledExecutorService threadPool) { + final String restconfServletContextPath) { this(domDataBroker, domRpcService, domActionService, domNotificationService, domMountPointService, domSchemaService, inetAddress, httpPort, - restconfServletContextPath, null, threadPool); + restconfServletContextPath, null); } @Override diff --git a/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConfBuilder.java b/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConfBuilder.java index 0061728f2d..d8c4e90c64 100644 --- a/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConfBuilder.java +++ b/lighty-modules/lighty-restconf-nb-community/src/main/java/io/lighty/modules/northbound/restconf/community/impl/CommunityRestConfBuilder.java @@ -9,7 +9,6 @@ import io.lighty.modules.northbound.restconf.community.impl.config.RestConfConfiguration; import io.lighty.server.LightyServerBuilder; -import java.util.concurrent.ScheduledExecutorService; /** * Builder for {@link CommunityRestConf}. @@ -18,7 +17,6 @@ public final class CommunityRestConfBuilder { private RestConfConfiguration restconfConfiguration = null; private LightyServerBuilder lightyServerBuilder = null; - private ScheduledExecutorService threadPool = null; private CommunityRestConfBuilder(final RestConfConfiguration configuration) { @@ -52,10 +50,6 @@ public CommunityRestConfBuilder withLightyServer(final LightyServerBuilder serve * @param pool input scheduledThreadPool. * @return instance of {@link CommunityRestConfBuilder}. */ - public CommunityRestConfBuilder withScheduledThreadPool(final ScheduledExecutorService pool) { - this.threadPool = pool; - return this; - } /** * Build new {@link CommunityRestConf} instance from {@link CommunityRestConfBuilder}. @@ -68,6 +62,6 @@ public CommunityRestConf build() { this.restconfConfiguration.getDomMountPointService(), this.restconfConfiguration.getDomSchemaService(), this.restconfConfiguration.getInetAddress(), this.restconfConfiguration.getHttpPort(), - this.restconfConfiguration.getRestconfServletContextPath(), this.lightyServerBuilder, this.threadPool); + this.restconfConfiguration.getRestconfServletContextPath(), this.lightyServerBuilder); } } diff --git a/lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/YangPatchTest.java b/lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/YangPatchTest.java index 510cdc8d06..ce67fc6ac4 100644 --- a/lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/YangPatchTest.java +++ b/lighty-modules/lighty-restconf-nb-community/src/test/java/io/lighty/modules/northbound/restconf/community/impl/tests/YangPatchTest.java @@ -32,7 +32,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.SystemMapNode; -import org.opendaylight.yangtools.yang.data.impl.schema.Builders; +import org.opendaylight.yangtools.yang.data.spi.node.ImmutableNodes; import org.testng.annotations.Test; public class YangPatchTest extends CommunityRestConfTestBase { @@ -87,27 +87,27 @@ public void patchDataReplaceTest() throws Exception { } private static ContainerNode getContainerWithData() { - final LeafNode nameLeafA = Builders.leafBuilder() + final LeafNode nameLeafA = ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(EXAMPLE_LIST_NAME)) .withValue(MY_LIST_1_A) .build(); - final LeafNode buildLeaf1 = Builders.leafBuilder() + final LeafNode buildLeaf1 = ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(MY_LEAF_11)) .withValue(I_AM_LEAF_11_0) .build(); - final LeafNode buildLeaf2 = Builders.leafBuilder() + final LeafNode buildLeaf2 = ImmutableNodes.newLeafBuilder() .withNodeIdentifier(NodeIdentifier.create(MY_LEAF_12)) .withValue(I_AM_LEAF_12_1) .build(); - final MapEntryNode mapEntryNode = Builders.mapEntryBuilder() + final MapEntryNode mapEntryNode = ImmutableNodes.newMapEntryBuilder() .withNodeIdentifier(NodeIdentifierWithPredicates.of(EXAMPLE_LIST)) .withValue(List.of(nameLeafA, buildLeaf1, buildLeaf2)) .build(); - final SystemMapNode myList = Builders.mapBuilder() + final SystemMapNode myList = ImmutableNodes.newSystemMapBuilder() .withNodeIdentifier(NodeIdentifier.create(EXAMPLE_LIST)) .withValue(Collections.singletonList(mapEntryNode)) .build(); - return Builders.containerBuilder() + return ImmutableNodes.newContainerBuilder() .withNodeIdentifier(NodeIdentifier.create(CONTAINER_ID)) .withValue(Collections.singletonList(myList)) .build();