summaryrefslogtreecommitdiffstats
path: root/infra
diff options
context:
space:
mode:
Diffstat (limited to 'infra')
-rw-r--r--infra/bgp-translate-impl/src/main/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriter.java4
-rw-r--r--infra/bgp-translate-impl/src/main/test/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriterTest.java2
-rw-r--r--infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java16
-rw-r--r--infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java14
-rw-r--r--infra/data-api/src/main/java/io/fd/honeycomb/data/ReadableDataManager.java7
-rw-r--r--infra/data-impl/pom.xml5
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/DataBroker.java66
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java38
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeManager.java25
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/Modification.java12
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java2
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/NormalizedNodeUpdate.java9
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadOnlyTransaction.java28
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadWriteTransaction.java55
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java52
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ValidableTransaction.java18
-rw-r--r--infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java32
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java34
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java8
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java11
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java12
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java18
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java44
-rw-r--r--infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java15
-rw-r--r--infra/impl/src/main/java/io/fd/honeycomb/impl/EmptyDomMountService.java8
-rw-r--r--infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java2
-rw-r--r--infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java4
-rw-r--r--infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java20
-rw-r--r--infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java2
-rw-r--r--infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java2
-rw-r--r--infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/AbstractInfraTest.java10
-rw-r--r--infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java8
-rw-r--r--infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java8
-rw-r--r--infra/minimal-distribution-core/pom.xml5
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/BindingDataBrokerProvider.java8
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.java10
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DOMNotificationServiceProvider.java2
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DataStoreProvider.java14
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombBindingDataBrokerProvider.java9
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.java2
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMRpcServiceProvider.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java8
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java12
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/LegacyBindingDataBrokerProvider.java44
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ModifiableDTDelegProvider.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/PersistedConfigInitializerProvider.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/HoneycombContextDOMDataBrokerProvider.java2
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/PersistedContextInitializerProvider.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.java2
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/oper/ReadableDTDelegProvider.java7
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapter.java2
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapterProvider.java2
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/LegacySerializerProvider.java47
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SchemaModule.java4
-rw-r--r--infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SerializerProvider.java2
-rw-r--r--infra/northbound/bgp-extensions/evpn/src/main/java/io/fd/honeycomb/northbound/bgp/extension/EvpnWriterFactory.java4
-rw-r--r--infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/BGPTableTypeRegistryConsumerProvider.java2
-rw-r--r--infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/RIBExtensionConsumerContextProvider.java12
-rw-r--r--infra/northbound/bgp-extensions/inet/src/main/java/io/fd/honeycomb/northbound/bgp/extension/InetWriterFactory.java13
-rw-r--r--infra/northbound/bgp-extensions/l3-vpn-v4/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV4WriterFactory.java4
-rw-r--r--infra/northbound/bgp-extensions/l3-vpn-v6/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV6WriterFactory.java4
-rw-r--r--infra/northbound/bgp-extensions/labeled-unicast/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LabeledUnicastWriterFactory.java6
-rw-r--r--infra/northbound/bgp-extensions/linkstate/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LinkstateWriterFactory.java4
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/ApplicationRibWriterFactory.java2
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpModule.java18
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java10
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReaderFactoryProvider.java9
-rw-r--r--infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/neighbors/BgpPeerWriterFactory.java2
-rw-r--r--infra/northbound/bgp/src/test/java/io/fd/honeycomb/infra/bgp/neighbors/NeighborCustomizerTest.java3
-rw-r--r--infra/northbound/netconf/pom.xml2
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/HoneycombNotification2NetconfProvider.java6
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfBindingBrokerProvider.java2
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMdsalMapperProvider.java10
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfModule.java15
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringMapperProvider.java2
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringReaderFactoryProvider.java8
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java8
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationsReaderFactoryProvider.java10
-rw-r--r--infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfServerDispatcherProvider.java4
-rw-r--r--infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/BrokerFacadeProvider.java10
-rw-r--r--infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/ControllerContextProvider.java2
-rw-r--r--infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollector.java2
-rw-r--r--infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/NotificationProducerTracker.java4
-rw-r--r--infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollectorTest.java2
-rw-r--r--infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/NotificationProducerTrackerTest.java2
-rw-r--r--infra/rpc/api/src/main/java/io/fd/honeycomb/rpc/RpcException.java2
-rw-r--r--infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/HoneycombDOMRpcService.java24
-rw-r--r--infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java2
-rw-r--r--infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/HoneycombDOMRpcServiceTest.java5
-rw-r--r--infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/RpcRegistryBuilderTest.java5
-rw-r--r--infra/test-utils/test-tools/pom.xml5
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/AbstractYangContextHolder.java5
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java2
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/HoneycombTestRunner.java2
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java2
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangContextProducer.java2
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java38
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java2
-rw-r--r--infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java6
-rw-r--r--infra/test-utils/test-tools/src/test/java/io/fd/honeycomb/test/tools/AbstractYangDataProcessorTest.java2
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/MappingContext.java2
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Initializer.java2
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java2
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/InitRegistry.java2
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/ReaderRegistry.java5
-rw-r--r--infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/WriteContext.java2
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitListReader.java4
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitReader.java19
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericListReader.java5
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java6
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistry.java4
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReader.java2
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReader.java6
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/GenericListWriter.java2
-rw-r--r--infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java5
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericInitListReaderTest.java10
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericIntReaderTest.java8
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryTest.java2
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderTest.java4
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReaderTest.java2
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReaderTest.java15
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/GenericListWriterTest.java8
-rw-r--r--infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryTest.java2
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java6
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java35
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/ReflectionUtils.java6
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/TransactionMappingContext.java22
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java6
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/BindingBrokerReader.java23
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/DelegatingReader.java2
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/KeepaliveReaderWrapper.java4
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizer.java2
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveReaderCustomizer.java2
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManager.java6
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriter.java26
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/LegacyBindingBrokerWriter.java70
-rw-r--r--infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/TransactionWriteContext.java29
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/impl/write/util/TransactionWriteContextTest.java22
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/RealtimeMappingContextTest.java50
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/TransactionMappingContextTest.java24
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/BindingBrokerReaderTest.java19
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizerTest.java2
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java2
-rw-r--r--infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriterTest.java15
147 files changed, 854 insertions, 725 deletions
diff --git a/infra/bgp-translate-impl/src/main/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriter.java b/infra/bgp-translate-impl/src/main/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriter.java
index ec850a70c..23e0e1a96 100644
--- a/infra/bgp-translate-impl/src/main/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriter.java
+++ b/infra/bgp-translate-impl/src/main/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriter.java
@@ -52,7 +52,7 @@ public final class LocRibWriter implements RibWriter {
// TODO(HONEYCOMB-367): updates for whole list instead of list item
// are needed to support deleteALL (might be required for performance reasons).
bgpDataBroker
- .registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, managedId),
- new LocRibChangeListener(writer));
+ .registerDataTreeChangeListener(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, managedId),
+ new LocRibChangeListener(writer));
}
}
diff --git a/infra/bgp-translate-impl/src/main/test/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriterTest.java b/infra/bgp-translate-impl/src/main/test/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriterTest.java
index e92f28653..3d914a553 100644
--- a/infra/bgp-translate-impl/src/main/test/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriterTest.java
+++ b/infra/bgp-translate-impl/src/main/test/java/io/fd/honeycomb/bgp/translate/impl/LocRibWriterTest.java
@@ -27,8 +27,8 @@ import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.Ipv4Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.ipv4.routes.Ipv4Route;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.ipv4.routes.Ipv4RouteKey;
diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java
index 4488f8342..20085803a 100644
--- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java
+++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/RestoringInitializer.java
@@ -24,11 +24,11 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -90,7 +90,7 @@ public class RestoringInitializer implements DataTreeInitializer {
try {
final ContainerNode containerNode = jsonReader.readData(schemaService.getGlobalContext(), path);
- final DOMDataWriteTransaction domDataWriteTransaction = dataTree.newWriteOnlyTransaction();
+ final DOMDataTreeWriteTransaction domDataWriteTransaction = dataTree.newWriteOnlyTransaction();
for (DataContainerChild<? extends YangInstanceIdentifier.PathArgument, ?> dataContainerChild : containerNode
.getValue()) {
final YangInstanceIdentifier iid = YangInstanceIdentifier.create(dataContainerChild.getIdentifier());
@@ -110,11 +110,11 @@ public class RestoringInitializer implements DataTreeInitializer {
}
// Block here to prevent subsequent initializers processing before context is fully restored
- domDataWriteTransaction.submit().checkedGet();
+ domDataWriteTransaction.commit().get();
LOG.debug("Data from {} restored successfully", path);
- } catch (IOException | TransactionCommitFailedException e) {
- throw new InitializeException("Unable to restore data from " + path, e);
+ } catch (IOException | InterruptedException | ExecutionException ex) {
+ throw new InitializeException("Unable to restore data from " + path, ex);
}
}
diff --git a/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java b/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java
index 3aeb6895b..7c10988bf 100644
--- a/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java
+++ b/infra/cfg-init/src/test/java/io/fd/honeycomb/data/init/RestoringInitializerTest.java
@@ -20,7 +20,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
-import com.google.common.util.concurrent.Futures;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
@@ -31,10 +30,11 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -53,7 +53,7 @@ public class RestoringInitializerTest {
@Mock
private ContainerNode data;
@Mock
- private DOMDataWriteTransaction writeTx;
+ private DOMDataTreeWriteTransaction writeTx;
private Path path;
private YangInstanceIdentifier.NodeIdentifier nodeId =
new YangInstanceIdentifier.NodeIdentifier(QName.create("namespace", "data"));
@@ -65,7 +65,7 @@ public class RestoringInitializerTest {
when(schemaService.getGlobalContext()).thenReturn(schemaContext);
when(jsonReader.readData(schemaContext, path)).thenReturn(data);
when(dataTree.newWriteOnlyTransaction()).thenReturn(writeTx);
- when(writeTx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(writeTx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
when(data.getValue()).thenReturn(Collections.singleton(data));
when(data.getIdentifier()).thenReturn(nodeId);
}
@@ -92,7 +92,7 @@ public class RestoringInitializerTest {
verify(dataTree).newWriteOnlyTransaction();
verify(writeTx).put(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.create(nodeId), data);
- verify(writeTx).submit();
+ verify(writeTx).commit();
}
@Test
diff --git a/infra/data-api/src/main/java/io/fd/honeycomb/data/ReadableDataManager.java b/infra/data-api/src/main/java/io/fd/honeycomb/data/ReadableDataManager.java
index 0e772b79c..c0eeb6dce 100644
--- a/infra/data-api/src/main/java/io/fd/honeycomb/data/ReadableDataManager.java
+++ b/infra/data-api/src/main/java/io/fd/honeycomb/data/ReadableDataManager.java
@@ -17,10 +17,9 @@
package io.fd.honeycomb.data;
import com.google.common.annotations.Beta;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
+import java.util.Optional;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -37,5 +36,5 @@ public interface ReadableDataManager {
* @param path Path of the node
* @return a CheckFuture containing the result of the read.
*/
- CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(@Nonnull final YangInstanceIdentifier path);
+ FluentFuture<Optional<NormalizedNode<?, ?>>> read(@Nonnull final YangInstanceIdentifier path);
}
diff --git a/infra/data-impl/pom.xml b/infra/data-impl/pom.xml
index 4587ea842..ede81a1c6 100644
--- a/infra/data-impl/pom.xml
+++ b/infra/data-impl/pom.xml
@@ -66,6 +66,11 @@
<groupId>org.opendaylight.netconf</groupId>
<artifactId>mdsal-netconf-connector</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.8.1</version>
+ </dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/DataBroker.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/DataBroker.java
index 1952f8778..8f20456ed 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/DataBroker.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/DataBroker.java
@@ -18,21 +18,22 @@ package io.fd.honeycomb.data.impl;
import static com.google.common.base.Preconditions.checkNotNull;
+import com.google.common.collect.ClassToInstanceMap;
+import com.google.common.collect.ImmutableClassToInstanceMap;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.ReadableDataManager;
import java.io.Closeable;
import java.io.IOException;
-import java.util.Collections;
-import java.util.Map;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBrokerExtension;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain;
+import org.eclipse.jdt.annotation.NonNull;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.Logger;
@@ -57,35 +58,32 @@ public class DataBroker implements DOMDataBroker, Closeable {
}
@Override
- public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
- LOG.trace("DataBroker({}).newReadOnlyTransaction()", this);
- return transactionFactory.newReadOnlyTransaction();
+ public DOMDataTreeReadTransaction newReadOnlyTransaction() {
+ LOG.trace("DataBroker({}).newReadTransaction()", this);
+ return transactionFactory.newReadTransaction();
}
@Override
- public DOMDataReadWriteTransaction newReadWriteTransaction() {
+ public DOMDataTreeReadWriteTransaction newReadWriteTransaction() {
LOG.trace("DataBroker({}).newReadWriteTransaction()", this);
return transactionFactory.newReadWriteTransaction();
}
@Override
- public DOMDataWriteTransaction newWriteOnlyTransaction() {
- LOG.trace("DataBroker({}).newWriteOnlyTransaction()", this);
- return transactionFactory.newWriteOnlyTransaction();
+ public DOMDataTreeWriteTransaction newWriteOnlyTransaction() {
+ LOG.trace("DataBroker({}).newWriteTransaction()", this);
+ return transactionFactory.newWriteTransaction();
}
@Override
- public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) {
+ public DOMTransactionChain createTransactionChain(final DOMTransactionChainListener listener) {
throw new UnsupportedOperationException("Not supported");
}
- @Nonnull
@Override
- public Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> getSupportedExtensions() {
- return Collections.singletonMap(
- DOMDataTransactionValidator.class,
- (DOMDataTransactionValidator) tx -> ((ValidableTransaction)tx).validate()
- );
+ public @NonNull ClassToInstanceMap<DOMDataBrokerExtension> getExtensions() {
+ return ImmutableClassToInstanceMap.of(DOMDataTransactionValidator.class,
+ tx -> ((ValidableTransaction) tx).validate());
}
/**
@@ -118,11 +116,11 @@ public class DataBroker implements DOMDataBroker, Closeable {
*/
public interface TransactionFactory {
- DOMDataReadOnlyTransaction newReadOnlyTransaction();
+ DOMDataTreeReadTransaction newReadTransaction();
- DOMDataReadWriteTransaction newReadWriteTransaction();
+ DOMDataTreeReadWriteTransaction newReadWriteTransaction();
- DOMDataWriteTransaction newWriteOnlyTransaction();
+ DOMDataTreeWriteTransaction newWriteTransaction();
}
/**
@@ -139,12 +137,12 @@ public class DataBroker implements DOMDataBroker, Closeable {
}
@Override
- public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
+ public DOMDataTreeReadTransaction newReadTransaction() {
return ReadOnlyTransaction.create(configDataTree.newModification(), operationalDataTree);
}
@Override
- public DOMDataReadWriteTransaction newReadWriteTransaction() {
+ public DOMDataTreeReadWriteTransaction newReadWriteTransaction() {
final DataModification configModification = configDataTree.newModification();
return new ReadWriteTransaction(
ReadOnlyTransaction.create(configModification, operationalDataTree),
@@ -152,7 +150,7 @@ public class DataBroker implements DOMDataBroker, Closeable {
}
@Override
- public DOMDataWriteTransaction newWriteOnlyTransaction() {
+ public DOMDataTreeWriteTransaction newWriteTransaction() {
return WriteTransaction.createConfigOnly(configDataTree.newModification());
}
}
@@ -168,20 +166,20 @@ public class DataBroker implements DOMDataBroker, Closeable {
}
@Override
- public DOMDataReadOnlyTransaction newReadOnlyTransaction() {
+ public DOMDataTreeReadTransaction newReadTransaction() {
return ReadOnlyTransaction.createOperationalOnly(operationalDataTree);
}
@Override
- public DOMDataReadWriteTransaction newReadWriteTransaction() {
+ public DOMDataTreeReadWriteTransaction newReadWriteTransaction() {
final DataModification dataModification = operationalDataTree.newModification();
return new ReadWriteTransaction(
- ReadOnlyTransaction.createOperationalOnly(dataModification),
- WriteTransaction.createOperationalOnly(dataModification));
+ ReadOnlyTransaction.createOperationalOnly(dataModification),
+ WriteTransaction.createOperationalOnly(dataModification));
}
@Override
- public DOMDataWriteTransaction newWriteOnlyTransaction() {
+ public DOMDataTreeWriteTransaction newWriteTransaction() {
return WriteTransaction.createOperationalOnly(operationalDataTree.newModification());
}
}
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java
index b9246f3c4..094e621eb 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegator.java
@@ -17,15 +17,13 @@
package io.fd.honeycomb.data.impl;
import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.util.concurrent.Futures.immediateCheckedFuture;
import static io.fd.honeycomb.data.impl.ModifiableDataTreeDelegator.DataTreeWriteContextFactory.DataTreeWriteContext;
import static io.fd.honeycomb.data.impl.ModifiableDataTreeManager.DataTreeContextFactory.DataTreeContext;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Optional;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.data.ReadableDataManager;
import io.fd.honeycomb.translate.MappingContext;
@@ -41,14 +39,17 @@ import io.fd.honeycomb.translate.write.registry.WriterRegistry;
import io.fd.honeycomb.translate.write.registry.WriterRegistry.DataObjectUpdates;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.Set;
+import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -67,7 +68,8 @@ import org.slf4j.LoggerFactory;
public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager {
private static final Logger LOG = LoggerFactory.getLogger(ModifiableDataTreeDelegator.class);
- private static final ReadableDataManager EMPTY_OPERATIONAL = p -> immediateCheckedFuture(Optional.absent());
+ private static final ReadableDataManager EMPTY_OPERATIONAL =
+ p -> FluentFutures.immediateFluentFuture(Optional.empty());
private final WriterRegistry writerRegistry;
private final DataBroker contextBroker;
@@ -163,10 +165,10 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
try {
writerRegistry.processModifications(baUpdates, ctx);
- final CheckedFuture<Void, TransactionCommitFailedException> contextUpdateResult =
- ((TransactionMappingContext) mappingContext).submit();
+ final FluentFuture<? extends CommitInfo> contextUpdateResult =
+ ((TransactionMappingContext) mappingContext).commit();
// Blocking on context data update
- contextUpdateResult.checkedGet();
+ contextUpdateResult.get();
} catch (UpdateFailedException e) {
// TODO - HONEYCOMB-411
LOG.warn("Failed to apply all changes", e);
@@ -192,11 +194,11 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
// not passing the cause,its logged above and it would be logged after transaction
// ended again(prevent double logging of same error
throw new Reverter.RevertSuccessException(getNonProcessedNodes(baUpdates, processed));
- } catch (TransactionCommitFailedException e) {
+ } catch (InterruptedException | ExecutionException ex) {
// TODO HONEYCOMB-162 revert should probably occur when context is not written successfully
final String msg = "Error while updating mapping context data";
- LOG.error(msg, e);
- throw new TranslationException(msg, e);
+ LOG.error(msg, ex);
+ throw new TranslationException(msg, ex);
} finally {
// Using finally instead of try-with-resources in order to leave ctx open for BulkUpdateException catch
// block. The context is needed there, but try-with-resources closes the resource before handling ex.
@@ -218,9 +220,10 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
@SuppressWarnings("squid:S2095")
private TransactionWriteContext getRevertTransactionContext(final MappingContext affectedMappingContext) {
// Before Tx == after partial update
- final DOMDataReadOnlyTransaction beforeTx = ReadOnlyTransaction.create(this, EMPTY_OPERATIONAL);
+ final DOMDataTreeReadTransaction beforeTx = ReadOnlyTransaction.create(this, EMPTY_OPERATIONAL);
// After Tx == before partial update
- final DOMDataReadOnlyTransaction afterTx = ReadOnlyTransaction.create(untouchedModification, EMPTY_OPERATIONAL);
+ final DOMDataTreeReadTransaction afterTx =
+ ReadOnlyTransaction.create(untouchedModification, EMPTY_OPERATIONAL);
return new TransactionWriteContext(serializer, beforeTx, afterTx, affectedMappingContext);
}
@@ -229,9 +232,10 @@ public final class ModifiableDataTreeDelegator extends ModifiableDataTreeManager
@SuppressWarnings("squid:S2095")
private TransactionWriteContext getTransactionWriteContext() {
// Before Tx must use modification
- final DOMDataReadOnlyTransaction beforeTx = ReadOnlyTransaction.create(untouchedModification, EMPTY_OPERATIONAL);
+ final DOMDataTreeReadTransaction
+ beforeTx = ReadOnlyTransaction.create(untouchedModification, EMPTY_OPERATIONAL);
// After Tx must use current modification
- final DOMDataReadOnlyTransaction afterTx = ReadOnlyTransaction.create(this, EMPTY_OPERATIONAL);
+ final DOMDataTreeReadTransaction afterTx = ReadOnlyTransaction.create(this, EMPTY_OPERATIONAL);
final TransactionMappingContext mappingContext = new TransactionMappingContext(
contextBroker.newReadWriteTransaction());
return new TransactionWriteContext(serializer, beforeTx, afterTx, mappingContext);
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeManager.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeManager.java
index 4fa517c6e..f75ee64f5 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeManager.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModifiableDataTreeManager.java
@@ -18,19 +18,18 @@ package io.fd.honeycomb.data.impl;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.util.concurrent.Futures.immediateCheckedFuture;
import static io.fd.honeycomb.data.impl.ModifiableDataTreeManager.DataTreeContextFactory.DataTreeContext;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.data.ModifiableDataManager;
-import io.fd.honeycomb.translate.ValidationFailedException;
import io.fd.honeycomb.translate.TranslationException;
+import io.fd.honeycomb.translate.ValidationFailedException;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.apache.commons.lang3.builder.RecursiveToStringStyle;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.CursorAwareDataTreeModification;
@@ -69,7 +68,7 @@ public class ModifiableDataTreeManager implements ModifiableDataManager {
}
@Override
- public final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(@Nonnull final YangInstanceIdentifier path) {
+ public final FluentFuture<Optional<NormalizedNode<?, ?>>> read(@Nonnull final YangInstanceIdentifier path) {
return newModification().read(path);
}
@@ -83,14 +82,12 @@ public class ModifiableDataTreeManager implements ModifiableDataManager {
}
@Override
- public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(
- @Nonnull final YangInstanceIdentifier path) {
- // TODO(HONEYCOMB-192): switch to java.util.Optional when rest of ODL infra does
- final Optional<NormalizedNode<?, ?>> node = Optional.fromNullable(modification.readNode(path).orElse(null));
+ public FluentFuture<Optional<NormalizedNode<?, ?>>> read(@Nonnull final YangInstanceIdentifier path) {
+ final Optional<NormalizedNode<?, ?>> node = modification.readNode(path);
if (LOG.isTraceEnabled() && node.isPresent()) {
LOG.trace("ConfigSnapshot.read: {}", node.get());
}
- return immediateCheckedFuture(node);
+ return FluentFutures.immediateFluentFuture(node);
}
@Override
@@ -145,9 +142,9 @@ public class ModifiableDataTreeManager implements ModifiableDataManager {
// Sealed modification cannot be altered, so create copy.
final CursorAwareDataTreeModification modificationCopy =
(CursorAwareDataTreeModification) snapshot.newModification();
- final DataTreeModificationCursor cursor = modificationCopy.createCursor(dataTree.getRootPath());
- checkState(cursor != null, "DataTreeModificationCursor for root path should not be null");
- modification.applyToCursor(cursor);
+ Optional<? extends DataTreeModificationCursor> cursor = modificationCopy.openCursor(dataTree.getRootPath());
+ checkState(cursor.isPresent(), "DataTreeModificationCursor for root path should not be empty");
+ modification.applyToCursor(cursor.get());
// Then validate it.
validateCandidate(prepareCandidateContext(modificationCopy));
}
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/Modification.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/Modification.java
index b95fc981d..358548ee4 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/Modification.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/Modification.java
@@ -88,14 +88,12 @@ final class Modification {
return dataCandidate.getModificationType();
}
- com.google.common.base.Optional<NormalizedNode<?, ?>> getDataBefore() {
- // TODO(HONEYCOMB-192): switch to java.util.Optional when rest of ODL infra does
- return com.google.common.base.Optional.fromNullable(dataCandidate.getDataBefore().orElse(null));
+ Optional<NormalizedNode<?, ?>> getDataBefore() {
+ return dataCandidate.getDataBefore();
}
- com.google.common.base.Optional<NormalizedNode<?, ?>> getDataAfter() {
- // TODO(HONEYCOMB-192): switch to java.util.Optional when rest of ODL infra does
- return com.google.common.base.Optional.fromNullable(dataCandidate.getDataAfter().orElse(null));
+ Optional<NormalizedNode<?, ?>> getDataAfter() {
+ return dataCandidate.getDataAfter();
}
Object getSchemaNode() {
@@ -216,7 +214,7 @@ final class Modification {
((SchemaNode) schemaNode).getQName().equals(identifier.getNodeType())) {
found = schemaNode;
} else {
- found = ((DataNodeContainer) schemaNode).getDataChildByName(identifier.getNodeType());
+ found = ((DataNodeContainer) schemaNode).findDataChildByName(identifier.getNodeType()).orElse(null);
}
} else if (schemaNode instanceof ChoiceSchemaNode) {
// For choices, iterate through all the cases
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java
index 210408e39..b6adabdcc 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ModificationDiff.java
@@ -135,7 +135,7 @@ final class ModificationDiff {
private ModificationDiff detectUnderDisappearedNonPresenceContainer(
@Nonnull final Modification modification) {
- final com.google.common.base.Optional<NormalizedNode<?, ?>> dataBefore = modification.getDataBefore();
+ final java.util.Optional<NormalizedNode<?, ?>> dataBefore = modification.getDataBefore();
// is disappear case
if (dataBefore.isPresent()) {
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/NormalizedNodeUpdate.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/NormalizedNodeUpdate.java
index bfc8a1e2c..86e312834 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/NormalizedNodeUpdate.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/NormalizedNodeUpdate.java
@@ -19,6 +19,7 @@ package io.fd.honeycomb.data.impl;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
+import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -60,13 +61,11 @@ final class NormalizedNodeUpdate {
}
static NormalizedNodeUpdate create(@Nonnull final Modification modification) {
- final com.google.common.base.Optional<NormalizedNode<?, ?>> beforeData =
- modification.getDataBefore();
- final com.google.common.base.Optional<NormalizedNode<?, ?>> afterData =
- modification.getDataAfter();
+ final Optional<NormalizedNode<?, ?>> beforeData = modification.getDataBefore();
+ final Optional<NormalizedNode<?, ?>> afterData = modification.getDataAfter();
checkArgument(beforeData.isPresent() || afterData.isPresent(),
"Both before and after data are null for %s", modification.getId());
- return NormalizedNodeUpdate.create(modification.getId(), beforeData.orNull(), afterData.orNull());
+ return NormalizedNodeUpdate.create(modification.getId(), beforeData.orElse(null), afterData.orElse(null));
}
static NormalizedNodeUpdate create(@Nonnull final YangInstanceIdentifier id,
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadOnlyTransaction.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadOnlyTransaction.java
index dcd456a27..ed401eef9 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadOnlyTransaction.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadOnlyTransaction.java
@@ -21,23 +21,23 @@ import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
import com.google.common.base.Function;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.data.ReadableDataManager;
+import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-final class ReadOnlyTransaction implements DOMDataReadOnlyTransaction {
+final class ReadOnlyTransaction implements DOMDataTreeReadTransaction {
private static final Logger LOG = LoggerFactory.getLogger(ReadOnlyTransaction.class);
@@ -70,9 +70,8 @@ final class ReadOnlyTransaction implements DOMDataReadOnlyTransaction {
}
@Override
- public synchronized CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(
- final LogicalDatastoreType store,
- final YangInstanceIdentifier path) {
+ public synchronized FluentFuture<Optional<NormalizedNode<?, ?>>> read(final LogicalDatastoreType store,
+ final YangInstanceIdentifier path) {
LOG.debug("ReadOnlyTransaction.read(), store={}, path={}", store, path);
checkState(!closed, "Transaction has been closed");
@@ -86,12 +85,13 @@ final class ReadOnlyTransaction implements DOMDataReadOnlyTransaction {
}
@Override
- public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
- final YangInstanceIdentifier path) {
+ public FluentFuture<Boolean> exists(final LogicalDatastoreType store,
+ final YangInstanceIdentifier path) {
LOG.debug("ReadOnlyTransaction.exists() store={}, path={}", store, path);
- ListenableFuture<Boolean> listenableFuture = Futures.transform(read(store, path), IS_NODE_PRESENT);
- return Futures.makeChecked(listenableFuture, ANY_EX_TO_READ_FAILED_EXCEPTION_MAPPER);
+ ListenableFuture<Boolean> listenableFuture = Futures.transform(read(store, path), IS_NODE_PRESENT,
+ MoreExecutors.directExecutor());
+ return FluentFuture.from(listenableFuture);
}
@Nonnull
@@ -119,6 +119,4 @@ final class ReadOnlyTransaction implements DOMDataReadOnlyTransaction {
private static final Function<? super Optional<NormalizedNode<?, ?>>, ? extends Boolean> IS_NODE_PRESENT =
(Function<Optional<NormalizedNode<?, ?>>, Boolean>) input -> input == null ? Boolean.FALSE : input.isPresent();
- private static final Function<? super Exception, ReadFailedException> ANY_EX_TO_READ_FAILED_EXCEPTION_MAPPER =
- (Function<Exception, ReadFailedException>) e -> new ReadFailedException("Exists failed", e);
} \ No newline at end of file
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadWriteTransaction.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadWriteTransaction.java
index c7d54f0ec..b2e7d38e1 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadWriteTransaction.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadWriteTransaction.java
@@ -16,39 +16,28 @@
package io.fd.honeycomb.data.impl;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FluentFuture;
+import java.util.Optional;
import javax.annotation.Nonnull;
-import org.apache.commons.lang3.builder.RecursiveToStringStyle;
-import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
-import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
- * Composite DOM transaction that delegates reads to a {@link DOMDataReadTransaction} delegate and writes to a {@link
- * DOMDataWriteTransaction} delegate.
+ * Composite DOM transaction that delegates reads to a {@link DOMDataTreeReadTransaction} delegate and writes to a {@link
+ * DOMDataTreeWriteTransaction} delegate.
*/
-final class ReadWriteTransaction implements DOMDataReadWriteTransaction, ValidableTransaction {
+final class ReadWriteTransaction implements DOMDataTreeReadWriteTransaction, ValidableTransaction {
- private static final Logger LOG = LoggerFactory.getLogger(ReadWriteTransaction.class);
-
- private final DOMDataReadOnlyTransaction delegateReadTx;
+ private final DOMDataTreeReadTransaction delegateReadTx;
private final ValidableTransaction delegateWriteTx;
- ReadWriteTransaction(@Nonnull final DOMDataReadOnlyTransaction delegateReadTx,
+ ReadWriteTransaction(@Nonnull final DOMDataTreeReadTransaction delegateReadTx,
@Nonnull final ValidableTransaction delegateWriteTx) {
this.delegateReadTx = Preconditions.checkNotNull(delegateReadTx, "delegateReadTx should not be null");
this.delegateWriteTx = Preconditions.checkNotNull(delegateWriteTx, "delegateWriteTx should not be null");
@@ -78,33 +67,19 @@ final class ReadWriteTransaction implements DOMDataReadWriteTransaction, Validab
}
@Override
- public CheckedFuture<Void, TransactionCommitFailedException> submit() {
- //TODO - remove after https://bugs.opendaylight.org/show_bug.cgi?id=7791 resolved
- if (LOG.isDebugEnabled()) {
- LOG.debug("Submitting transaction {}", ReflectionToStringBuilder.toString(
- delegateWriteTx,
- RecursiveToStringStyle.MULTI_LINE_STYLE,
- false,
- false
- ));
- }
- return delegateWriteTx.submit();
- }
-
- @Override
public FluentFuture<? extends CommitInfo> commit() {
return delegateWriteTx.commit();
}
@Override
- public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
- final YangInstanceIdentifier path) {
+ public FluentFuture<Optional<NormalizedNode<?, ?>>> read(final LogicalDatastoreType store,
+ final YangInstanceIdentifier path) {
return delegateReadTx.read(store, path);
}
@Override
- public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
- final YangInstanceIdentifier path) {
+ public FluentFuture<Boolean> exists(final LogicalDatastoreType store,
+ final YangInstanceIdentifier path) {
return delegateReadTx.exists(store, path);
}
@@ -114,7 +89,7 @@ final class ReadWriteTransaction implements DOMDataReadWriteTransaction, Validab
}
@Override
- public CheckedFuture<Void, DOMDataTransactionValidator.ValidationFailedException> validate() {
+ public FluentFuture<Void> validate() {
return delegateWriteTx.validate();
}
}
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java
index de3cabde7..79188188e 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegator.java
@@ -21,12 +21,10 @@ import static com.google.common.collect.Iterables.getOnlyElement;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Function;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.Collections2;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.ReadableDataManager;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.ModificationCache;
@@ -36,9 +34,12 @@ import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
import io.fd.honeycomb.translate.util.TransactionMappingContext;
import java.util.Collection;
import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -67,7 +68,7 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager {
private final BindingNormalizedNodeSerializer serializer;
private final ReaderRegistry readerRegistry;
private final SchemaContext globalContext;
- private final org.opendaylight.controller.md.sal.binding.api.DataBroker contextBroker;
+ private final org.opendaylight.mdsal.binding.api.DataBroker contextBroker;
/**
* Creates operational data tree instance.
@@ -80,7 +81,7 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager {
public ReadableDataTreeDelegator(@Nonnull BindingNormalizedNodeSerializer serializer,
@Nonnull final SchemaContext globalContext,
@Nonnull final ReaderRegistry readerRegistry,
- @Nonnull final org.opendaylight.controller.md.sal.binding.api.DataBroker contextBroker) {
+ @Nonnull final org.opendaylight.mdsal.binding.api.DataBroker contextBroker) {
this.contextBroker = checkNotNull(contextBroker, "contextBroker should not be null");
this.globalContext = checkNotNull(globalContext, "globalContext should not be null");
this.serializer = checkNotNull(serializer, "serializer should not be null");
@@ -88,12 +89,12 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager {
}
@Override
- public CheckedFuture<Optional<NormalizedNode<?, ?>>,
- org.opendaylight.controller.md.sal.common.api.data.ReadFailedException> read(
+ public FluentFuture<Optional<NormalizedNode<?, ?>>> read(
@Nonnull final YangInstanceIdentifier yangInstanceIdentifier) {
- try (TransactionMappingContext mappingContext = new TransactionMappingContext(contextBroker.newReadWriteTransaction());
- ReadContext ctx = new ReadContextImpl(mappingContext)) {
+ try (TransactionMappingContext mappingContext = new TransactionMappingContext(
+ contextBroker.newReadWriteTransaction());
+ ReadContext ctx = new ReadContextImpl(mappingContext)) {
final Optional<NormalizedNode<?, ?>> value;
if (checkNotNull(yangInstanceIdentifier).equals(YangInstanceIdentifier.EMPTY)) {
@@ -103,24 +104,17 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager {
}
// Submit context mapping updates
- final CheckedFuture<Void, TransactionCommitFailedException> contextUpdateResult =
- ((TransactionMappingContext) ctx.getMappingContext()).submit();
+ final FluentFuture<? extends CommitInfo> contextUpdateResult =
+ ((TransactionMappingContext) ctx.getMappingContext()).commit();
// Blocking on context data update
- contextUpdateResult.checkedGet();
-
- return Futures.immediateCheckedFuture(value);
-
- } catch (ReadFailedException e) {
- return Futures.immediateFailedCheckedFuture(
- new org.opendaylight.controller.md.sal.common.api.data.ReadFailedException("Failed to read data", e));
- } catch (TransactionCommitFailedException e) {
- // Context write failed. This should not happen, but if it does, there's not much that can be done here
- // ... try to read again
- final String msg = "Error while updating mapping context data";
- LOG.error(msg, e);
- return Futures.immediateFailedCheckedFuture(
- new org.opendaylight.controller.md.sal.common.api.data.ReadFailedException(msg, e)
- );
+ contextUpdateResult.get();
+
+ return FluentFutures.immediateFluentFuture(value);
+
+ } catch (InterruptedException | ExecutionException | ReadFailedException ex) {
+ return FluentFutures.immediateFailedFluentFuture(
+ new org.opendaylight.controller.md.sal.common.api.data.ReadFailedException("Failed to read data",
+ ex));
}
}
@@ -138,9 +132,9 @@ public final class ReadableDataTreeDelegator implements ReadableDataManager {
if (dataObject.isPresent()) {
final NormalizedNode<?, ?> value = toNormalizedNodeFunction(path).apply(dataObject.get());
- return Optional.<NormalizedNode<?, ?>>fromNullable(value);
+ return Optional.ofNullable(value);
} else {
- return Optional.absent();
+ return Optional.empty();
}
}
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ValidableTransaction.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ValidableTransaction.java
index 0c67f863f..09dde4e70 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ValidableTransaction.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/ValidableTransaction.java
@@ -17,19 +17,18 @@
package io.fd.honeycomb.data.impl;
import com.google.common.annotations.Beta;
-import com.google.common.util.concurrent.CheckedFuture;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
+import com.google.common.util.concurrent.FluentFuture;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
-import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator.ValidationFailedException;
/**
- * An {@link DOMDataWriteTransaction} than can be validated.
+ * An {@link DOMDataTreeWriteTransaction} than can be validated.
* @see DOMDataTransactionValidator
*/
@Beta
-interface ValidableTransaction extends DOMDataWriteTransaction {
+interface ValidableTransaction extends DOMDataTreeWriteTransaction {
/**
- * Validates state of the data tree associated with the provided {@link DOMDataWriteTransaction}.
+ * Validates state of the data tree associated with the provided {@link DOMDataTreeWriteTransaction}.
*
* <p>The operation should not have any side-effects on the transaction state.
*
@@ -37,9 +36,8 @@ interface ValidableTransaction extends DOMDataWriteTransaction {
* if the state of the transaction has not been changed.
*
* @return
- * a CheckedFuture containing the result of the validate operation. The future blocks until the validation
- * operation is complete. A successful validate returns nothing. On failure, the Future will fail
- * with a {@link ValidationFailedException} or an exception derived from ValidationFailedException.
+ * a FluentFuture containing the result of the validate operation. The future blocks until the validation
+ * operation is complete. A successful validate returns nothing. On failure, the Future will fail.
*/
- CheckedFuture<Void, ValidationFailedException> validate();
+ FluentFuture<Void> validate();
}
diff --git a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
index 91b48cc10..1ce7db74f 100644
--- a/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
+++ b/infra/data-impl/src/main/java/io/fd/honeycomb/data/impl/WriteTransaction.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.data.DataModification;
@@ -30,10 +29,11 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.slf4j.Logger;
@@ -113,23 +113,6 @@ final class WriteTransaction implements ValidableTransaction {
handleOperation(store, (modification) -> modification.delete(path));
}
- @Deprecated
- @Override
- public CheckedFuture<Void, TransactionCommitFailedException> submit() {
- LOG.trace("WriteTransaction.submit()");
- checkIsNew();
-
- try {
- doCommit();
- } catch (Exception e) {
- status = TransactionStatus.FAILED;
- LOG.error("Submit failed", e);
- return Futures.immediateFailedCheckedFuture(
- new TransactionCommitFailedException("Failed to validate DataTreeModification", e));
- }
- return Futures.immediateCheckedFuture(null);
- }
-
private void doCommit() throws TranslationException {
status = TransactionStatus.SUBMITED;
if (configModification != null) {
@@ -164,7 +147,7 @@ final class WriteTransaction implements ValidableTransaction {
}
@Override
- public CheckedFuture<Void, DOMDataTransactionValidator.ValidationFailedException> validate() {
+ public FluentFuture<Void> validate() {
try {
if (configModification != null) {
configModification.validate();
@@ -173,9 +156,10 @@ final class WriteTransaction implements ValidableTransaction {
operationalModification.validate();
}
} catch (Exception e) {
- return Futures.immediateFailedCheckedFuture(new DOMDataTransactionValidator.ValidationFailedException(e.getMessage(), e.getCause()));
+ return FluentFutures.immediateFailedFluentFuture(
+ new DOMDataTransactionValidator.ValidationFailedException(e.getMessage(), e.getCause()));
}
- return Futures.immediateCheckedFuture(null);
+ return FluentFutures.immediateNullFluentFuture();
}
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java
index 124179c79..56d333436 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/DataBrokerTest.java
@@ -24,18 +24,19 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
+import com.google.common.collect.ClassToInstanceMap;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.ReadableDataManager;
-import java.util.Map;
+import org.eclipse.jdt.annotation.NonNull;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBrokerExtension;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBrokerExtension;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChainListener;
import org.opendaylight.netconf.mdsal.connector.DOMDataTransactionValidator;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -58,7 +59,7 @@ public class DataBrokerTest {
@Test
public void testNewReadWriteTransaction() {
- final DOMDataReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
+ final DOMDataTreeReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readWriteTx.read(LogicalDatastoreType.CONFIGURATION, path);
@@ -77,7 +78,7 @@ public class DataBrokerTest {
@Test
public void testNewReadOnlyTransaction() {
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
+ final DOMDataTreeReadTransaction readTx = broker.newReadOnlyTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readTx.read(LogicalDatastoreType.CONFIGURATION, path);
@@ -88,14 +89,14 @@ public class DataBrokerTest {
@Test(expected = UnsupportedOperationException.class)
public void testCreateTransactionChain() {
- final TransactionChainListener listener = mock(TransactionChainListener.class);
+ final DOMTransactionChainListener listener = mock(DOMTransactionChainListener.class);
broker.createTransactionChain(listener);
}
@Test
public void testGetSupportedExtensions() {
- final Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> supportedExtensions =
- broker.getSupportedExtensions();
+ final @NonNull ClassToInstanceMap<DOMDataBrokerExtension> supportedExtensions =
+ broker.getExtensions();
assertEquals(1, supportedExtensions.size());
assertNotNull(supportedExtensions.get(DOMDataTransactionValidator.class));
}
@@ -117,7 +118,7 @@ public class DataBrokerTest {
@Test
public void testNewReadWriteTransaction() {
- final DOMDataReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
+ final DOMDataTreeReadWriteTransaction readWriteTx = broker.newReadWriteTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readWriteTx.read(LogicalDatastoreType.OPERATIONAL, path);
@@ -133,7 +134,7 @@ public class DataBrokerTest {
@Test
public void testNewReadOnlyTransaction() {
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
+ final DOMDataTreeReadTransaction readTx = broker.newReadOnlyTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readTx.read(LogicalDatastoreType.OPERATIONAL, path);
@@ -143,7 +144,7 @@ public class DataBrokerTest {
@Test(expected = IllegalArgumentException.class)
public void testReadConfig() {
- final DOMDataReadOnlyTransaction readTx = broker.newReadOnlyTransaction();
+ final DOMDataTreeReadTransaction readTx = broker.newReadOnlyTransaction();
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
readTx.read(LogicalDatastoreType.CONFIGURATION, path);
@@ -151,14 +152,13 @@ public class DataBrokerTest {
@Test(expected = UnsupportedOperationException.class)
public void testCreateTransactionChain() {
- final TransactionChainListener listener = mock(TransactionChainListener.class);
+ final DOMTransactionChainListener listener = mock(DOMTransactionChainListener.class);
broker.createTransactionChain(listener);
}
@Test
public void testGetSupportedExtensions() {
- final Map<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension> supportedExtensions =
- broker.getSupportedExtensions();
+ final @NonNull ClassToInstanceMap<DOMDataBrokerExtension> supportedExtensions = broker.getExtensions();
assertTrue(supportedExtensions.isEmpty());
}
}
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java
index 5690e78c3..8f686333e 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorBaseTest.java
@@ -21,7 +21,6 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.translate.write.DataObjectUpdate;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
@@ -32,8 +31,9 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
@@ -52,7 +52,7 @@ abstract class ModifiableDataTreeDelegatorBaseTest extends ModificationBaseTest
@Mock
DataBroker contextBroker;
@Mock
- org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction tx;
+ org.opendaylight.mdsal.binding.api.ReadWriteTransaction tx;
@Captor
ArgumentCaptor<WriteContext> writeContextCaptor;
@@ -72,7 +72,7 @@ abstract class ModifiableDataTreeDelegatorBaseTest extends ModificationBaseTest
MockitoAnnotations.initMocks(this);
dataTree = getDataTree();
when(contextBroker.newReadWriteTransaction()).thenReturn(tx);
- when(tx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(tx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
when(serializer.fromYangInstanceIdentifier(any(YangInstanceIdentifier.class)))
.thenReturn(((InstanceIdentifier) DEFAULT_ID));
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java
index b1e60c440..8ec18e4da 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ModifiableDataTreeDelegatorTest.java
@@ -28,19 +28,18 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.translate.write.DataObjectUpdate;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
import java.util.HashMap;
import java.util.Map;
+import java.util.Optional;
import org.junit.Test;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -54,9 +53,9 @@ public class ModifiableDataTreeDelegatorTest extends ModifiableDataTreeDelegator
public void testRead() throws Exception {
final ContainerNode topContainer = getTopContainer("topContainer");
addNodeToTree(dataTree, topContainer, TOP_CONTAINER_ID);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read =
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> read =
configDataTree.read(TOP_CONTAINER_ID);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read2 =
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> read2 =
configDataTree.newModification().read(TOP_CONTAINER_ID);
final Optional<NormalizedNode<?, ?>> normalizedNodeOptional = read.get();
final Optional<NormalizedNode<?, ?>> normalizedNodeOptional2 = read2.get();
@@ -64,7 +63,7 @@ public class ModifiableDataTreeDelegatorTest extends ModifiableDataTreeDelegator
assertEquals(normalizedNodeOptional, normalizedNodeOptional2);
assertTrue(normalizedNodeOptional.isPresent());
assertEquals(topContainer, normalizedNodeOptional.get());
- assertEquals(dataTree.takeSnapshot().readNode(TOP_CONTAINER_ID), Optional.toJavaUtil(normalizedNodeOptional));
+ assertEquals(dataTree.takeSnapshot().readNode(TOP_CONTAINER_ID), normalizedNodeOptional);
}
@Test
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java
index 77470d17c..690a0deee 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadOnlyTransactionTest.java
@@ -22,15 +22,14 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import io.fd.honeycomb.data.ReadableDataManager;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
+import io.fd.honeycomb.data.ReadableDataManager;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -52,8 +51,7 @@ public class ReadOnlyTransactionTest {
@Test
public void testExists() {
final YangInstanceIdentifier path = mock(YangInstanceIdentifier.class);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException>
- future = mock(CheckedFuture.class);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = mock(FluentFuture.class);
when(operationalData.read(path)).thenReturn(future);
readOnlyTx.exists(LogicalDatastoreType.OPERATIONAL, path);
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java
index bbe384289..cc744530f 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadWriteTransactionTest.java
@@ -23,15 +23,15 @@ import static org.mockito.MockitoAnnotations.initMocks;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
public class ReadWriteTransactionTest {
@Mock
- private DOMDataReadOnlyTransaction readTx;
+ private DOMDataTreeReadTransaction readTx;
@Mock
private ValidableTransaction writeTx;
@@ -78,15 +78,7 @@ public class ReadWriteTransactionTest {
}
@Test
- public void testSubmit() throws Exception {
- readWriteTx.submit();
- verify(writeTx).submit();
- }
-
-
- @SuppressWarnings("deprecation")
- @Test
- public void testCommit() throws Exception {
+ public void testCommit() {
readWriteTx.commit();
verify(writeTx).commit();
}
@@ -104,7 +96,7 @@ public class ReadWriteTransactionTest {
}
@Test
- public void testGetIdentifier() throws Exception {
+ public void testGetIdentifier() {
assertNotNull(readWriteTx.getIdentifier());
}
} \ No newline at end of file
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java
index 76b46dad6..6ff625d8e 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/ReadableDataTreeDelegatorTest.java
@@ -30,29 +30,30 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.yangtools.util.UnmodifiableCollection;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
@@ -87,7 +88,7 @@ public class ReadableDataTreeDelegatorTest {
@Mock
private DOMDataBroker netconfMonitoringBroker;
@Mock
- private DOMDataReadOnlyTransaction domDataReadOnlyTransaction;
+ private DOMDataTreeReadTransaction domDataReadOnlyTransaction;
@Mock
private DataBroker contextBroker;
@@ -95,16 +96,16 @@ public class ReadableDataTreeDelegatorTest {
public void setUp() {
initMocks(this);
operationalData = new ReadableDataTreeDelegator(serializer, globalContext, reader, contextBroker);
- doReturn(schemaNode).when(globalContext).getDataChildByName(any(QName.class));
+ doReturn(Optional.of(schemaNode)).when(globalContext).findDataChildByName(any(QName.class));
doReturn(domDataReadOnlyTransaction).when(netconfMonitoringBroker).newReadOnlyTransaction();
- doReturn(Futures.immediateCheckedFuture(Optional.absent())).when(domDataReadOnlyTransaction)
+ doReturn(FluentFutures.immediateFluentFuture(Optional.empty())).when(domDataReadOnlyTransaction)
.read(any(LogicalDatastoreType.class), any(YangInstanceIdentifier.class));
- final org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction ctxTransaction = mock(
- org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction.class);
+ final org.opendaylight.mdsal.binding.api.ReadWriteTransaction ctxTransaction = mock(
+ org.opendaylight.mdsal.binding.api.ReadWriteTransaction.class);
doReturn(ctxTransaction).when(contextBroker).newReadWriteTransaction();
- doReturn(Futures.immediateCheckedFuture(null)).when(ctxTransaction).submit();
+ doReturn(FluentFutures.immediateNullFluentFuture()).when(ctxTransaction).commit();
}
@Test
@@ -124,7 +125,7 @@ public class ReadableDataTreeDelegatorTest {
final DataContainerChild<?, ?> expectedValue = mock(DataContainerChild.class);
doReturn(expectedValue).when(entry).getValue();
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future = operationalData.read(yangId);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = operationalData.read(yangId);
verify(serializer).fromYangInstanceIdentifier(yangId);
verify(reader).read(same(id), any(ReadContext.class));
@@ -137,9 +138,9 @@ public class ReadableDataTreeDelegatorTest {
public void testReadNonExistingNode() throws Exception {
final YangInstanceIdentifier yangId = mock(YangInstanceIdentifier.class);
doReturn(id).when(serializer).fromYangInstanceIdentifier(yangId);
- doReturn(Optional.absent()).when(reader).read(same(id), any(ReadContext.class));
+ doReturn(Optional.empty()).when(reader).read(same(id), any(ReadContext.class));
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future = operationalData.read(yangId);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = operationalData.read(yangId);
verify(serializer).fromYangInstanceIdentifier(yangId);
verify(reader).read(same(id), any(ReadContext.class));
@@ -151,13 +152,12 @@ public class ReadableDataTreeDelegatorTest {
public void testReadFailed() throws Exception {
doThrow(io.fd.honeycomb.translate.read.ReadFailedException.class).when(reader).readAll(any(ReadContext.class));
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future =
- operationalData.read( YangInstanceIdentifier.EMPTY);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future = operationalData.read(YangInstanceIdentifier.EMPTY);
try {
- future.checkedGet();
- } catch (ReadFailedException e) {
- assertTrue(e.getCause() instanceof io.fd.honeycomb.translate.read.ReadFailedException);
+ future.get();
+ } catch (ExecutionException e) {
+ assertTrue(e.getCause() instanceof ReadFailedException);
return;
}
fail("ReadFailedException was expected");
@@ -181,7 +181,7 @@ public class ReadableDataTreeDelegatorTest {
doReturn(vppYangId.getLastPathArgument()).when(vppStateContainer).getIdentifier();
// Read root
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> future =
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> future =
operationalData.read(YangInstanceIdentifier.EMPTY);
verify(reader).readAll(any(ReadContext.class));
diff --git a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java
index 74313a1ba..8bda219cb 100644
--- a/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java
+++ b/infra/data-impl/src/test/java/io/fd/honeycomb/data/impl/WriteTransactionTest.java
@@ -25,15 +25,16 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.data.DataModification;
import io.fd.honeycomb.translate.TranslationException;
import io.fd.honeycomb.translate.ValidationFailedException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -68,7 +69,7 @@ public class WriteTransactionTest {
@Test(expected = IllegalStateException.class)
public void testOnFinishedTx() {
- writeTx.submit();
+ writeTx.commit();
writeTx.put(LogicalDatastoreType.CONFIGURATION, path, data);
verify(configSnapshot).write(path, data);
}
@@ -86,7 +87,7 @@ public class WriteTransactionTest {
@Test
public void testCancelFinished() {
- writeTx.submit();
+ writeTx.commit();
assertFalse(writeTx.cancel());
}
@@ -98,14 +99,14 @@ public class WriteTransactionTest {
@Test
public void testSubmit() throws Exception {
- writeTx.submit();
+ writeTx.commit();
verify(configSnapshot).commit();
}
@Test
public void testSubmitFailed() throws Exception {
doThrow(mock(ValidationFailedException.class)).when(configSnapshot).commit();
- final CheckedFuture<Void, TransactionCommitFailedException> future = writeTx.submit();
+ final FluentFuture<? extends CommitInfo> future = writeTx.commit();
try {
future.get();
} catch (Exception e) {
diff --git a/infra/impl/src/main/java/io/fd/honeycomb/impl/EmptyDomMountService.java b/infra/impl/src/main/java/io/fd/honeycomb/impl/EmptyDomMountService.java
index 74001dce3..bb2653b66 100644
--- a/infra/impl/src/main/java/io/fd/honeycomb/impl/EmptyDomMountService.java
+++ b/infra/impl/src/main/java/io/fd/honeycomb/impl/EmptyDomMountService.java
@@ -16,11 +16,11 @@
package io.fd.honeycomb.impl;
-import com.google.common.base.Optional;
+import java.util.Optional;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMMountPoint;
import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -31,7 +31,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
public class EmptyDomMountService implements DOMMountPointService {
@Override
public Optional<DOMMountPoint> getMountPoint(final YangInstanceIdentifier yangInstanceIdentifier) {
- return Optional.absent();
+ return Optional.empty();
}
@Override
diff --git a/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java b/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java
index c978135cb..4b5cd2584 100644
--- a/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java
+++ b/infra/impl/src/main/java/io/fd/honeycomb/impl/FakeBindingAwareBroker.java
@@ -16,13 +16,13 @@
package io.fd.honeycomb.impl;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer;
import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
import org.opendaylight.controller.sal.binding.api.BindingAwareService;
import org.opendaylight.controller.sal.binding.api.rpc.RpcContextIdentifier;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.binding.RpcService;
diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java
index 18691c295..245b8654c 100644
--- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java
+++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java
@@ -41,9 +41,9 @@ import java.util.List;
import java.util.Optional;
import java.util.concurrent.ExecutionException;
import java.util.stream.Collectors;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleContainer;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.ListInContainer;
diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java
index 703438d83..941978103 100644
--- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java
+++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java
@@ -16,7 +16,6 @@
package io.fd.honeycomb.benchmark.data;
-import com.google.inject.*;
import com.google.inject.multibindings.Multibinder;
import com.google.inject.name.Names;
import io.fd.honeycomb.benchmark.util.DataProvider;
@@ -29,9 +28,17 @@ import io.fd.honeycomb.infra.distro.data.ConfigAndOperationalPipelineModule;
import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import java.io.IOException;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
+import java.util.stream.Collectors;
import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithListBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleContainer;
@@ -42,15 +49,6 @@ import org.openjdk.jmh.annotations.Scope;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.io.IOException;
-import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Optional;
-import java.util.concurrent.ExecutionException;
-import java.util.stream.Collectors;
-
/**
* Measures the performance of CONFIG writes into BA DataBroker, backed by HC infrastructure and then NOOP writers.
*/
diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java
index ebad65335..8f5413502 100644
--- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java
+++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java
@@ -16,8 +16,8 @@
package io.fd.honeycomb.benchmark.util;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java
index 76ad0e3d4..8e776e1c0 100644
--- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java
+++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java
@@ -16,10 +16,10 @@
package io.fd.honeycomb.benchmark.util;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.read.Reader;
+import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.NotThreadSafe;
import org.opendaylight.yangtools.concepts.Builder;
diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/AbstractInfraTest.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/AbstractInfraTest.java
index b9ef78d77..392f6e768 100644
--- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/AbstractInfraTest.java
+++ b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/AbstractInfraTest.java
@@ -20,14 +20,13 @@ import static org.mockito.Mockito.when;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.Futures;
import java.util.Arrays;
import java.util.Map;
import javassist.ClassPool;
import org.junit.Before;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
@@ -35,6 +34,7 @@ import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecR
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -52,9 +52,9 @@ abstract class AbstractInfraTest {
protected SchemaContext schemaContext;
@Mock
- protected org.opendaylight.controller.md.sal.binding.api.DataBroker contextBroker;
+ protected org.opendaylight.mdsal.binding.api.DataBroker contextBroker;
@Mock
- private org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction ctxTx;
+ private org.opendaylight.mdsal.binding.api.ReadWriteTransaction ctxTx;
static BindingToNormalizedNodeCodec getSerializer(final ModuleInfoBackedContext moduleInfoBackedContext,
final SchemaContext schemaContext) {
@@ -82,7 +82,7 @@ abstract class AbstractInfraTest {
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(contextBroker.newReadWriteTransaction()).thenReturn(ctxTx);
- when(ctxTx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(ctxTx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
initSerializer();
postSetup();
diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java
index 2c50a5381..e39b7bf72 100644
--- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java
+++ b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombReadInfraTest.java
@@ -32,10 +32,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.test.model.Ids;
import io.fd.honeycomb.translate.impl.read.GenericListReader;
import io.fd.honeycomb.translate.impl.read.GenericReader;
@@ -51,6 +50,7 @@ import io.fd.honeycomb.translate.util.read.ReflexiveListReaderCustomizer;
import io.fd.honeycomb.translate.util.read.ReflexiveReaderCustomizer;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
+import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import org.junit.Test;
@@ -151,11 +151,11 @@ public class HoneycombReadInfraTest extends AbstractInfraTest {
public void testReadAll() throws Exception {
final ReadableDataTreeDelegator readableDataTreeDelegator =
new ReadableDataTreeDelegator(serializer, schemaContext, registry, contextBroker);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, org.opendaylight.controller.md.sal.common.api.data.ReadFailedException>
+ final FluentFuture<Optional<NormalizedNode<?, ?>>>
read = readableDataTreeDelegator.read(YangInstanceIdentifier.EMPTY);
final Multimap<InstanceIdentifier<? extends DataObject>, ? extends DataObject> readAll =
- toBinding(read.checkedGet().get());
+ toBinding(read.get().get());
assertThat(readAll.size(), is(2));
assertTrue(readAll.containsKey(Ids.CONTAINER_WITH_LIST_ID));
assertEquals(readContainerWithList(), readAll.get(Ids.CONTAINER_WITH_LIST_ID).stream().findFirst().get());
diff --git a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java
index b3d24e5b5..ff288afbb 100644
--- a/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java
+++ b/infra/it/it-test/src/test/java/io/fd/honeycomb/data/impl/HoneycombSubtreeReadInfraTest.java
@@ -20,11 +20,10 @@ import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
-import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.Sets;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.test.model.Ids;
import io.fd.honeycomb.translate.impl.read.GenericListReader;
import io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryBuilder;
@@ -35,6 +34,7 @@ import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
import io.fd.honeycomb.translate.util.YangDAG;
import io.fd.honeycomb.translate.util.read.ReflexiveListReaderCustomizer;
+import java.util.Optional;
import java.util.stream.Collectors;
import org.junit.Test;
import org.mockito.Mock;
@@ -96,11 +96,11 @@ public class HoneycombSubtreeReadInfraTest extends AbstractInfraTest {
public void testReadAll() throws Exception {
final ReadableDataTreeDelegator readableDataTreeDelegator =
new ReadableDataTreeDelegator(serializer, schemaContext, registry, contextBroker);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, org.opendaylight.controller.md.sal.common.api.data.ReadFailedException>
+ final FluentFuture<Optional<NormalizedNode<?, ?>>>
read = readableDataTreeDelegator.read(YangInstanceIdentifier.EMPTY);
final Multimap<InstanceIdentifier<? extends DataObject>, ? extends DataObject> readAll =
- toBinding(read.checkedGet().get());
+ toBinding(read.get().get());
assertThat(readAll.size(), is(1));
assertEquals(readEntireSubtree(), readAll.get(Ids.CONTAINER_WITH_LIST_ID).stream().findFirst().get());
}
diff --git a/infra/minimal-distribution-core/pom.xml b/infra/minimal-distribution-core/pom.xml
index 698197ea3..ce41ada16 100644
--- a/infra/minimal-distribution-core/pom.xml
+++ b/infra/minimal-distribution-core/pom.xml
@@ -131,5 +131,10 @@
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/BindingDataBrokerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/BindingDataBrokerProvider.java
index 2f71a3027..1a95ee11a 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/BindingDataBrokerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/BindingDataBrokerProvider.java
@@ -18,10 +18,10 @@ package io.fd.honeycomb.infra.distro.data;
import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
public final class BindingDataBrokerProvider extends ProviderTrait<DataBroker> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.java
index 3255cada6..a98b22013 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ConfigAndOperationalPipelineModule.java
@@ -31,11 +31,11 @@ import io.fd.honeycomb.rpc.RpcRegistry;
import io.fd.honeycomb.rpc.RpcRegistryBuilder;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
public class ConfigAndOperationalPipelineModule extends PrivateModule {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DOMNotificationServiceProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DOMNotificationServiceProvider.java
index 4c419a8ab..4c87cce31 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DOMNotificationServiceProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DOMNotificationServiceProvider.java
@@ -19,7 +19,7 @@ package io.fd.honeycomb.infra.distro.data;
import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
public final class DOMNotificationServiceProvider extends ProviderTrait<DOMNotificationRouter> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DataStoreProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DataStoreProvider.java
index 1dd554fc9..a8c93d3a2 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DataStoreProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/DataStoreProvider.java
@@ -18,26 +18,24 @@ package io.fd.honeycomb.infra.distro.data;
import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreFactory;
public final class DataStoreProvider extends ProviderTrait<InMemoryDOMDataStore> {
@Inject
private DOMSchemaService schemaService;
private String name;
- private LogicalDatastoreType type;
- public DataStoreProvider(final String name,
- final LogicalDatastoreType type) {
+ public DataStoreProvider(final String name) {
this.name = name;
- this.type = type;
}
@Override
protected InMemoryDOMDataStore create() {
- return InMemoryDOMDataStoreFactory.create(name, type, schemaService, false, null);
+ return InMemoryDOMDataStoreFactory
+ .create(name, InMemoryDOMDataStoreConfigProperties.getDefault(), schemaService);
}
}
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombBindingDataBrokerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombBindingDataBrokerProvider.java
index bbcd40943..0315978f3 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombBindingDataBrokerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombBindingDataBrokerProvider.java
@@ -21,10 +21,10 @@ import static io.fd.honeycomb.infra.distro.data.ConfigAndOperationalPipelineModu
import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMDataBrokerAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
/**
* Provides binding adapter for {@link io.fd.honeycomb.data.impl.DataBroker}.
@@ -39,7 +39,6 @@ final class HoneycombBindingDataBrokerProvider extends ProviderTrait<DataBroker>
@Override
protected BindingDOMDataBrokerAdapter create() {
-
return new BindingDOMDataBrokerAdapter(domDataBroker, mappingService);
}
}
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.java
index ca9435081..ab29d4df2 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMDataBrokerProvider.java
@@ -21,7 +21,7 @@ import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.ReadableDataManager;
import io.fd.honeycomb.data.impl.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
public final class HoneycombDOMDataBrokerProvider extends ProviderTrait<DOMDataBroker> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMRpcServiceProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMRpcServiceProvider.java
index 324d636a6..ee750b209 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMRpcServiceProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombDOMRpcServiceProvider.java
@@ -20,8 +20,8 @@ import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.rpc.HoneycombDOMRpcService;
import io.fd.honeycomb.rpc.RpcRegistry;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
public final class HoneycombDOMRpcServiceProvider extends ProviderTrait<DOMRpcService> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
index b31803877..7acfae6c8 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/HoneycombNotificationManagerProvider.java
@@ -26,9 +26,9 @@ import io.fd.honeycomb.notification.impl.NotificationProducerRegistry;
import io.fd.honeycomb.notification.impl.NotificationProducerTracker;
import java.util.HashSet;
import java.util.Set;
-import org.opendaylight.controller.md.sal.binding.impl.BindingDOMNotificationPublishServiceAdapter;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingDOMNotificationPublishServiceAdapter;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
public final class HoneycombNotificationManagerProvider extends ProviderTrait<NotificationCollector> {
@@ -47,7 +47,7 @@ public final class HoneycombNotificationManagerProvider extends ProviderTrait<No
// Create BA version of notification service (implementation is free from ODL)
BindingDOMNotificationPublishServiceAdapter bindingDOMNotificationPublishServiceAdapter =
- new BindingDOMNotificationPublishServiceAdapter(codec, notificationRouter);
+ new BindingDOMNotificationPublishServiceAdapter(notificationRouter, codec);
// Create Collector on top of BA notification service and registry
HoneycombNotificationCollector honeycombNotificationCollector =
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java
index 5f12358a6..52d4ca510 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/InmemoryDOMDataBrokerProvider.java
@@ -22,12 +22,12 @@ import io.fd.honeycomb.binding.init.ProviderTrait;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitDeadlockException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
-import org.opendaylight.controller.sal.core.spi.data.DOMStore;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitDeadlockException;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.broker.SerializedDOMDataBroker;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService;
import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/LegacyBindingDataBrokerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/LegacyBindingDataBrokerProvider.java
new file mode 100644
index 000000000..af83bb761
--- /dev/null
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/LegacyBindingDataBrokerProvider.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2019 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.infra.distro.data;
+
+import com.google.inject.Inject;
+import io.fd.honeycomb.binding.init.ProviderTrait;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataBrokerAdapter;
+import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.controller.sal.core.compat.LegacyDOMDataBrokerAdapter;
+import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+
+/**
+ * Provider for legacy {@linkDataBroker} used in BGP Module.
+ */
+public class LegacyBindingDataBrokerProvider extends ProviderTrait<DataBroker> {
+ @Inject
+ private DOMDataBroker domDataBroker;
+ @Inject
+ private BindingToNormalizedNodeCodec mappingService;
+ @Inject
+ private ModuleInfoBackedContext mibCtx;
+
+ @Override
+ protected BindingDOMDataBrokerAdapter create() {
+ return new BindingDOMDataBrokerAdapter(new LegacyDOMDataBrokerAdapter(domDataBroker), mappingService);
+ }
+
+}
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ModifiableDTDelegProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ModifiableDTDelegProvider.java
index 6e3874788..4a0daf04a 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ModifiableDTDelegProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/ModifiableDTDelegProvider.java
@@ -23,8 +23,8 @@ import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.impl.ModifiableDataTreeDelegator;
import io.fd.honeycomb.infra.distro.data.context.ContextPipelineModule;
import io.fd.honeycomb.translate.write.registry.WriterRegistry;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/PersistedConfigInitializerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/PersistedConfigInitializerProvider.java
index bb2eb3f2a..6cdfe8273 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/PersistedConfigInitializerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/PersistedConfigInitializerProvider.java
@@ -24,8 +24,8 @@ import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.data.init.RestoringInitializer;
import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration;
import java.nio.file.Paths;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
final class PersistedConfigInitializerProvider extends ProviderTrait<RestoringInitializer> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.java
index b004efdaa..e3b3b5339 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/ContextPipelineModule.java
@@ -25,8 +25,8 @@ import io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider;
import io.fd.honeycomb.infra.distro.data.DataTreeProvider;
import io.fd.honeycomb.infra.distro.data.PersistingDataTreeProvider;
import io.fd.honeycomb.translate.MappingContext;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
public class ContextPipelineModule extends PrivateModule {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/HoneycombContextDOMDataBrokerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/HoneycombContextDOMDataBrokerProvider.java
index 4c3965f35..d3663df5f 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/HoneycombContextDOMDataBrokerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/HoneycombContextDOMDataBrokerProvider.java
@@ -20,7 +20,7 @@ import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.impl.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
public final class HoneycombContextDOMDataBrokerProvider extends ProviderTrait<DOMDataBroker> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/PersistedContextInitializerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/PersistedContextInitializerProvider.java
index d4a795b8c..45948eca2 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/PersistedContextInitializerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/PersistedContextInitializerProvider.java
@@ -21,8 +21,8 @@ import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.data.init.RestoringInitializer;
import io.fd.honeycomb.infra.distro.cfgattrs.HoneycombConfiguration;
import java.nio.file.Paths;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
final class PersistedContextInitializerProvider extends ProviderTrait<RestoringInitializer> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.java
index 3f39ce180..e2ed58023 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/context/RealtimeMappingContextProvider.java
@@ -21,7 +21,7 @@ import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.util.RealtimeMappingContext;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
public final class RealtimeMappingContextProvider extends ProviderTrait<MappingContext> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/oper/ReadableDTDelegProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/oper/ReadableDTDelegProvider.java
index ddad2e3cd..71ec18ab9 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/oper/ReadableDTDelegProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/data/oper/ReadableDTDelegProvider.java
@@ -23,8 +23,8 @@ import io.fd.honeycomb.data.ReadableDataManager;
import io.fd.honeycomb.data.impl.ReadableDataTreeDelegator;
import io.fd.honeycomb.infra.distro.data.context.ContextPipelineModule;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
public final class ReadableDTDelegProvider extends ProviderTrait<ReadableDataManager> {
@@ -41,7 +41,6 @@ public final class ReadableDTDelegProvider extends ProviderTrait<ReadableDataMan
@Override
protected ReadableDataTreeDelegator create() {
- return new ReadableDataTreeDelegator(serializer, schemaService.getGlobalContext(),
- registry, contextBroker);
+ return new ReadableDataTreeDelegator(serializer, schemaService.getGlobalContext(), registry, contextBroker);
}
}
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.java
index 0ddcf2e76..7f155271a 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerPipelineModule.java
@@ -23,8 +23,8 @@ import io.fd.honeycomb.data.ModifiableDataManager;
import io.fd.honeycomb.data.init.InitializerRegistry;
import io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider;
import io.fd.honeycomb.infra.distro.data.HoneycombDOMDataBrokerProvider;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
public final class InitializerPipelineModule extends PrivateModule {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapter.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapter.java
index 85fb7772c..08f9bad20 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapter.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapter.java
@@ -23,7 +23,7 @@ import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.registry.InitRegistry;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapterProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapterProvider.java
index 5bf5991bc..dbf180bb0 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapterProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/InitializerRegistryAdapterProvider.java
@@ -27,7 +27,7 @@ import io.fd.honeycomb.data.init.DataTreeInitializer;
import io.fd.honeycomb.data.init.InitializerRegistry;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.read.registry.ReaderRegistry;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
public final class InitializerRegistryAdapterProvider extends ProviderTrait<InitializerRegistry> {
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.java
index 34ac0671e..d009241a4 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/initializer/ModifiableDTDelegInitProvider.java
@@ -24,8 +24,8 @@ import io.fd.honeycomb.data.impl.ModifiableDataTreeDelegator;
import io.fd.honeycomb.infra.distro.data.ConfigAndOperationalPipelineModule;
import io.fd.honeycomb.infra.distro.data.context.ContextPipelineModule;
import io.fd.honeycomb.translate.util.write.NoopWriterRegistry;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/LegacySerializerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/LegacySerializerProvider.java
new file mode 100644
index 000000000..cc6c376c6
--- /dev/null
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/LegacySerializerProvider.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2019 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.infra.distro.schema;
+
+import com.google.inject.Inject;
+import io.fd.honeycomb.binding.init.ProviderTrait;
+import javassist.ClassPool;
+import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
+import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
+import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
+import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
+import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
+import org.opendaylight.mdsal.binding.generator.util.JavassistUtils;
+
+public class LegacySerializerProvider extends ProviderTrait<BindingToNormalizedNodeCodec> {
+
+ @Inject
+ private ModuleInfoBackedContext mibCtx;
+
+ @Override
+ protected BindingToNormalizedNodeCodec create() {
+ final DataObjectSerializerGenerator serializerGenerator =
+ StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()));
+
+ BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(serializerGenerator);
+ BindingRuntimeContext ctx = BindingRuntimeContext.create(mibCtx, mibCtx.getSchemaContext());
+ codecRegistry.onBindingRuntimeContextUpdated(ctx);
+ BindingToNormalizedNodeCodec codec = new BindingToNormalizedNodeCodec(mibCtx, codecRegistry);
+ codec.onGlobalContextUpdated(mibCtx.getSchemaContext());
+ return codec;
+ }
+}
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SchemaModule.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SchemaModule.java
index f15997f74..c824a0d90 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SchemaModule.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SchemaModule.java
@@ -18,7 +18,7 @@ package io.fd.honeycomb.infra.distro.schema;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
@@ -29,6 +29,8 @@ public class SchemaModule extends AbstractModule {
bind(ModuleInfoBackedContext.class).toProvider(ModuleInfoBackedCtxProvider.class).in(Singleton.class);
bind(DOMSchemaService.class).toProvider(SchemaServiceProvider.class).in(Singleton.class);
bind(BindingToNormalizedNodeCodec.class).toProvider(SerializerProvider.class).in(Singleton.class);
+ bind(org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec.class)
+ .toProvider(LegacySerializerProvider.class).in(Singleton.class);
}
}
diff --git a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SerializerProvider.java b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SerializerProvider.java
index f38e2446d..af7aa9ea0 100644
--- a/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SerializerProvider.java
+++ b/infra/minimal-distribution-core/src/main/java/io/fd/honeycomb/infra/distro/schema/SerializerProvider.java
@@ -19,7 +19,7 @@ package io.fd.honeycomb.infra.distro.schema;
import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
import javassist.ClassPool;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerGenerator;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
diff --git a/infra/northbound/bgp-extensions/evpn/src/main/java/io/fd/honeycomb/northbound/bgp/extension/EvpnWriterFactory.java b/infra/northbound/bgp-extensions/evpn/src/main/java/io/fd/honeycomb/northbound/bgp/extension/EvpnWriterFactory.java
index d6c591603..1fcafbc58 100644
--- a/infra/northbound/bgp-extensions/evpn/src/main/java/io/fd/honeycomb/northbound/bgp/extension/EvpnWriterFactory.java
+++ b/infra/northbound/bgp-extensions/evpn/src/main/java/io/fd/honeycomb/northbound/bgp/extension/EvpnWriterFactory.java
@@ -20,7 +20,7 @@ import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModul
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
+import io.fd.honeycomb.translate.util.write.LegacyBindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
@@ -38,6 +38,6 @@ public class EvpnWriterFactory implements WriterFactory {
@Override
public void init(@Nonnull ModifiableWriterRegistryBuilder registry) {
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(EVPN_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(EVPN_ROUTES_IID, dataBroker));
}
}
diff --git a/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/BGPTableTypeRegistryConsumerProvider.java b/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/BGPTableTypeRegistryConsumerProvider.java
index 24e592a27..e6abf0957 100644
--- a/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/BGPTableTypeRegistryConsumerProvider.java
+++ b/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/BGPTableTypeRegistryConsumerProvider.java
@@ -30,7 +30,7 @@ final class BGPTableTypeRegistryConsumerProvider extends ProviderTrait<BGPTableT
@Override
protected BGPTableTypeRegistryConsumer create() {
final SimpleBGPTableTypeRegistryProvider registry = new SimpleBGPTableTypeRegistryProvider();
- tableTypes.stream().forEach(tableType -> tableType.register(registry));
+ tableTypes.forEach(tableType -> tableType.register(registry));
return registry;
}
diff --git a/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/RIBExtensionConsumerContextProvider.java b/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/RIBExtensionConsumerContextProvider.java
index 8c4144d45..8236537a2 100644
--- a/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/RIBExtensionConsumerContextProvider.java
+++ b/infra/northbound/bgp-extensions/extension-common/src/main/java/io/fd/honeycomb/northbound/bgp/extension/RIBExtensionConsumerContextProvider.java
@@ -19,15 +19,17 @@ package io.fd.honeycomb.northbound.bgp.extension;
import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.data.init.ShutdownHandler;
+import java.util.ArrayList;
+import java.util.Set;
import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-
-import org.opendaylight.protocol.bgp.rib.spi.*;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionConsumerContext;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderActivator;
+import org.opendaylight.protocol.bgp.rib.spi.RIBExtensionProviderContext;
+import org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContext;
+import org.opendaylight.protocol.bgp.rib.spi.SimpleRIBExtensionProviderContextActivator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
-import java.util.Set;
-
public class RIBExtensionConsumerContextProvider extends ProviderTrait<RIBExtensionConsumerContext> {
private static final Logger LOG = LoggerFactory.getLogger(RIBExtensionConsumerContextProvider.class);
@Inject
diff --git a/infra/northbound/bgp-extensions/inet/src/main/java/io/fd/honeycomb/northbound/bgp/extension/InetWriterFactory.java b/infra/northbound/bgp-extensions/inet/src/main/java/io/fd/honeycomb/northbound/bgp/extension/InetWriterFactory.java
index 37e053a59..7fcfcdca9 100644
--- a/infra/northbound/bgp-extensions/inet/src/main/java/io/fd/honeycomb/northbound/bgp/extension/InetWriterFactory.java
+++ b/infra/northbound/bgp-extensions/inet/src/main/java/io/fd/honeycomb/northbound/bgp/extension/InetWriterFactory.java
@@ -16,20 +16,19 @@
package io.fd.honeycomb.northbound.bgp.extension;
+import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModule.TABLES_IID;
+
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
+import io.fd.honeycomb.translate.util.write.LegacyBindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
+import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv4.routes.Ipv4Routes;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.inet.rev180329.ipv6.routes.Ipv6Routes;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import javax.annotation.Nonnull;
-
-import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModule.TABLES_IID;
-
public class InetWriterFactory implements WriterFactory {
private static final InstanceIdentifier<Ipv4Routes> IPV4_ROUTES_IID = TABLES_IID.child((Class) Ipv4Routes.class);
@@ -42,7 +41,7 @@ public class InetWriterFactory implements WriterFactory {
@Override
public void init(@Nonnull ModifiableWriterRegistryBuilder registry) {
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(IPV4_ROUTES_IID, dataBroker));
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(IPV6_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(IPV4_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(IPV6_ROUTES_IID, dataBroker));
}
}
diff --git a/infra/northbound/bgp-extensions/l3-vpn-v4/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV4WriterFactory.java b/infra/northbound/bgp-extensions/l3-vpn-v4/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV4WriterFactory.java
index ad33cbb06..50d832547 100644
--- a/infra/northbound/bgp-extensions/l3-vpn-v4/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV4WriterFactory.java
+++ b/infra/northbound/bgp-extensions/l3-vpn-v4/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV4WriterFactory.java
@@ -20,7 +20,7 @@ import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModul
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
+import io.fd.honeycomb.translate.util.write.LegacyBindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
@@ -38,6 +38,6 @@ public class L3VpnV4WriterFactory implements WriterFactory {
@Override
public void init(@Nonnull ModifiableWriterRegistryBuilder registry) {
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(V4_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(V4_ROUTES_IID, dataBroker));
}
}
diff --git a/infra/northbound/bgp-extensions/l3-vpn-v6/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV6WriterFactory.java b/infra/northbound/bgp-extensions/l3-vpn-v6/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV6WriterFactory.java
index b2b2fbd5d..f29128e8b 100644
--- a/infra/northbound/bgp-extensions/l3-vpn-v6/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV6WriterFactory.java
+++ b/infra/northbound/bgp-extensions/l3-vpn-v6/src/main/java/io/fd/honeycomb/northbound/bgp/extension/L3VpnV6WriterFactory.java
@@ -20,7 +20,7 @@ import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModul
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
+import io.fd.honeycomb.translate.util.write.LegacyBindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
@@ -38,6 +38,6 @@ public class L3VpnV6WriterFactory implements WriterFactory {
@Override
public void init(@Nonnull ModifiableWriterRegistryBuilder registry) {
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(V6_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(V6_ROUTES_IID, dataBroker));
}
}
diff --git a/infra/northbound/bgp-extensions/labeled-unicast/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LabeledUnicastWriterFactory.java b/infra/northbound/bgp-extensions/labeled-unicast/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LabeledUnicastWriterFactory.java
index cd683f878..030732c52 100644
--- a/infra/northbound/bgp-extensions/labeled-unicast/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LabeledUnicastWriterFactory.java
+++ b/infra/northbound/bgp-extensions/labeled-unicast/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LabeledUnicastWriterFactory.java
@@ -20,7 +20,7 @@ import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModul
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
+import io.fd.honeycomb.translate.util.write.LegacyBindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
@@ -41,7 +41,7 @@ public class LabeledUnicastWriterFactory implements WriterFactory {
@Override
public void init(@Nonnull ModifiableWriterRegistryBuilder registry) {
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(LABELED_UNICAST_ROUTES_IID, dataBroker));
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(LABELED_UNICAST_V6_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(LABELED_UNICAST_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(LABELED_UNICAST_V6_ROUTES_IID, dataBroker));
}
}
diff --git a/infra/northbound/bgp-extensions/linkstate/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LinkstateWriterFactory.java b/infra/northbound/bgp-extensions/linkstate/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LinkstateWriterFactory.java
index 6738fdda3..d1631e135 100644
--- a/infra/northbound/bgp-extensions/linkstate/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LinkstateWriterFactory.java
+++ b/infra/northbound/bgp-extensions/linkstate/src/main/java/io/fd/honeycomb/northbound/bgp/extension/LinkstateWriterFactory.java
@@ -20,7 +20,7 @@ import static io.fd.honeycomb.northbound.bgp.extension.AbstractBgpExtensionModul
import com.google.inject.Inject;
import com.google.inject.name.Named;
-import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
+import io.fd.honeycomb.translate.util.write.LegacyBindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
@@ -38,6 +38,6 @@ public class LinkstateWriterFactory implements WriterFactory {
@Override
public void init(@Nonnull ModifiableWriterRegistryBuilder registry) {
- registry.wildcardedSubtreeAdd(new BindingBrokerWriter<>(LINKSTATE_ROUTES_IID, dataBroker));
+ registry.wildcardedSubtreeAdd(new LegacyBindingBrokerWriter<>(LINKSTATE_ROUTES_IID, dataBroker));
}
}
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/ApplicationRibWriterFactory.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/ApplicationRibWriterFactory.java
index 9ff55207b..2b8097ff9 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/ApplicationRibWriterFactory.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/ApplicationRibWriterFactory.java
@@ -22,7 +22,7 @@ import com.google.inject.name.Named;
import io.fd.honeycomb.translate.util.write.BindingBrokerWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.ApplicationRib;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.rib.Tables;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpModule.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpModule.java
index 7123caf14..8820b995d 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpModule.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpModule.java
@@ -25,12 +25,12 @@ import com.google.inject.name.Names;
import io.fd.honeycomb.infra.distro.data.BindingDataBrokerProvider;
import io.fd.honeycomb.infra.distro.data.DataStoreProvider;
import io.fd.honeycomb.infra.distro.data.InmemoryDOMDataBrokerProvider;
+import io.fd.honeycomb.infra.distro.data.LegacyBindingDataBrokerProvider;
import io.fd.honeycomb.translate.bgp.RibWriter;
import io.netty.channel.EventLoopGroup;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.opendaylight.protocol.bgp.rib.impl.spi.BGPDispatcher;
import org.opendaylight.protocol.bgp.rib.impl.spi.RIB;
import org.slf4j.Logger;
@@ -67,12 +67,12 @@ public final class BgpModule extends PrivateModule {
private void configureRIB() {
// Create inmemory config data store for HONEYCOMB_BGP
bind(InMemoryDOMDataStore.class).annotatedWith(Names.named(CONFIG))
- .toProvider(new DataStoreProvider(CONFIG, LogicalDatastoreType.CONFIGURATION))
+ .toProvider(new DataStoreProvider(CONFIG))
.in(Singleton.class);
// Create inmemory operational data store for HONEYCOMB_BGP
bind(InMemoryDOMDataStore.class).annotatedWith(Names.named(OPERATIONAL))
- .toProvider(new DataStoreProvider(OPERATIONAL, LogicalDatastoreType.OPERATIONAL))
+ .toProvider(new DataStoreProvider(OPERATIONAL))
.in(Singleton.class);
// Wrap datastores as DOMDataBroker
@@ -84,6 +84,12 @@ public final class BgpModule extends PrivateModule {
.in(Singleton.class);
expose(DataBroker.class).annotatedWith(Names.named(HONEYCOMB_BGP));
+ bind(org.opendaylight.controller.md.sal.binding.api.DataBroker.class).annotatedWith(Names.named(HONEYCOMB_BGP))
+ .toProvider(LegacyBindingDataBrokerProvider.class)
+ .in(Singleton.class);
+ expose(org.opendaylight.controller.md.sal.binding.api.DataBroker.class)
+ .annotatedWith(Names.named(HONEYCOMB_BGP));
+
// Create RIB instance
bind(RIB.class).toProvider(BgpRIBProvider.class).in(Singleton.class);
expose(RIB.class);
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java
index 8ced20b80..398cf69b1 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpRIBProvider.java
@@ -29,8 +29,9 @@ import java.util.Set;
import java.util.stream.Collectors;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
import org.opendaylight.controller.md.sal.dom.broker.impl.PingPongDataBroker;
+import org.opendaylight.controller.sal.core.compat.LegacyDOMDataBrokerAdapter;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.protocol.bgp.openconfig.routing.policy.impl.BGPRibRoutingPolicyFactoryImpl;
import org.opendaylight.protocol.bgp.openconfig.routing.policy.spi.registry.StatementRegistry;
@@ -80,6 +81,10 @@ final class BgpRIBProvider extends ProviderTrait<RIB> {
@Override
protected RIB create() {
+
+ LegacyDOMDataBrokerAdapter DomDataBrokerAdapter = new LegacyDOMDataBrokerAdapter(domBroker);
+ DomDataBrokerAdapter.getSupportedExtensions().get(DOMSchemaService.class);
+
Preconditions.checkArgument(policyCfg.getPolicyConfig().isPresent(),
"Bgp policy configuration failed to load. Check bgp-policy.json configuration file.");
final AsNumber asNumber = new AsNumber(cfg.bgpAsNumber.get().longValue());
@@ -91,9 +96,10 @@ final class BgpRIBProvider extends ProviderTrait<RIB> {
final ArrayList<AfiSafi> afiSafiList = new ArrayList<>(configuredAfiSafis);
// based on org.opendaylight.protocol.bgp.rib.impl.config.RibImpl.createRib
- final PingPongDataBroker pingPongDataBroker = new PingPongDataBroker(domBroker);
+ final PingPongDataBroker pingPongDataBroker = new PingPongDataBroker(DomDataBrokerAdapter);
final CodecsRegistryImpl codecsRegistry =
CodecsRegistryImpl.create(codec, extensions.getClassLoadingStrategy());
+
final BGPRibRoutingPolicyFactoryImpl bgpRibRoutingPolicyFactory =
new BGPRibRoutingPolicyFactoryImpl(dataBroker, new StatementRegistry());
final BGPRibRoutingPolicy ribPolicies = bgpRibRoutingPolicyFactory
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReaderFactoryProvider.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReaderFactoryProvider.java
index 7ae724696..56af9b51f 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReaderFactoryProvider.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/BgpReaderFactoryProvider.java
@@ -16,14 +16,15 @@
package io.fd.honeycomb.infra.bgp;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+
import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.util.read.BindingBrokerReader;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.BgpRib;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev180329.BgpRibBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -53,8 +54,8 @@ final class BgpReaderFactoryProvider extends ProviderTrait<ReaderFactory> {
@Override
public void init(final ModifiableReaderRegistryBuilder registry) {
- registry.add(new BindingBrokerReader<>(InstanceIdentifier.create(BgpRib.class),
- bgpDataBroker, LogicalDatastoreType.OPERATIONAL, BgpRibBuilder.class));
+ registry.add(new BindingBrokerReader<>(InstanceIdentifier.create(BgpRib.class), bgpDataBroker, OPERATIONAL,
+ BgpRibBuilder.class));
}
}
}
diff --git a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/neighbors/BgpPeerWriterFactory.java b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/neighbors/BgpPeerWriterFactory.java
index e844cf3e0..c70dc0050 100644
--- a/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/neighbors/BgpPeerWriterFactory.java
+++ b/infra/northbound/bgp/src/main/java/io/fd/honeycomb/infra/bgp/neighbors/BgpPeerWriterFactory.java
@@ -22,7 +22,6 @@ import io.fd.honeycomb.translate.impl.write.GenericListWriter;
import io.fd.honeycomb.translate.write.WriterFactory;
import io.fd.honeycomb.translate.write.registry.ModifiableWriterRegistryBuilder;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
import org.opendaylight.protocol.bgp.rib.impl.spi.BGPPeerRegistry;
import org.opendaylight.protocol.bgp.rib.impl.spi.RIB;
@@ -35,7 +34,6 @@ import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.network.instance.re
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.network.instance.rev151018.network.instance.top.network.instances.network.instance.protocols.Protocol;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.openconfig.extensions.rev180329.NetworkInstanceProtocol;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.osgi.framework.BundleContext;
/**
* Initializes writer for Bgp Neighbors ({@link Neighbor} node) and all its parents required by HC infra.
diff --git a/infra/northbound/bgp/src/test/java/io/fd/honeycomb/infra/bgp/neighbors/NeighborCustomizerTest.java b/infra/northbound/bgp/src/test/java/io/fd/honeycomb/infra/bgp/neighbors/NeighborCustomizerTest.java
index fadef81ab..69bff5eb3 100644
--- a/infra/northbound/bgp/src/test/java/io/fd/honeycomb/infra/bgp/neighbors/NeighborCustomizerTest.java
+++ b/infra/northbound/bgp/src/test/java/io/fd/honeycomb/infra/bgp/neighbors/NeighborCustomizerTest.java
@@ -24,7 +24,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.infra.bgp.BgpConfiguration;
@@ -115,7 +114,7 @@ public class NeighborCustomizerTest {
when(globalRib.createPeerChain(any())).thenReturn(chain);
when(chain.newWriteOnlyTransaction()).thenReturn(tx);
- when(tx.submit()).thenReturn(mock(CheckedFuture.class));
+ when(tx.commit()).thenReturn(mock(FluentFuture.class));
when(globalRib.getRibSupportContext()).thenReturn(mock(RIBSupportContextRegistry.class));
when(globalRib.getService()).thenReturn(mock(DOMDataTreeChangeService.class));
when(globalRib.getDispatcher()).thenReturn(dispatcher);
diff --git a/infra/northbound/netconf/pom.xml b/infra/northbound/netconf/pom.xml
index fcbf38880..a509e0f74 100644
--- a/infra/northbound/netconf/pom.xml
+++ b/infra/northbound/netconf/pom.xml
@@ -76,7 +76,7 @@
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
- <artifactId>netconf-ssh</artifactId>
+ <artifactId>mdsal-netconf-ssh</artifactId>
</dependency>
<dependency>
<groupId>org.opendaylight.netconf</groupId>
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/HoneycombNotification2NetconfProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/HoneycombNotification2NetconfProvider.java
index 287629288..30f8404d9 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/HoneycombNotification2NetconfProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/HoneycombNotification2NetconfProvider.java
@@ -25,10 +25,10 @@ import io.fd.honeycomb.notification.impl.TranslationUtil;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
-import org.opendaylight.controller.md.sal.dom.api.DOMNotificationListener;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.api.DOMNotification;
+import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
import org.opendaylight.netconf.notifications.NotificationPublisherRegistration;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfBindingBrokerProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfBindingBrokerProvider.java
index bafd4ea3c..5b9dd9ed3 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfBindingBrokerProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfBindingBrokerProvider.java
@@ -20,8 +20,8 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.impl.FakeBindingAwareBroker;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
public final class NetconfBindingBrokerProvider extends ProviderTrait<BindingAwareBroker> {
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMdsalMapperProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMdsalMapperProvider.java
index da092b21c..94863e079 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMdsalMapperProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMdsalMapperProvider.java
@@ -21,8 +21,8 @@ import static io.fd.honeycomb.infra.distro.data.ConfigAndOperationalPipelineModu
import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
@@ -44,9 +44,7 @@ public final class NetconfMdsalMapperProvider extends ProviderTrait<NetconfOpera
@Override
protected MdsalNetconfOperationServiceFactory create() {
- MdsalNetconfOperationServiceFactory mdsalNetconfOperationServiceFactory =
- new MdsalNetconfOperationServiceFactory(schemaService, netconfOperationServiceFactoryListener,
- domBroker, rpcService);
- return mdsalNetconfOperationServiceFactory;
+ return new MdsalNetconfOperationServiceFactory(schemaService, netconfOperationServiceFactoryListener,
+ domBroker, rpcService);
}
}
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfModule.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfModule.java
index 509f5b898..cbd83e2de 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfModule.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfModule.java
@@ -29,20 +29,19 @@ import io.fd.honeycomb.notification.NotificationCollector;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.util.HashedWheelTimer;
import io.netty.util.Timer;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.opendaylight.netconf.api.NetconfServerDispatcher;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
+import org.opendaylight.netconf.mdsal.notification.impl.NetconfNotificationManager;
import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
import org.opendaylight.netconf.notifications.NetconfNotificationListener;
import org.opendaylight.netconf.notifications.NetconfNotificationRegistry;
-import org.opendaylight.netconf.notifications.impl.NetconfNotificationManager;
import org.opendaylight.netconf.ssh.NetconfNorthboundSshServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -72,13 +71,13 @@ public class NetconfModule extends NorthboundPrivateModule<NetconfConfiguration>
// Create inmemory data store for HONEYCOMB_NETCONF config metadata
bind(InMemoryDOMDataStore.class).annotatedWith(Names.named(InmemoryDOMDataBrokerProvider.CONFIG))
.toProvider(
- new DataStoreProvider(InmemoryDOMDataBrokerProvider.CONFIG, LogicalDatastoreType.CONFIGURATION))
+ new DataStoreProvider(InmemoryDOMDataBrokerProvider.CONFIG))
.in(Singleton.class);
// Create inmemory data store for HONEYCOMB_NETCONF operational metadata
bind(InMemoryDOMDataStore.class).annotatedWith(Names.named(InmemoryDOMDataBrokerProvider.OPERATIONAL))
- .toProvider(new DataStoreProvider(InmemoryDOMDataBrokerProvider.OPERATIONAL,
- LogicalDatastoreType.OPERATIONAL))
+ .toProvider(new DataStoreProvider(InmemoryDOMDataBrokerProvider.OPERATIONAL
+ ))
.in(Singleton.class);
// Wrap datastores as DOMDataBroker
bind(DOMDataBroker.class).toProvider(InmemoryDOMDataBrokerProvider.class).in(Singleton.class);
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringMapperProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringMapperProvider.java
index e7b5edb07..3cea7421f 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringMapperProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringMapperProvider.java
@@ -21,7 +21,7 @@ import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.MdsalMonitoringMapperFactory;
import org.opendaylight.controller.config.yang.netconf.mdsal.monitoring.MonitoringToMdsalWriter;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringReaderFactoryProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringReaderFactoryProvider.java
index 50e0e8ac6..3ea783976 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringReaderFactoryProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfMonitoringReaderFactoryProvider.java
@@ -16,14 +16,15 @@
package io.fd.honeycomb.northbound.netconf;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+
import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.util.read.BindingBrokerReader;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfStateBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -55,8 +56,7 @@ public final class NetconfMonitoringReaderFactoryProvider extends ProviderTrait<
@Override
public void init(final ModifiableReaderRegistryBuilder registry) {
registry.add(new BindingBrokerReader<>(InstanceIdentifier.create(NetconfState.class),
- netconfMonitoringBindingBrokerDependency,
- LogicalDatastoreType.OPERATIONAL, NetconfStateBuilder.class));
+ netconfMonitoringBindingBrokerDependency, OPERATIONAL, NetconfStateBuilder.class));
}
}
}
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
index f64e4b020..9289936ac 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationMapperProvider.java
@@ -20,13 +20,13 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.data.init.ShutdownHandler;
-import org.opendaylight.controller.config.yang.netconf.mdsal.notification.CapabilityChangeNotificationProducer;
-import org.opendaylight.controller.config.yang.netconf.mdsal.notification.NotificationToMdsalWriter;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactoryListener;
-import org.opendaylight.netconf.mdsal.notification.NetconfNotificationOperationServiceFactory;
+import org.opendaylight.netconf.mdsal.notification.impl.CapabilityChangeNotificationProducer;
+import org.opendaylight.netconf.mdsal.notification.impl.NetconfNotificationOperationServiceFactory;
+import org.opendaylight.netconf.mdsal.notification.impl.NotificationToMdsalWriter;
import org.opendaylight.netconf.notifications.NetconfNotificationCollector;
import org.opendaylight.netconf.notifications.NetconfNotificationRegistry;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.monitoring.rev101004.NetconfState;
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationsReaderFactoryProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationsReaderFactoryProvider.java
index 4ed682ff0..70aa99b46 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationsReaderFactoryProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfNotificationsReaderFactoryProvider.java
@@ -16,6 +16,8 @@
package io.fd.honeycomb.northbound.netconf;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
+
import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
@@ -23,8 +25,7 @@ import io.fd.honeycomb.translate.read.ReaderFactory;
import io.fd.honeycomb.translate.read.registry.ModifiableReaderRegistryBuilder;
import io.fd.honeycomb.translate.util.read.BindingBrokerReader;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.Netconf;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.NetconfBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -49,8 +50,9 @@ public final class NetconfNotificationsReaderFactoryProvider extends ProviderTra
@Override
public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) {
- registry.add(new BindingBrokerReader<>(InstanceIdentifier.create(Netconf.class), netconfDataBroker,
- LogicalDatastoreType.OPERATIONAL, NetconfBuilder.class));
+ registry.add(
+ new BindingBrokerReader<>(InstanceIdentifier.create(Netconf.class), netconfDataBroker, OPERATIONAL,
+ NetconfBuilder.class));
}
}
diff --git a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfServerDispatcherProvider.java b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfServerDispatcherProvider.java
index b6c22bfd8..422b81c5a 100644
--- a/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfServerDispatcherProvider.java
+++ b/infra/northbound/netconf/src/main/java/io/fd/honeycomb/northbound/netconf/NetconfServerDispatcherProvider.java
@@ -25,6 +25,7 @@ import java.util.concurrent.TimeUnit;
import org.opendaylight.netconf.api.NetconfServerDispatcher;
import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
import org.opendaylight.netconf.impl.NetconfServerDispatcherImpl;
+import org.opendaylight.netconf.impl.ServerChannelInitializer;
import org.opendaylight.netconf.impl.SessionIdProvider;
import org.opendaylight.netconf.impl.osgi.AggregatedNetconfOperationServiceFactory;
import org.opendaylight.netconf.mapping.api.NetconfOperationServiceFactory;
@@ -51,8 +52,7 @@ public final class NetconfServerDispatcherProvider extends ProviderTrait<Netconf
NetconfServerSessionNegotiatorFactory serverNegotiatorFactory =
new NetconfServerSessionNegotiatorFactory(timer, netconfOperationProvider, new SessionIdProvider(),
CONNECTION_TIMEOUT_MILLIS, monitoringService);
- NetconfServerDispatcherImpl.ServerChannelInitializer serverChannelInitializer =
- new NetconfServerDispatcherImpl.ServerChannelInitializer(serverNegotiatorFactory);
+ ServerChannelInitializer serverChannelInitializer = new ServerChannelInitializer(serverNegotiatorFactory);
return new NetconfServerDispatcherImpl(serverChannelInitializer, nettyThreadgroup, nettyThreadgroup);
}
diff --git a/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/BrokerFacadeProvider.java b/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/BrokerFacadeProvider.java
index f6a7e5e81..4103399e6 100644
--- a/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/BrokerFacadeProvider.java
+++ b/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/BrokerFacadeProvider.java
@@ -20,9 +20,9 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.honeycomb.binding.init.ProviderTrait;
import io.fd.honeycomb.infra.distro.data.ConfigAndOperationalPipelineModule;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.md.sal.dom.broker.impl.DOMNotificationRouter;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.broker.DOMNotificationRouter;
import org.opendaylight.netconf.sal.restconf.impl.BrokerFacade;
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
@@ -40,8 +40,6 @@ final class BrokerFacadeProvider extends ProviderTrait<BrokerFacade> {
@Override
protected BrokerFacade create() {
- BrokerFacade brokerFacade =
- BrokerFacade.newInstance(rpcService, domDataBroker, notificationService, controllerContext);
- return brokerFacade;
+ return BrokerFacade.newInstance(rpcService, domDataBroker, notificationService, controllerContext);
}
}
diff --git a/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/ControllerContextProvider.java b/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/ControllerContextProvider.java
index 909f063d1..3daef1e5f 100644
--- a/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/ControllerContextProvider.java
+++ b/infra/northbound/restconf/src/main/java/io/fd/honeycomb/northbound/restconf/ControllerContextProvider.java
@@ -18,7 +18,7 @@ package io.fd.honeycomb.northbound.restconf;
import com.google.inject.Inject;
import io.fd.honeycomb.binding.init.ProviderTrait;
-import org.opendaylight.controller.md.sal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
import org.opendaylight.mdsal.dom.api.DOMSchemaService;
import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
diff --git a/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollector.java b/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollector.java
index 18b32020c..fd70bc68d 100644
--- a/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollector.java
+++ b/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollector.java
@@ -19,7 +19,7 @@ package io.fd.honeycomb.notification.impl;
import io.fd.honeycomb.notification.NotificationCollector;
import java.util.Collection;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.yangtools.yang.binding.Notification;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/NotificationProducerTracker.java b/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/NotificationProducerTracker.java
index 808512c21..01c9750ef 100644
--- a/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/NotificationProducerTracker.java
+++ b/infra/notification/impl/src/main/java/io/fd/honeycomb/notification/impl/NotificationProducerTracker.java
@@ -25,8 +25,8 @@ import java.util.Set;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.ThreadSafe;
-import org.opendaylight.controller.md.sal.dom.spi.DOMNotificationSubscriptionListener;
-import org.opendaylight.controller.md.sal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListener;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
diff --git a/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollectorTest.java b/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollectorTest.java
index ef9f548b7..cbd9f539d 100644
--- a/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollectorTest.java
+++ b/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/HoneycombNotificationCollectorTest.java
@@ -24,7 +24,7 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
+import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStartBuilder;
diff --git a/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/NotificationProducerTrackerTest.java b/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/NotificationProducerTrackerTest.java
index 4de2e7773..bd262e7cd 100644
--- a/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/NotificationProducerTrackerTest.java
+++ b/infra/notification/impl/src/test/java/io/fd/honeycomb/notification/impl/NotificationProducerTrackerTest.java
@@ -28,7 +28,7 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.netconf.notifications.rev120206.NetconfSessionStart;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
diff --git a/infra/rpc/api/src/main/java/io/fd/honeycomb/rpc/RpcException.java b/infra/rpc/api/src/main/java/io/fd/honeycomb/rpc/RpcException.java
index 907ce6c15..72d1a8835 100644
--- a/infra/rpc/api/src/main/java/io/fd/honeycomb/rpc/RpcException.java
+++ b/infra/rpc/api/src/main/java/io/fd/honeycomb/rpc/RpcException.java
@@ -17,7 +17,7 @@
package io.fd.honeycomb.rpc;
import com.google.common.annotations.Beta;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
+import org.opendaylight.mdsal.dom.api.DOMRpcException;
@Beta
public class RpcException extends DOMRpcException {
diff --git a/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/HoneycombDOMRpcService.java b/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/HoneycombDOMRpcService.java
index d951ff962..49a8b4346 100644
--- a/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/HoneycombDOMRpcService.java
+++ b/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/HoneycombDOMRpcService.java
@@ -18,19 +18,18 @@ package io.fd.honeycomb.rpc;
import static net.javacrumbs.futureconverter.java8guava.FutureConverter.toListenableFuture;
-import com.google.common.base.Function;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import java.util.concurrent.CompletableFuture;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcAvailabilityListener;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcService;
-import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
+import org.opendaylight.mdsal.dom.api.DOMRpcService;
+import org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -39,9 +38,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
public final class HoneycombDOMRpcService implements DOMRpcService {
- private static final Function<? super Exception, DOMRpcException> ANY_EX_TO_RPC_EXCEPTION_MAPPER =
- e -> (e instanceof DOMRpcException) ? (DOMRpcException) e : new RpcException("RPC failed", e);
-
private final BindingNormalizedNodeSerializer serializer;
private final RpcRegistry rpcRegistry;
@@ -53,8 +49,8 @@ public final class HoneycombDOMRpcService implements DOMRpcService {
@Nonnull
@Override
- public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(@Nonnull final SchemaPath schemaPath,
- @Nullable final NormalizedNode<?, ?> normalizedNode) {
+ public FluentFuture<DOMRpcResult> invokeRpc(@Nonnull final SchemaPath schemaPath,
+ @Nullable final NormalizedNode<?, ?> normalizedNode) {
DataObject input = null;
if (normalizedNode != null) {
// RPC input is optional
@@ -63,7 +59,7 @@ public final class HoneycombDOMRpcService implements DOMRpcService {
}
final CompletableFuture<DataObject> result = rpcRegistry.invoke(schemaPath, input).toCompletableFuture();
final ListenableFuture<DOMRpcResult> output = getDOMRpcResult(toListenableFuture(result));
- return Futures.makeChecked(output, ANY_EX_TO_RPC_EXCEPTION_MAPPER);
+ return FluentFuture.from(output);
}
private ListenableFuture<DOMRpcResult> getDOMRpcResult(final ListenableFuture<DataObject> invoke) {
@@ -76,7 +72,7 @@ public final class HoneycombDOMRpcService implements DOMRpcService {
outputNode = serializer.toNormalizedNodeRpcData(output);
}
return new DefaultDOMRpcResult(outputNode);
- });
+ }, MoreExecutors.directExecutor());
}
@Nonnull
diff --git a/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java b/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java
index ca6441ee8..aba79ad13 100644
--- a/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java
+++ b/infra/rpc/impl/src/main/java/io/fd/honeycomb/rpc/RpcRegistryBuilder.java
@@ -22,7 +22,7 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.slf4j.Logger;
diff --git a/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/HoneycombDOMRpcServiceTest.java b/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/HoneycombDOMRpcServiceTest.java
index 7b27fec4e..c47590887 100644
--- a/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/HoneycombDOMRpcServiceTest.java
+++ b/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/HoneycombDOMRpcServiceTest.java
@@ -22,6 +22,7 @@ import static org.mockito.Mockito.when;
import java.net.URI;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatchers;
@@ -74,13 +75,13 @@ public class HoneycombDOMRpcServiceTest {
assertEquals(outputBi, service.invokeRpc(path, node).get().getResult());
}
- @Test(expected = RpcException.class)
+ @Test(expected = ExecutionException.class)
public void testInvokeRpcFailed() throws Exception {
final CompletableFuture future = new CompletableFuture();
future.completeExceptionally(new RuntimeException());
when(registry.invoke(path, input)).thenReturn(future);
- service.invokeRpc(path, node).checkedGet();
+ service.invokeRpc(path, node).get();
}
private ContainerNode mockContainerNode(final QName nn1) {
diff --git a/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/RpcRegistryBuilderTest.java b/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/RpcRegistryBuilderTest.java
index d021555b8..4c7686fa1 100644
--- a/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/RpcRegistryBuilderTest.java
+++ b/infra/rpc/impl/src/test/java/io/fd/honeycomb/rpc/RpcRegistryBuilderTest.java
@@ -20,13 +20,12 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.net.URI;
-import java.util.concurrent.ExecutionException;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationNotAvailableException;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -68,7 +67,7 @@ public class RpcRegistryBuilderTest {
}
@Test
- public void testServiceNotFound() throws ExecutionException, InterruptedException {
+ public void testServiceNotFound() {
final SchemaPath id = SchemaPath.ROOT.createChild(QName.create(namespace, "c"));
final DataObject request = Mockito.mock(DataObject.class);
diff --git a/infra/test-utils/test-tools/pom.xml b/infra/test-utils/test-tools/pom.xml
index 140fb797f..2e4a5a795 100644
--- a/infra/test-utils/test-tools/pom.xml
+++ b/infra/test-utils/test-tools/pom.xml
@@ -83,6 +83,11 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.8.1</version>
+ </dependency>
</dependencies>
</project> \ No newline at end of file
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/AbstractYangContextHolder.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/AbstractYangContextHolder.java
index 93360d25a..7a98ddbc5 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/AbstractYangContextHolder.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/AbstractYangContextHolder.java
@@ -16,10 +16,9 @@
package io.fd.honeycomb.test.tools;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-
import javax.annotation.Nonnull;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
+import org.opendaylight.yangtools.yang.model.api.SchemaContext;
abstract class AbstractYangContextHolder {
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java
index 4e5893e2b..88e8b04a5 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ContainerNodeDataProcessor.java
@@ -22,7 +22,7 @@ import static io.fd.honeycomb.translate.util.JsonUtils.readJson;
import java.io.InputStream;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/HoneycombTestRunner.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/HoneycombTestRunner.java
index 5b6cc5af8..c7b84dd5b 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/HoneycombTestRunner.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/HoneycombTestRunner.java
@@ -26,7 +26,7 @@ import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
import org.opendaylight.yangtools.yang.data.util.AbstractModuleStringInstanceIdentifierCodec;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java
index dd7efbb84..ee30b7803 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/ListNodeDataProcessor.java
@@ -22,7 +22,7 @@ import static io.fd.honeycomb.translate.util.JsonUtils.readListEntryFromJson;
import java.io.InputStream;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangContextProducer.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangContextProducer.java
index 34cc5abd6..71333bfc4 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangContextProducer.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangContextProducer.java
@@ -24,7 +24,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javassist.ClassPool;
import org.apache.commons.lang3.reflect.MethodUtils;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.dom.codec.gen.impl.StreamWriterGenerator;
import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java
index 6722d01af..7c6e3753c 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessor.java
@@ -19,9 +19,10 @@ package io.fd.honeycomb.test.tools;
import java.util.AbstractMap;
import java.util.Map;
import java.util.Optional;
+import java.util.function.Supplier;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.generator.impl.BindingSchemaContextUtils;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -74,7 +75,7 @@ interface YangDataProcessor {
return schemaContext;
}
- final com.google.common.base.Optional<InstanceIdentifier<? extends DataObject>> parentInstanceId;
+ final Optional<InstanceIdentifier<? extends DataObject>> parentInstanceId;
try {
parentInstanceId = serializer.toBinding(parentYangId);
} catch (DeserializationException e) {
@@ -85,12 +86,13 @@ interface YangDataProcessor {
throw new IllegalStateException(String.format("Unable to resolve %s to instance identifier", parentYangId));
}
- final com.google.common.base.Optional<DataNodeContainer> dataNodeContainerOptional =
+ final Optional<DataNodeContainer> dataNodeContainerOptional =
BindingSchemaContextUtils.findDataNodeContainer(schemaContext, parentInstanceId.get());
if (!dataNodeContainerOptional.isPresent()) {
- throw new IllegalArgumentException(String.format("Error finding DataNodeContainer for %s", parentInstanceId.get()));
+ throw new IllegalArgumentException(
+ String.format("Error finding DataNodeContainer for %s", parentInstanceId.get()));
}
final DataNodeContainer parentNode = dataNodeContainerOptional.get();
@@ -99,13 +101,18 @@ interface YangDataProcessor {
}
@Nonnull
- default Map.Entry<InstanceIdentifier<? extends DataObject>, DataObject> nodeBinding(@Nonnull final BindingToNormalizedNodeCodec serializer,
- @Nonnull final YangInstanceIdentifier identifier,
- @Nonnull final NormalizedNode<?, ?> data) {
+ default Map.Entry<InstanceIdentifier<? extends DataObject>, DataObject> nodeBinding(
+ @Nonnull final BindingToNormalizedNodeCodec serializer,
+ @Nonnull final YangInstanceIdentifier identifier,
+ @Nonnull final NormalizedNode<?, ?> data) throws IllegalArgumentException {
try {
return serializer.toBinding(new AbstractMap.SimpleImmutableEntry<>(identifier, data))
- .or(() -> {
- throw new IllegalArgumentException(String.format("Unable to create node binding for %s|%s", identifier, data));
+ .orElseThrow(new Supplier<RuntimeException>() {
+ @Override
+ public RuntimeException get() {
+ throw new IllegalArgumentException(
+ String.format("Unable to create node binding for %s|%s", identifier, data));
+ }
});
} catch (DeserializationException e) {
throw new IllegalArgumentException(String.format("Unable to deserialize node %s|%s", identifier, data), e);
@@ -113,12 +120,17 @@ interface YangDataProcessor {
}
@Nonnull
- default InstanceIdentifier<? extends DataObject> identifierBinding(@Nonnull final BindingToNormalizedNodeCodec serializer,
- @Nonnull final YangInstanceIdentifier identifier) {
+ default InstanceIdentifier<? extends DataObject> identifierBinding(
+ @Nonnull final BindingToNormalizedNodeCodec serializer,
+ @Nonnull final YangInstanceIdentifier identifier) throws IllegalArgumentException{
try {
return serializer.toBinding(identifier)
- .or(() -> {
- throw new IllegalArgumentException(String.format("Unable convert %s to binding", identifier));
+ .orElseThrow(new Supplier<RuntimeException>() {
+ @Override
+ public RuntimeException get() {
+ throw new IllegalArgumentException(
+ String.format("Unable convert %s to binding", identifier));
+ }
});
} catch (DeserializationException e) {
throw new IllegalArgumentException(String.format("Unable to deserialize %s", identifier), e);
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java
index b5057a527..690c01b6b 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/YangDataProcessorRegistry.java
@@ -22,7 +22,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
diff --git a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java
index 0afb89007..7a944924e 100644
--- a/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java
+++ b/infra/test-utils/test-tools/src/main/java/io/fd/honeycomb/test/tools/annotations/InjectablesProcessor.java
@@ -52,7 +52,8 @@ public interface InjectablesProcessor {
return parameter.getAnnotation(InjectTestData.class).resourcePath();
}
- default YangInstanceIdentifier instanceIdentifier(@Nonnull final AbstractModuleStringInstanceIdentifierCodec parser, @Nonnull final Field field) {
+ default YangInstanceIdentifier instanceIdentifier(@Nonnull final AbstractModuleStringInstanceIdentifierCodec parser,
+ @Nonnull final Field field) {
final String identifier = field.getAnnotation(InjectTestData.class).id();
// == used instead of equals to ensure constant was used
if (NO_ID.equals(identifier)) {
@@ -62,7 +63,8 @@ public interface InjectablesProcessor {
}
}
- default YangInstanceIdentifier instanceIdentifier(@Nonnull final AbstractModuleStringInstanceIdentifierCodec parser, @Nonnull final Parameter parameter) {
+ default YangInstanceIdentifier instanceIdentifier(@Nonnull final AbstractModuleStringInstanceIdentifierCodec parser,
+ @Nonnull final Parameter parameter) {
final String identifier = parameter.getAnnotation(InjectTestData.class).id();
// == used instead of equals to ensure constant was used
if (NO_ID.equals(identifier)) {
diff --git a/infra/test-utils/test-tools/src/test/java/io/fd/honeycomb/test/tools/AbstractYangDataProcessorTest.java b/infra/test-utils/test-tools/src/test/java/io/fd/honeycomb/test/tools/AbstractYangDataProcessorTest.java
index 4018d441c..d719ee721 100644
--- a/infra/test-utils/test-tools/src/test/java/io/fd/honeycomb/test/tools/AbstractYangDataProcessorTest.java
+++ b/infra/test-utils/test-tools/src/test/java/io/fd/honeycomb/test/tools/AbstractYangDataProcessorTest.java
@@ -21,7 +21,7 @@ import io.fd.honeycomb.test.tools.annotations.InjectablesProcessor;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import org.junit.Before;
-import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingToNormalizedNodeCodec;
import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.data.rev150105.$YangModuleInfoImpl;
import org.opendaylight.yangtools.yang.data.util.AbstractModuleStringInstanceIdentifierCodec;
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/MappingContext.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/MappingContext.java
index 5a5ba980c..9699d1aea 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/MappingContext.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/MappingContext.java
@@ -16,7 +16,7 @@
package io.fd.honeycomb.translate;
-import com.google.common.base.Optional;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Initializer.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Initializer.java
index e26ab55bc..ae5164bf5 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Initializer.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Initializer.java
@@ -18,7 +18,7 @@ package io.fd.honeycomb.translate.read;
import com.google.common.annotations.Beta;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java
index 252d79e84..ba64b6b3c 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/Reader.java
@@ -17,8 +17,8 @@
package io.fd.honeycomb.translate.read;
import com.google.common.annotations.Beta;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.SubtreeManager;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/InitRegistry.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/InitRegistry.java
index 8a97a7141..2b35827f7 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/InitRegistry.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/InitRegistry.java
@@ -20,7 +20,7 @@ package io.fd.honeycomb.translate.read.registry;
import io.fd.honeycomb.translate.read.InitFailedException;
import io.fd.honeycomb.translate.read.ReadContext;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
/**
* Root initializer.
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/ReaderRegistry.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/ReaderRegistry.java
index 6436fd738..41b819508 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/ReaderRegistry.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/read/registry/ReaderRegistry.java
@@ -17,10 +17,10 @@
package io.fd.honeycomb.translate.read.registry;
import com.google.common.annotations.Beta;
-import com.google.common.base.Optional;
import com.google.common.collect.Multimap;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -56,7 +56,6 @@ public interface ReaderRegistry extends InitRegistry {
* @throws ReadFailedException if read was unsuccessful
*/
@Nonnull
- Optional<? extends DataObject> read(@Nonnull InstanceIdentifier<? extends DataObject> id,
- @Nonnull ReadContext ctx)
+ Optional<? extends DataObject> read(@Nonnull InstanceIdentifier<? extends DataObject> id, @Nonnull ReadContext ctx)
throws ReadFailedException;
}
diff --git a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/WriteContext.java b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/WriteContext.java
index c92bffeca..ef548d410 100644
--- a/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/WriteContext.java
+++ b/infra/translate-api/src/main/java/io/fd/honeycomb/translate/write/WriteContext.java
@@ -17,8 +17,8 @@
package io.fd.honeycomb.translate.write;
import com.google.common.annotations.Beta;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.ModificationContext;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitListReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitListReader.java
index cabf31633..bc76f3705 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitListReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitListReader.java
@@ -18,7 +18,6 @@ package io.fd.honeycomb.translate.impl.read;
import static io.fd.honeycomb.translate.impl.read.GenericInitReader.writeInit;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.read.InitFailedException;
import io.fd.honeycomb.translate.read.InitListReader;
import io.fd.honeycomb.translate.read.ReadContext;
@@ -26,8 +25,9 @@ import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.Initialized;
import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer;
import io.fd.honeycomb.translate.util.RWUtils;
+import java.util.Optional;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitReader.java
index 147cbd3cc..59f9bc1b5 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericInitReader.java
@@ -16,9 +16,8 @@
package io.fd.honeycomb.translate.impl.read;
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
-import com.google.common.base.Optional;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.MoreExecutors;
@@ -28,10 +27,12 @@ import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.Initialized;
import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer;
+import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -72,7 +73,15 @@ public final class GenericInitReader<O extends DataObject, B extends Builder<O>>
@SuppressWarnings("unchecked")
static void writeInit(final DataBroker broker, final Initialized<? extends DataObject> init) {
final WriteTransaction writeTx = broker.newWriteOnlyTransaction();
- writeTx.merge(CONFIGURATION, (InstanceIdentifier) init.getId(), init.getData(), true);
+
+ InstanceIdentifier id = init.getId();
+ if (id.getPathArguments() instanceof List && ((List) id.getPathArguments()).size() == 1) {
+ //root element only. not necessary to create parents
+ writeTx.merge(CONFIGURATION, id, init.getData());
+ }
+ else {
+ writeTx.mergeParentStructureMerge(CONFIGURATION, id, init.getData());
+ }
FluentFuture<? extends CommitInfo> future = writeTx.commit();
future.addCallback(new FutureCallback<CommitInfo>() {
@Override
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericListReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericListReader.java
index 9e2ccd7e5..d715dde26 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericListReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/GenericListReader.java
@@ -19,19 +19,18 @@ package io.fd.honeycomb.translate.impl.read;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.annotations.Beta;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.read.ListReader;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
import io.fd.honeycomb.translate.util.RWUtils;
+import io.fd.honeycomb.translate.util.read.ReflexiveListReaderCustomizer;
import java.util.ArrayList;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.ThreadSafe;
-
-import io.fd.honeycomb.translate.util.read.ReflexiveListReaderCustomizer;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
index 0a87d9b3f..7283e21f9 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReader.java
@@ -19,7 +19,6 @@ package io.fd.honeycomb.translate.impl.read.registry;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import io.fd.honeycomb.translate.read.InitFailedException;
@@ -36,8 +35,9 @@ import io.fd.honeycomb.translate.util.read.DelegatingReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
@@ -70,7 +70,7 @@ class CompositeReader<D extends DataObject, B extends Builder<D>>
@SuppressWarnings("unchecked")
public static <D extends DataObject> InstanceIdentifier<D> appendTypeToId(
final InstanceIdentifier<? extends DataObject> parentId, final InstanceIdentifier<D> type) {
- final InstanceIdentifier.PathArgument t = new InstanceIdentifier.Item<>(type.getTargetType());
+ final InstanceIdentifier.PathArgument t = InstanceIdentifier.Item.of(type.getTargetType());
return (InstanceIdentifier<D>) InstanceIdentifier.create(Iterables.concat(
parentId.getPathArguments(), Collections.singleton(t)));
}
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistry.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistry.java
index 0eda8e6b3..4783c9cd4 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistry.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistry.java
@@ -19,7 +19,6 @@ package io.fd.honeycomb.translate.impl.read.registry;
import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Multimap;
@@ -34,9 +33,10 @@ import io.fd.honeycomb.translate.util.RWUtils;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReader.java
index e7cef8107..6d379910b 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReader.java
@@ -23,7 +23,7 @@ import io.fd.honeycomb.translate.read.ListReader;
import io.fd.honeycomb.translate.read.ReadContext;
import java.util.Set;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.Identifiable;
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReader.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReader.java
index 4db6dd70e..e4d9b847b 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReader.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReader.java
@@ -18,7 +18,6 @@ package io.fd.honeycomb.translate.impl.read.registry;
import static com.google.common.base.Preconditions.checkArgument;
-import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
import io.fd.honeycomb.translate.read.ListReader;
import io.fd.honeycomb.translate.read.ReadContext;
@@ -32,6 +31,7 @@ import java.lang.reflect.Method;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+import java.util.Optional;
import java.util.Set;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
@@ -133,7 +133,7 @@ class SubtreeReader<D extends DataObject, B extends Builder<D>> implements Deleg
Collections.emptyList(), nextId.getType());
if (method.isPresent()) {
- return Optional.fromNullable(filterSingle(parent, nextId, method.get()));
+ return Optional.ofNullable(filterSingle(parent, nextId, method.get()));
} else {
// List child nodes
method = ReflectionUtils.findMethodReflex(managedType,
@@ -161,7 +161,7 @@ class SubtreeReader<D extends DataObject, B extends Builder<D>> implements Deleg
final Method keyGetter = ReflectionUtils.findMethodReflex(nextId.getType(), "get",
Collections.emptyList(), key.getClass()).get();
- return Optional.fromNullable(invoke.stream()
+ return Optional.ofNullable(invoke.stream()
.filter(item -> key.equals(invoke(keyGetter, nextId, item)))
.findFirst().orElse(null));
}
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/GenericListWriter.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/GenericListWriter.java
index cc4800a65..e78278fb7 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/GenericListWriter.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/GenericListWriter.java
@@ -92,7 +92,7 @@ public final class GenericListWriter<D extends DataObject & Identifiable<K>, K e
// Make sure the key is present
if (isWildcarded(id)) {
return RWUtils.replaceLastInId(id,
- new InstanceIdentifier.IdentifiableItem<>(id.getTargetType(), current.key()));
+ InstanceIdentifier.IdentifiableItem.of(id.getTargetType(), current.key()));
} else {
return id;
}
diff --git a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java
index 9e36e593f..60ee68e1c 100644
--- a/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java
+++ b/infra/translate-impl/src/main/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistry.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static java.util.stream.Collectors.toMap;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
@@ -39,6 +38,7 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -216,7 +216,8 @@ final class FlatWriterRegistry implements WriterRegistry {
final Optional<? extends DataObject> parentAfter = ctx.readAfter(parentKeyedId);
// Put the parent update data into updates map so that revert can also access the state
- DataObjectUpdate parentUpdate = DataObjectUpdate.create(parentKeyedId, parentBefore.orNull(), parentAfter.orNull());
+ DataObjectUpdate parentUpdate =
+ DataObjectUpdate.create(parentKeyedId, parentBefore.orElse(null), parentAfter.orElse(null));
updates.put(RWUtils.makeIidWildcarded(parentKeyedId), parentUpdate);
return parentUpdate;
}
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericInitListReaderTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericInitListReaderTest.java
index b7fadda6c..27c578f2b 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericInitListReaderTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericInitListReaderTest.java
@@ -23,6 +23,7 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
@@ -32,11 +33,8 @@ import io.fd.honeycomb.translate.spi.read.Initialized;
import io.fd.honeycomb.translate.spi.read.InitializingListReaderCustomizer;
import org.junit.Test;
import org.mockito.Mock;
-import org.mockito.stubbing.Answer;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.yangtools.concepts.Builder;
public class GenericInitListReaderTest extends AbstractListReaderTest {
@@ -78,7 +76,7 @@ public class GenericInitListReaderTest extends AbstractListReaderTest {
getReader().init(broker, DATA_OBJECT_ID, ctx);
- verify(writeTx, times(2)).merge(LogicalDatastoreType.CONFIGURATION, DATA_OBJECT_ID, data, true);
+ verify(writeTx, times(2)).merge(CONFIGURATION, DATA_OBJECT_ID, data);
verify(writeTx, times(2)).commit();
}
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericIntReaderTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericIntReaderTest.java
index 1d9f5d55b..22ff3b8eb 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericIntReaderTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/GenericIntReaderTest.java
@@ -21,6 +21,7 @@ import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.Futures;
@@ -30,9 +31,8 @@ import io.fd.honeycomb.translate.spi.read.Initialized;
import io.fd.honeycomb.translate.spi.read.InitializingReaderCustomizer;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -73,7 +73,7 @@ public class GenericIntReaderTest extends AbstractReaderTest {
getReader().init(broker, DATA_OBJECT_ID, ctx);
- verify(writeTx).merge(LogicalDatastoreType.CONFIGURATION, DATA_OBJECT_ID, data, true);
+ verify(writeTx).merge(CONFIGURATION, DATA_OBJECT_ID, data);
verify(writeTx).commit();
}
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryTest.java
index 40068e02c..d98025a30 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderRegistryTest.java
@@ -28,11 +28,11 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.Reader;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InOrder;
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderTest.java
index 8d4bdadda..c2934071d 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/CompositeReaderTest.java
@@ -16,11 +16,11 @@
package io.fd.honeycomb.translate.impl.read.registry;
+import static io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryTest.mockReader;
import static io.fd.honeycomb.translate.util.DataObjects.DataObject4;
import static io.fd.honeycomb.translate.util.DataObjects.DataObject4.DataObject41;
import static io.fd.honeycomb.translate.util.DataObjects.DataObjectK;
import static io.fd.honeycomb.translate.util.DataObjects.DataObjectKey;
-import static io.fd.honeycomb.translate.impl.read.registry.CompositeReaderRegistryTest.mockReader;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
@@ -28,7 +28,6 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import io.fd.honeycomb.translate.read.ListReader;
@@ -36,6 +35,7 @@ import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.util.DataObjects;
import java.util.List;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReaderTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReaderTest.java
index a9b15ad32..735fdf7de 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReaderTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/InitSubtreeReaderTest.java
@@ -30,7 +30,7 @@ import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.DataBroker;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.ChildOf;
import org.opendaylight.yangtools.yang.binding.DataObject;
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReaderTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReaderTest.java
index d2375e6be..7c0206446 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReaderTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/read/registry/SubtreeReaderTest.java
@@ -23,11 +23,11 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import com.google.common.base.Optional;
import com.google.common.collect.Sets;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.util.DataObjects;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
@@ -48,14 +48,14 @@ public class SubtreeReaderTest {
private ReadContext ctx;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
MockitoAnnotations.initMocks(this);
Mockito.doReturn(DataObjects.DataObject4.IID).when(delegate).getManagedDataObjectType();
doReturn(DataObject1.IID).when(delegateLocal).getManagedDataObjectType();
}
@Test
- public void testCreate() throws Exception {
+ public void testCreate() {
final Reader<DataObjects.DataObject4, Builder<DataObjects.DataObject4>> subtreeR =
SubtreeReader.createForReader(Sets.newHashSet(DataObjects.DataObject4.DataObject41.IID), delegate);
@@ -76,7 +76,8 @@ public class SubtreeReaderTest {
final Reader<DataObjects.DataObject4, Builder<DataObjects.DataObject4>> subtreeR =
SubtreeReader.createForReader(Sets.newHashSet(DataObjects.DataObject4.DataObject41.IID), delegate);
- doReturn(Optional.fromNullable(mock(DataObjects.DataObject4.class))).when(delegate).read(DataObjects.DataObject4.IID, ctx);
+ doReturn(Optional.ofNullable(mock(DataObjects.DataObject4.class))).when(delegate)
+ .read(DataObjects.DataObject4.IID, ctx);
subtreeR.read(DataObjects.DataObject4.DataObject41.IID, ctx);
}
@@ -85,7 +86,7 @@ public class SubtreeReaderTest {
final Reader<DataObjects.DataObject4, Builder<DataObjects.DataObject4>> subtreeR =
SubtreeReader.createForReader(Sets.newHashSet(DataObjects.DataObject4.DataObject41.IID), delegate);
- doReturn(Optional.absent()).when(delegate).read(DataObjects.DataObject4.IID, ctx);
+ doReturn(Optional.empty()).when(delegate).read(DataObjects.DataObject4.IID, ctx);
assertFalse(subtreeR.read(DataObjects.DataObject4.DataObject41.IID, ctx).isPresent());
}
@@ -97,7 +98,7 @@ public class SubtreeReaderTest {
final DataObject1 mock = mock(DataObject1.class);
final DataObject1.DataObject11 mock11 = mock(DataObject1.DataObject11.class);
doReturn(mock11).when(mock).getDataObject11();
- doReturn(Optional.fromNullable(mock)).when(delegateLocal).read(DataObject1.IID, ctx);
+ doReturn(Optional.ofNullable(mock)).when(delegateLocal).read(DataObject1.IID, ctx);
assertEquals(mock11, subtreeR.read(DataObject1.DataObject11.IID, ctx).get());
}
@@ -109,7 +110,7 @@ public class SubtreeReaderTest {
final DataObject1 mock = mock(DataObject1.class);
final DataObject1.DataObject11 mock11 = mock(DataObject1.DataObject11.class);
doReturn(mock11).when(mock).getDataObject11();
- doReturn(Optional.fromNullable(mock)).when(delegateLocal).read(DataObject1.IID, ctx);
+ doReturn(Optional.ofNullable(mock)).when(delegateLocal).read(DataObject1.IID, ctx);
assertEquals(mock, subtreeR.read(DataObject1.IID, ctx).get());
}
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/GenericListWriterTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/GenericListWriterTest.java
index 36ab85eff..d579faad4 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/GenericListWriterTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/GenericListWriterTest.java
@@ -70,10 +70,10 @@ public class GenericListWriterTest {
final InstanceIdentifier<IdentifiableDataObject> keyedIdBefore =
(InstanceIdentifier<IdentifiableDataObject>) InstanceIdentifier.create(Collections
- .singleton(new InstanceIdentifier.IdentifiableItem<>(IdentifiableDataObject.class, beforeKey)));
+ .singleton(InstanceIdentifier.IdentifiableItem.of(IdentifiableDataObject.class, beforeKey)));
final InstanceIdentifier<IdentifiableDataObject> keyedIdAfter =
(InstanceIdentifier<IdentifiableDataObject>) InstanceIdentifier.create(Collections
- .singleton(new InstanceIdentifier.IdentifiableItem<>(IdentifiableDataObject.class, keyAfter)));
+ .singleton(InstanceIdentifier.IdentifiableItem.of(IdentifiableDataObject.class, keyAfter)));
writer.processModification(DATA_OBJECT_ID, before, after, ctx);
verify(customizer).updateCurrentAttributes(keyedIdBefore, before, after, ctx);
@@ -117,10 +117,10 @@ public class GenericListWriterTest {
final InstanceIdentifier<IdentifiableDataObject> keyedIdBefore =
(InstanceIdentifier<IdentifiableDataObject>) InstanceIdentifier.create(Collections
- .singleton(new InstanceIdentifier.IdentifiableItem<>(IdentifiableDataObject.class, beforeKey)));
+ .singleton(InstanceIdentifier.IdentifiableItem.of(IdentifiableDataObject.class, beforeKey)));
final InstanceIdentifier<IdentifiableDataObject> keyedIdAfter =
(InstanceIdentifier<IdentifiableDataObject>) InstanceIdentifier.create(Collections
- .singleton(new InstanceIdentifier.IdentifiableItem<>(IdentifiableDataObject.class, keyAfter)));
+ .singleton(InstanceIdentifier.IdentifiableItem.of(IdentifiableDataObject.class, keyAfter)));
writer.validate(DATA_OBJECT_ID, before, after, ctx);
verify(validator).validateUpdate(keyedIdBefore, before, after, ctx);
diff --git a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryTest.java b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryTest.java
index e06197fae..e89548dd9 100644
--- a/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryTest.java
+++ b/infra/translate-impl/src/test/java/io/fd/honeycomb/translate/impl/write/registry/FlatWriterRegistryTest.java
@@ -31,7 +31,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
@@ -50,6 +49,7 @@ import io.fd.honeycomb.translate.write.registry.WriterRegistry;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.junit.Before;
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
index 71bcd9def..2bd2de1ec 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RWUtils.java
@@ -101,7 +101,7 @@ public final class RWUtils {
@Nonnull
public static <D extends DataObject & Identifiable<K>, K extends Identifier<D>> InstanceIdentifier.IdentifiableItem<D, K> getCurrentIdItem(
@Nonnull final InstanceIdentifier<D> id, final K key) {
- return new InstanceIdentifier.IdentifiableItem<>(id.getTargetType(), key);
+ return InstanceIdentifier.IdentifiableItem.of(id.getTargetType(), key);
}
/**
@@ -160,7 +160,7 @@ public final class RWUtils {
*/
@SuppressWarnings("unchecked")
public static <D extends DataObject> InstanceIdentifier<D> makeIidLastWildcarded(final InstanceIdentifier<D> id) {
- final InstanceIdentifier.Item<D> wildcardedItem = new InstanceIdentifier.Item<>(id.getTargetType());
+ final InstanceIdentifier.Item<D> wildcardedItem = InstanceIdentifier.Item.of(id.getTargetType());
final Iterable<InstanceIdentifier.PathArgument> pathArguments = id.getPathArguments();
return (InstanceIdentifier<D>) InstanceIdentifier.create(
Iterables.concat(
@@ -170,7 +170,7 @@ public final class RWUtils {
private static InstanceIdentifier.PathArgument cleanPathArgumentFromKeys(final InstanceIdentifier.PathArgument pathArgument) {
return pathArgument instanceof InstanceIdentifier.IdentifiableItem<?, ?>
- ? new InstanceIdentifier.Item<>(pathArgument.getType())
+ ? InstanceIdentifier.Item.of(pathArgument.getType())
: pathArgument;
}
}
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java
index f10d312f1..09dba79da 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/RealtimeMappingContext.java
@@ -16,15 +16,14 @@
package io.fd.honeycomb.translate.util;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.MappingContext;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -38,10 +37,10 @@ public final class RealtimeMappingContext implements MappingContext {
@Override
public <T extends DataObject> Optional<T> read(@Nonnull final InstanceIdentifier<T> currentId) {
- try (ReadOnlyTransaction tx = contextBindingBrokerDependency.newReadOnlyTransaction()) {
+ try (ReadTransaction tx = contextBindingBrokerDependency.newReadOnlyTransaction()) {
try {
- return tx.read(LogicalDatastoreType.OPERATIONAL, currentId).checkedGet();
- } catch (ReadFailedException e) {
+ return tx.read(LogicalDatastoreType.OPERATIONAL, currentId).get();
+ } catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException("Unable to perform read of " + currentId, e);
}
}
@@ -52,8 +51,8 @@ public final class RealtimeMappingContext implements MappingContext {
final WriteTransaction writeTx = contextBindingBrokerDependency.newWriteOnlyTransaction();
writeTx.delete(LogicalDatastoreType.OPERATIONAL, path);
try {
- writeTx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ writeTx.commit().get();
+ } catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException("Unable to perform delete of " + path, e);
}
}
@@ -61,10 +60,10 @@ public final class RealtimeMappingContext implements MappingContext {
@Override
public <T extends DataObject> void merge(final InstanceIdentifier<T> path, final T data) {
final WriteTransaction writeTx = contextBindingBrokerDependency.newWriteOnlyTransaction();
- writeTx.merge(LogicalDatastoreType.OPERATIONAL, path, data, true);
+ writeTx.mergeParentStructureMerge(LogicalDatastoreType.OPERATIONAL, path, data);
try {
- writeTx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ writeTx.commit().get();
+ } catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException("Unable to perform merge of " + path, e);
}
}
@@ -72,10 +71,10 @@ public final class RealtimeMappingContext implements MappingContext {
@Override
public <T extends DataObject> void put(final InstanceIdentifier<T> path, final T data) {
final WriteTransaction writeTx = contextBindingBrokerDependency.newWriteOnlyTransaction();
- writeTx.put(LogicalDatastoreType.OPERATIONAL, path, data, true);
+ writeTx.mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, path, data);
try {
- writeTx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
+ writeTx.commit().get();
+ } catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException("Unable to perform put of " + path, e);
}
}
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/ReflectionUtils.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/ReflectionUtils.java
index 74c7be97c..7e1099ab7 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/ReflectionUtils.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/ReflectionUtils.java
@@ -16,9 +16,9 @@
package io.fd.honeycomb.translate.util;
-import com.google.common.base.Optional;
import java.lang.reflect.Method;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
/**
@@ -36,7 +36,7 @@ public final class ReflectionUtils {
* @param paramTypes List of input argument types
* @param retType Return type
*
- * @return Found method or Optional.absent() if there's no such method
+ * @return Found method or Optional.empty() if there's no such method
*/
@Nonnull
public static Optional<Method> findMethodReflex(@Nonnull final Class<?> managedType,
@@ -49,7 +49,7 @@ public final class ReflectionUtils {
}
}
- return Optional.absent();
+ return Optional.empty();
}
private static boolean isMethodMatch(final @Nonnull String prefix,
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/TransactionMappingContext.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/TransactionMappingContext.java
index 4d4e9fddd..33753bbca 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/TransactionMappingContext.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/TransactionMappingContext.java
@@ -16,14 +16,14 @@
package io.fd.honeycomb.translate.util;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.translate.MappingContext;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -43,9 +43,9 @@ public class TransactionMappingContext implements MappingContext {
@Override
public <T extends DataObject> Optional<T> read(@Nonnull final InstanceIdentifier<T> currentId) {
try {
- return readWriteTransaction.read(LogicalDatastoreType.OPERATIONAL, currentId).checkedGet();
- } catch (ReadFailedException e) {
- throw new IllegalStateException("Unable to perform read", e);
+ return readWriteTransaction.read(LogicalDatastoreType.OPERATIONAL, currentId).get();
+ } catch (InterruptedException | ExecutionException ex) {
+ throw new IllegalStateException("Unable to perform read", ex);
}
}
@@ -64,8 +64,8 @@ public class TransactionMappingContext implements MappingContext {
readWriteTransaction.put(LogicalDatastoreType.OPERATIONAL, path, data, true);
}
- public CheckedFuture<Void, TransactionCommitFailedException> submit() {
- return readWriteTransaction.submit();
+ public FluentFuture<? extends CommitInfo> commit() {
+ return readWriteTransaction.commit();
}
@Override
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java
index b19b72ecf..897174e1f 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/AbstractGenericReader.java
@@ -19,11 +19,11 @@ package io.fd.honeycomb.translate.util.read;
import static com.google.common.base.Preconditions.checkArgument;
import com.google.common.annotations.Beta;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.read.ReadContext;
+import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.util.RWUtils;
-import io.fd.honeycomb.translate.read.ReadFailedException;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
@@ -64,7 +64,7 @@ public abstract class AbstractGenericReader<D extends DataObject, B extends Buil
final D built = builder.build();
final Optional<D> read = isPresent(id, built, ctx)
? Optional.of(built)
- : Optional.absent();
+ : Optional.empty();
LOG.debug("{}: Current node read successfully. Result: {}", this, read);
return read;
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/BindingBrokerReader.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/BindingBrokerReader.java
index e59e642c4..843175878 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/BindingBrokerReader.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/BindingBrokerReader.java
@@ -16,15 +16,16 @@
package io.fd.honeycomb.translate.util.read;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.translate.read.ReadContext;
-import io.fd.honeycomb.translate.read.Reader;
import io.fd.honeycomb.translate.read.ReadFailedException;
+import io.fd.honeycomb.translate.read.Reader;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -59,13 +60,13 @@ public final class BindingBrokerReader<D extends DataObject, B extends Builder<D
@Override
public Optional<? extends DataObject> read(@Nonnull final InstanceIdentifier<? extends DataObject> id,
@Nonnull final ReadContext ctx) throws ReadFailedException {
- try (final ReadOnlyTransaction readOnlyTransaction = dataBroker.newReadOnlyTransaction()) {
- final CheckedFuture<? extends Optional<? extends DataObject>, org.opendaylight.controller.md.sal.common.api.data.ReadFailedException>
+ try (final ReadTransaction readOnlyTransaction = dataBroker.newReadOnlyTransaction()) {
+ final FluentFuture<? extends Optional<? extends DataObject>>
read = readOnlyTransaction.read(datastoreType, id);
try {
- return read.checkedGet();
- } catch (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException e) {
- throw new ReadFailedException(id, e);
+ return read.get();
+ } catch (InterruptedException | ExecutionException ex) {
+ throw new ReadFailedException(id, ex);
}
}
}
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/DelegatingReader.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/DelegatingReader.java
index 5e2e7062e..8d3eb4cbc 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/DelegatingReader.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/DelegatingReader.java
@@ -16,12 +16,12 @@
package io.fd.honeycomb.translate.util.read;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.read.ListReader;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.read.Reader;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/KeepaliveReaderWrapper.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/KeepaliveReaderWrapper.java
index b4d8be495..249fca642 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/KeepaliveReaderWrapper.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/KeepaliveReaderWrapper.java
@@ -16,13 +16,13 @@
package io.fd.honeycomb.translate.util.read;
-import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.Reader;
import java.io.Closeable;
+import java.util.Optional;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
@@ -110,7 +110,7 @@ public final class KeepaliveReaderWrapper<D extends DataObject, B extends Builde
private static final class NoopMappingContext implements MappingContext {
@Override
public <T extends DataObject> Optional<T> read(@Nonnull final InstanceIdentifier<T> currentId) {
- return Optional.absent();
+ return Optional.empty();
}
@Override
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizer.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizer.java
index daf6f3566..7ad04399f 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizer.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizer.java
@@ -20,7 +20,6 @@ import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.read.ReadContext;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.spi.read.ListReaderCustomizer;
@@ -29,6 +28,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.List;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.DataObject;
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveReaderCustomizer.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveReaderCustomizer.java
index 087873306..a70ccef53 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveReaderCustomizer.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/ReflexiveReaderCustomizer.java
@@ -18,12 +18,12 @@ package io.fd.honeycomb.translate.util.read;
import static com.google.common.base.Preconditions.checkArgument;
-import com.google.common.base.Optional;
import com.google.common.collect.Lists;
import io.fd.honeycomb.translate.util.ReflectionUtils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManager.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManager.java
index a0856793d..a9e958240 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManager.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManager.java
@@ -20,10 +20,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.nonNull;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.read.ReadFailedException;
import io.fd.honeycomb.translate.util.read.cache.noop.NoopDumpPostProcessingFunction;
+import java.util.Optional;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
@@ -59,7 +59,7 @@ public final class DumpCacheManager<T, U> {
* @param cache modification cache of current transaction
* @throws ReadFailedException if execution of dumping request failed
* @returns If present in cache ,returns cached instance, if not, tries to dump data using provided executor,
- * otherwise Optional.absent()
+ * otherwise Optional.empty()
*/
public Optional<T> getDump(@Nonnull final InstanceIdentifier<?> identifier,
@Nonnull final ModificationCache cache)
@@ -75,7 +75,7 @@ public final class DumpCacheManager<T, U> {
* @param dumpParams parameters to configure dump request
* @throws ReadFailedException if execution of dumping request failed
* @returns If present in cache ,returns cached instance, if not, tries to dump data using provided executor,
- * otherwise Optional.absent()
+ * otherwise Optional.empty()
*/
public Optional<T> getDump(@Nonnull final InstanceIdentifier<?> identifier,
@Nonnull final ModificationCache cache, final U dumpParams)
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriter.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriter.java
index 60a81a77a..22e30bd9e 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriter.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriter.java
@@ -16,20 +16,20 @@
package io.fd.honeycomb.translate.util.write;
-import com.google.common.util.concurrent.CheckedFuture;
+import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
+
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.translate.write.WriteContext;
import io.fd.honeycomb.translate.write.WriteFailedException;
import io.fd.honeycomb.translate.write.Writer;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.yangtools.yang.binding.DataObject;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
-
-import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
/**
* Simple DataBroker backed writer allowing to delegate writes to different brokers.
@@ -55,11 +55,11 @@ public final class BindingBrokerWriter<D extends DataObject> implements Writer<D
@Nonnull final WriteContext ctx) throws WriteFailedException {
final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
writeTransaction.put(CONFIGURATION, (InstanceIdentifier<DataObject>) id, dataAfter);
- final CheckedFuture<Void, TransactionCommitFailedException> result = writeTransaction.submit();
+ final FluentFuture<? extends CommitInfo> result = writeTransaction.commit();
try {
- result.checkedGet();
- } catch (TransactionCommitFailedException e) {
- throw new WriteFailedException(id, e);
+ result.get();
+ } catch (InterruptedException | ExecutionException ex) {
+ throw new WriteFailedException(id, ex);
}
}
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/LegacyBindingBrokerWriter.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/LegacyBindingBrokerWriter.java
new file mode 100644
index 000000000..f6c2f0ffa
--- /dev/null
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/LegacyBindingBrokerWriter.java
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2019 Cisco and/or its affiliates.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package io.fd.honeycomb.translate.util.write;
+
+import static org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType.CONFIGURATION;
+
+import com.google.common.util.concurrent.FluentFuture;
+import io.fd.honeycomb.translate.write.WriteContext;
+import io.fd.honeycomb.translate.write.WriteFailedException;
+import io.fd.honeycomb.translate.write.Writer;
+import java.util.concurrent.ExecutionException;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.yangtools.yang.binding.DataObject;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+/**
+ * Simple DataBroker backed writer allowing to delegate writes to different brokers.
+ */
+public final class LegacyBindingBrokerWriter<D extends DataObject> implements Writer<D> {
+ private final InstanceIdentifier<D> instanceIdentifier;
+ private final DataBroker dataBroker;
+
+ public LegacyBindingBrokerWriter(final InstanceIdentifier<D> instanceIdentifier, final DataBroker dataBroker) {
+ this.instanceIdentifier = instanceIdentifier;
+ this.dataBroker = dataBroker;
+ }
+
+ @Nonnull
+ @Override
+ public InstanceIdentifier<D> getManagedDataObjectType() {
+ return instanceIdentifier;
+ }
+
+ @Override
+ public void processModification(@Nonnull final InstanceIdentifier<? extends DataObject> id,
+ @Nullable final DataObject dataBefore, @Nullable final DataObject dataAfter,
+ @Nonnull final WriteContext ctx) throws WriteFailedException {
+ final WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction();
+ writeTransaction.put(CONFIGURATION, (InstanceIdentifier<DataObject>) id, dataAfter);
+ final FluentFuture<? extends CommitInfo> result = writeTransaction.commit();
+ try {
+ result.get();
+ } catch (InterruptedException | ExecutionException ex) {
+ throw new WriteFailedException(id, ex);
+ }
+ }
+
+ @Override
+ public boolean supportsDirectUpdate() {
+ return false;
+ }
+}
diff --git a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/TransactionWriteContext.java b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/TransactionWriteContext.java
index e853d8632..d97b5b715 100644
--- a/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/TransactionWriteContext.java
+++ b/infra/translate-utils/src/main/java/io/fd/honeycomb/translate/util/write/TransactionWriteContext.java
@@ -18,17 +18,17 @@ package io.fd.honeycomb.translate.util.write;
import static com.google.common.base.Preconditions.checkState;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.write.WriteContext;
import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ExecutionException;
import javax.annotation.Nonnull;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -39,15 +39,15 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
*/
public final class TransactionWriteContext implements WriteContext {
- private final DOMDataReadOnlyTransaction beforeTx;
- private final DOMDataReadOnlyTransaction afterTx;
+ private final DOMDataTreeReadTransaction beforeTx;
+ private final DOMDataTreeReadTransaction afterTx;
private final ModificationCache ctx;
private final BindingNormalizedNodeSerializer serializer;
private final MappingContext mappingContext;
public TransactionWriteContext(final BindingNormalizedNodeSerializer serializer,
- final DOMDataReadOnlyTransaction beforeTx,
- final DOMDataReadOnlyTransaction afterTx,
+ final DOMDataTreeReadTransaction beforeTx,
+ final DOMDataTreeReadTransaction afterTx,
final MappingContext mappingContext) {
this.serializer = serializer;
this.beforeTx = beforeTx;
@@ -70,18 +70,17 @@ public final class TransactionWriteContext implements WriteContext {
private <T extends DataObject> Optional<T> read(final InstanceIdentifier<T> currentId,
- final DOMDataReadOnlyTransaction tx) {
+ final DOMDataTreeReadTransaction tx) {
final YangInstanceIdentifier path = serializer.toYangInstanceIdentifier(currentId);
- final CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read =
- tx.read(LogicalDatastoreType.CONFIGURATION, path);
+ final FluentFuture<Optional<NormalizedNode<?, ?>>> read = tx.read(LogicalDatastoreType.CONFIGURATION, path);
try {
// TODO HONEYCOMB-169 once the APIs are asynchronous use just Futures.transform
- final Optional<NormalizedNode<?, ?>> optional = read.checkedGet();
+ final Optional<NormalizedNode<?, ?>> optional = read.get();
if (!optional.isPresent()) {
- return Optional.absent();
+ return Optional.empty();
}
final NormalizedNode<?, ?> data = optional.get();
@@ -91,7 +90,7 @@ public final class TransactionWriteContext implements WriteContext {
checkState(targetType.isAssignableFrom(entry.getValue().getClass()),
"Unexpected data object type, should be: %s, but was: %s", targetType, entry.getValue().getClass());
return Optional.of(targetType.cast(entry.getValue()));
- } catch (ReadFailedException e) {
+ } catch (InterruptedException | ExecutionException e) {
throw new IllegalStateException("Unable to perform read", e);
}
}
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/impl/write/util/TransactionWriteContextTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/impl/write/util/TransactionWriteContextTest.java
index cbf509827..f74a0a41a 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/impl/write/util/TransactionWriteContextTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/impl/write/util/TransactionWriteContextTest.java
@@ -27,20 +27,20 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.translate.MappingContext;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.util.DataObjects;
import io.fd.honeycomb.translate.util.write.TransactionWriteContext;
import java.util.Map;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
@@ -51,9 +51,9 @@ public class TransactionWriteContextTest {
@Mock
private BindingNormalizedNodeSerializer serializer;
@Mock
- private DOMDataReadOnlyTransaction beforeTx;
+ private DOMDataTreeReadTransaction beforeTx;
@Mock
- private DOMDataReadOnlyTransaction afterTx;
+ private DOMDataTreeReadTransaction afterTx;
@Mock
private Map.Entry entry;
@Mock
@@ -73,7 +73,7 @@ public class TransactionWriteContextTest {
@Test
public void testReadBeforeNoData() throws Exception {
when(beforeTx.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(
- Futures.immediateCheckedFuture(Optional.absent()));
+ FluentFutures.immediateFluentFuture(Optional.empty()));
final InstanceIdentifier<DataObjects.DataObject1> instanceId =
InstanceIdentifier.create(DataObjects.DataObject1.class);
@@ -89,7 +89,7 @@ public class TransactionWriteContextTest {
@Test
public void testReadBefore() throws Exception {
when(beforeTx.read(eq(LogicalDatastoreType.CONFIGURATION), any(YangInstanceIdentifier.class))).thenReturn(
- Futures.immediateCheckedFuture(Optional.of(mock(NormalizedNode.class))));
+ FluentFutures.immediateFluentFuture(Optional.of(mock(NormalizedNode.class))));
final InstanceIdentifier<DataObjects.DataObject1> instanceId =
InstanceIdentifier.create(DataObjects.DataObject1.class);
@@ -107,14 +107,14 @@ public class TransactionWriteContextTest {
@Test(expected = IllegalStateException.class)
public void testReadBeforeFailed() throws Exception {
when(beforeTx.read(LogicalDatastoreType.CONFIGURATION, yangId)).thenReturn(
- Futures.immediateFailedCheckedFuture(mock(ReadFailedException.class)));
+ FluentFutures.immediateFailedFluentFuture(mock(ReadFailedException.class)));
transactionWriteContext.readBefore(mock(InstanceIdentifier.class));
}
@Test(expected = IllegalStateException.class)
public void testReadAfterFailed() throws Exception {
when(afterTx.read(LogicalDatastoreType.CONFIGURATION, yangId)).thenReturn(
- Futures.immediateFailedCheckedFuture(mock(ReadFailedException.class)));
+ FluentFutures.immediateFailedFluentFuture(mock(ReadFailedException.class)));
transactionWriteContext.readAfter(mock(InstanceIdentifier.class));
}
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/RealtimeMappingContextTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/RealtimeMappingContextTest.java
index d6da2f368..d922d1454 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/RealtimeMappingContextTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/RealtimeMappingContextTest.java
@@ -21,19 +21,18 @@ import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.FluentFuture;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -44,7 +43,7 @@ public class RealtimeMappingContextTest {
private RealtimeMappingContext ctx;
private InstanceIdentifier<DataObject> id = InstanceIdentifier.create(DataObject.class);
@Mock
- private ReadOnlyTransaction readTx;
+ private ReadTransaction readTx;
@Mock
private WriteTransaction writeTx;
@Mock
@@ -58,59 +57,60 @@ public class RealtimeMappingContextTest {
when(broker.newReadOnlyTransaction()).thenReturn(readTx);
when(broker.newWriteOnlyTransaction()).thenReturn(writeTx);
- when(writeTx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(writeTx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
}
@Test
- public void testRead() throws Exception {
- final CheckedFuture<Optional<DataObject>, ReadFailedException> futureData =
- Futures.immediateCheckedFuture(Optional.of((data)));
+ public void testRead() {
+ final FluentFuture<Optional<DataObject>> futureData =
+ FluentFutures.immediateFluentFuture(Optional.of((data)));
when(readTx.read(LogicalDatastoreType.OPERATIONAL, id)).thenReturn(futureData);
assertSame(ctx.read(id).get(), data);
verify(broker).newReadOnlyTransaction();
verify(readTx).read(LogicalDatastoreType.OPERATIONAL, id);
- when(readTx.read(LogicalDatastoreType.OPERATIONAL, id)).thenReturn(Futures.immediateCheckedFuture(Optional.absent()));
+ when(readTx.read(LogicalDatastoreType.OPERATIONAL, id))
+ .thenReturn(FluentFutures.immediateFluentFuture(Optional.empty()));
assertFalse(ctx.read(id).isPresent());
}
@Test
- public void testMerge() throws Exception {
+ public void testMerge() {
ctx.merge(id, data);
verify(broker).newWriteOnlyTransaction();
- verify(writeTx).merge(LogicalDatastoreType.OPERATIONAL, id, data, true);
+ verify(writeTx).mergeParentStructureMerge(LogicalDatastoreType.OPERATIONAL, id, data);
}
@Test(expected = IllegalStateException.class)
public void testMergeFailure() throws Exception {
- when(writeTx.submit()).thenReturn(Futures.immediateFailedCheckedFuture(ex));
+ when(writeTx.commit()).thenReturn(FluentFutures.immediateFailedFluentFuture(ex));
ctx.merge(id, data);
}
@Test
- public void testPut() throws Exception {
+ public void testPut() {
ctx.put(id, data);
verify(broker).newWriteOnlyTransaction();
- verify(writeTx).put(LogicalDatastoreType.OPERATIONAL, id, data, true);
+ verify(writeTx).mergeParentStructurePut(LogicalDatastoreType.OPERATIONAL, id, data);
}
@Test(expected = IllegalStateException.class)
- public void testPutFailure() throws Exception {
- when(writeTx.submit()).thenReturn(Futures.immediateFailedCheckedFuture(ex));
+ public void testPutFailure() {
+ when(writeTx.commit()).thenReturn(FluentFutures.immediateFailedFluentFuture(ex));
ctx.put(id, data);
}
@Test
- public void testDelete() throws Exception {
+ public void testDelete() {
ctx.delete(id);
verify(broker).newWriteOnlyTransaction();
verify(writeTx).delete(LogicalDatastoreType.OPERATIONAL, id);
}
@Test(expected = IllegalStateException.class)
- public void testDeleteFailure() throws Exception {
- when(writeTx.submit()).thenReturn(Futures.immediateFailedCheckedFuture(ex));
+ public void testDeleteFailure() {
+ when(writeTx.commit()).thenReturn(FluentFutures.immediateFailedFluentFuture(ex));
ctx.delete(id);
}
} \ No newline at end of file
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/TransactionMappingContextTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/TransactionMappingContextTest.java
index 2dcee889a..a9747d0af 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/TransactionMappingContextTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/TransactionMappingContextTest.java
@@ -21,16 +21,16 @@ import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.FluentFuture;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.binding.api.ReadWriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -49,27 +49,27 @@ public class TransactionMappingContextTest {
MockitoAnnotations.initMocks(this);
ctx = new TransactionMappingContext(writeTx);
- when(writeTx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(writeTx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
}
@Test
public void testRead() throws Exception {
- final CheckedFuture<Optional<DataObject>, ReadFailedException> futureData =
- Futures.immediateCheckedFuture(Optional.of((data)));
+ final FluentFuture<Optional<DataObject>> futureData = FluentFutures.immediateFluentFuture(Optional.of((data)));
when(writeTx.read(LogicalDatastoreType.OPERATIONAL, id)).thenReturn(futureData);
assertSame(ctx.read(id).get(), data);
verify(writeTx).read(LogicalDatastoreType.OPERATIONAL, id);
- when(writeTx.read(LogicalDatastoreType.OPERATIONAL, id)).thenReturn(Futures.immediateCheckedFuture(Optional.absent()));
+ when(writeTx.read(LogicalDatastoreType.OPERATIONAL, id))
+ .thenReturn(FluentFutures.immediateFluentFuture(Optional.empty()));
assertFalse(ctx.read(id).isPresent());
}
@Test(expected = IllegalStateException.class)
public void testReadFailure() throws Exception {
- final CheckedFuture<Optional<DataObject>, ReadFailedException> futureData =
- Futures.immediateFailedCheckedFuture(ex);
+ final FluentFuture<Optional<DataObject>> futureData =
+ FluentFutures.immediateFailedFluentFuture(ex);
when(writeTx.read(LogicalDatastoreType.OPERATIONAL, id)).thenReturn(futureData);
assertSame(ctx.read(id).get(), data);
}
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/BindingBrokerReaderTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/BindingBrokerReaderTest.java
index b6af72125..18ba1bd6a 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/BindingBrokerReaderTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/BindingBrokerReaderTest.java
@@ -23,18 +23,18 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.translate.read.ReadContext;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.ReadTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
import org.opendaylight.yangtools.concepts.Builder;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -46,7 +46,7 @@ public class BindingBrokerReaderTest {
@Mock
private ReadContext ctx;
@Mock
- private ReadOnlyTransaction tx;
+ private ReadTransaction tx;
@Mock
private DataObject data;
private BindingBrokerReader<DataObject, DataObjectBuilder> bbReader;
@@ -55,7 +55,8 @@ public class BindingBrokerReaderTest {
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(broker.newReadOnlyTransaction()).thenReturn(tx);
- when(tx.read(LogicalDatastoreType.CONFIGURATION, id)).thenReturn(Futures.immediateCheckedFuture(Optional.of(data)));
+ when(tx.read(LogicalDatastoreType.CONFIGURATION, id))
+ .thenReturn(FluentFutures.immediateFluentFuture(Optional.of(data)));
bbReader = new BindingBrokerReader<>(id, broker, LogicalDatastoreType.CONFIGURATION, DataObjectBuilder.class);
}
@@ -72,7 +73,7 @@ public class BindingBrokerReaderTest {
@Test(expected = io.fd.honeycomb.translate.read.ReadFailedException.class)
public void testFailedRead() throws Exception {
when(tx.read(LogicalDatastoreType.CONFIGURATION, id))
- .thenReturn(Futures.immediateFailedCheckedFuture(new ReadFailedException("failing")));
+ .thenReturn(FluentFutures.immediateFailedFluentFuture(new ReadFailedException("failing")));
bbReader.read(id, ctx);
}
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizerTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizerTest.java
index aa1d0f925..d884176f6 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizerTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/ReflexiveListReaderCustomizerTest.java
@@ -59,7 +59,7 @@ public class ReflexiveListReaderCustomizerTest {
final TestingListObjectBuilder builder = new TestingListObjectBuilder();
final InstanceIdentifier<TestingListObject> id =
(InstanceIdentifier<TestingListObject>) InstanceIdentifier.create(
- Collections.singletonList(new InstanceIdentifier.IdentifiableItem<>(TestingListObject.class, keyOne)));
+ Collections.singletonList(InstanceIdentifier.IdentifiableItem.of(TestingListObject.class, keyOne)));
customizer.readCurrentAttributes(id, builder, readContext);
assertEquals(keyOne, builder.getKey());
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java
index 5f9362458..e52583d2b 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/read/cache/DumpCacheManagerTest.java
@@ -21,12 +21,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
-import com.google.common.base.Optional;
import io.fd.honeycomb.translate.ModificationCache;
import io.fd.honeycomb.translate.read.ReadFailedException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
+import java.util.Optional;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
diff --git a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriterTest.java b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriterTest.java
index 9e09112c9..49b76ce95 100644
--- a/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriterTest.java
+++ b/infra/translate-utils/src/test/java/io/fd/honeycomb/translate/util/write/BindingBrokerWriterTest.java
@@ -20,16 +20,15 @@ import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import com.google.common.util.concurrent.Futures;
import io.fd.honeycomb.translate.write.WriteContext;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.yangtools.util.concurrent.FluentFutures;
import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
@@ -50,7 +49,7 @@ public class BindingBrokerWriterTest {
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
when(broker.newWriteOnlyTransaction()).thenReturn(tx);
- when(tx.submit()).thenReturn(Futures.immediateCheckedFuture(null));
+ when(tx.commit()).thenReturn(FluentFutures.immediateNullFluentFuture());
bbWriter = new BindingBrokerWriter<>(id, broker);
}
@@ -61,12 +60,12 @@ public class BindingBrokerWriterTest {
bbWriter.processModification(id, data, data, ctx);
verify(broker).newWriteOnlyTransaction();
verify(tx).put(LogicalDatastoreType.CONFIGURATION, id, data);
- verify(tx).submit();
+ verify(tx).commit();
}
@Test(expected = io.fd.honeycomb.translate.write.WriteFailedException.class)
public void testFailedWrite() throws Exception {
- when(tx.submit()).thenReturn(Futures.immediateFailedCheckedFuture(new TransactionCommitFailedException("failing")));
+ when(tx.commit()).thenReturn(FluentFutures.immediateFailedFluentFuture(new InterruptedException("failing")));
bbWriter.processModification(id, data, data, ctx);
}
} \ No newline at end of file