From 53d651f4b800c40205b7594c195556eda8fd7bf6 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sun, 21 Sep 2025 00:09:17 +0200 Subject: [PATCH 1/3] Bump upstreams Adopt: - odlparent-14.1.3 - infrautils-7.1.7 - yangtools-14.0.17 - mdsal-14.0.18 - controller-11.0.2 - netconf-9.0.1 Change-Id: Ifce5203fa1705ec1a48e65088373a948027e8642 Signed-off-by: Robert Varga --- commons/binding-parent/pom.xml | 6 +++--- commons/it/pom.xml | 4 ++-- commons/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound-api/pom.xml | 4 ++-- .../odl-ovsdb-hwvtepsouthbound-rest/pom.xml | 4 ++-- .../odl-ovsdb-hwvtepsouthbound-test/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound-ui/pom.xml | 4 ++-- .../odl-ovsdb-hwvtepsouthbound/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-features/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml | 2 +- hwvtepsouthbound/pom.xml | 2 +- library/artifacts/pom.xml | 2 +- library/features/features/pom.xml | 2 +- library/features/odl-ovsdb-library/pom.xml | 4 ++-- library/features/pom.xml | 2 +- library/karaf/pom.xml | 2 +- library/pom.xml | 2 +- pom.xml | 2 +- schemas/pom.xml | 2 +- southbound/pom.xml | 2 +- southbound/southbound-artifacts/pom.xml | 2 +- southbound/southbound-features/features/pom.xml | 2 +- .../southbound-features/odl-ovsdb-southbound-api/pom.xml | 4 ++-- .../odl-ovsdb-southbound-impl-rest/pom.xml | 4 ++-- .../odl-ovsdb-southbound-impl-ui/pom.xml | 4 ++-- .../southbound-features/odl-ovsdb-southbound-impl/pom.xml | 4 ++-- .../southbound-features/odl-ovsdb-southbound-test/pom.xml | 2 +- southbound/southbound-features/pom.xml | 2 +- southbound/southbound-karaf/pom.xml | 2 +- utils/odl-ovsdb-utils/pom.xml | 4 ++-- utils/pom.xml | 2 +- 33 files changed, 45 insertions(+), 45 deletions(-) diff --git a/commons/binding-parent/pom.xml b/commons/binding-parent/pom.xml index 643083776..dd7de44f9 100644 --- a/commons/binding-parent/pom.xml +++ b/commons/binding-parent/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.mdsal binding-parent - 14.0.13 + 14.0.18 @@ -25,14 +25,14 @@ org.opendaylight.aaa aaa-artifacts - 0.21.0 + 0.21.2 pom import org.opendaylight.infrautils infrautils-artifacts - 7.1.4 + 7.1.7 pom import diff --git a/commons/it/pom.xml b/commons/it/pom.xml index c8df0b052..ceb066a2a 100644 --- a/commons/it/pom.xml +++ b/commons/it/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.controller mdsal-it-parent - 11.0.0 + 11.0.2 @@ -70,7 +70,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.mdsal mdsal-artifacts - 14.0.13 + 14.0.18 pom import diff --git a/commons/pom.xml b/commons/pom.xml index f75ff5877..34aca8ab6 100644 --- a/commons/pom.xml +++ b/commons/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml index be8a2a146..25f0582fd 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml @@ -13,7 +13,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml index 31ac11db0..426563d22 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent feature-repo-parent - 14.1.0 + 14.1.3 diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml index ccc236e1c..71a779a41 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml @@ -5,7 +5,7 @@ org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -22,7 +22,7 @@ org.opendaylight.mdsal mdsal-artifacts - 14.0.13 + 14.0.18 pom import diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml index 77f51da7f..0d9d6671d 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -30,7 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.netconf netconf-artifacts - 9.0.0 + 9.0.1 import pom diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-test/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-test/pom.xml index 62fd18a0c..69d059fc0 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-test/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-test/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-ui/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-ui/pom.xml index 91adebfac..ea6497757 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-ui/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-ui/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -30,7 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.netconf netconf-artifacts - 9.0.0 + 9.0.1 import pom diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound/pom.xml index d5368aa76..02d816eb8 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/pom.xml index f10ba7a6b..6c6e8edf4 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 org.opendaylight.ovsdb diff --git a/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml index 950cd29f4..4bf06b5d3 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml @@ -9,7 +9,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent karaf4-parent - 14.1.0 + 14.1.3 4.0.0 diff --git a/hwvtepsouthbound/pom.xml b/hwvtepsouthbound/pom.xml index 7271069dd..fee019496 100644 --- a/hwvtepsouthbound/pom.xml +++ b/hwvtepsouthbound/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/library/artifacts/pom.xml b/library/artifacts/pom.xml index e76a59b84..64e07e28c 100644 --- a/library/artifacts/pom.xml +++ b/library/artifacts/pom.xml @@ -13,7 +13,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/library/features/features/pom.xml b/library/features/features/pom.xml index 8b96b6df4..20d932c07 100644 --- a/library/features/features/pom.xml +++ b/library/features/features/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent feature-repo-parent - 14.1.0 + 14.1.3 diff --git a/library/features/odl-ovsdb-library/pom.xml b/library/features/odl-ovsdb-library/pom.xml index f57d5bcc3..1027f9a8b 100644 --- a/library/features/odl-ovsdb-library/pom.xml +++ b/library/features/odl-ovsdb-library/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -41,7 +41,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.aaa odl-aaa-cert - 0.21.0 + 0.21.2 xml features diff --git a/library/features/pom.xml b/library/features/pom.xml index 9f75ce5ec..c973cbd4c 100644 --- a/library/features/pom.xml +++ b/library/features/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 org.opendaylight.ovsdb diff --git a/library/karaf/pom.xml b/library/karaf/pom.xml index 169cab73c..03c0b083d 100644 --- a/library/karaf/pom.xml +++ b/library/karaf/pom.xml @@ -9,7 +9,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent karaf4-parent - 14.1.0 + 14.1.3 4.0.0 diff --git a/library/pom.xml b/library/pom.xml index 86bd4edd4..65d6b9447 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/pom.xml b/pom.xml index 4ebe4e165..2046edd1e 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/schemas/pom.xml b/schemas/pom.xml index 8d5094a6d..a7adddaed 100644 --- a/schemas/pom.xml +++ b/schemas/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/southbound/pom.xml b/southbound/pom.xml index 58ffd9e75..96bbc80bd 100644 --- a/southbound/pom.xml +++ b/southbound/pom.xml @@ -10,7 +10,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/southbound/southbound-artifacts/pom.xml b/southbound/southbound-artifacts/pom.xml index 4cccc385a..de7846880 100644 --- a/southbound/southbound-artifacts/pom.xml +++ b/southbound/southbound-artifacts/pom.xml @@ -13,7 +13,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/southbound/southbound-features/features/pom.xml b/southbound/southbound-features/features/pom.xml index 378f66129..ed1fa02aa 100644 --- a/southbound/southbound-features/features/pom.xml +++ b/southbound/southbound-features/features/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent feature-repo-parent - 14.1.0 + 14.1.3 diff --git a/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml index 89e77c169..80ef48e2b 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -29,7 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.mdsal mdsal-artifacts - 14.0.13 + 14.0.18 pom import diff --git a/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml index d3c8e959a..65e1f06de 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -30,7 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.netconf netconf-artifacts - 9.0.0 + 9.0.1 import pom diff --git a/southbound/southbound-features/odl-ovsdb-southbound-impl-ui/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-impl-ui/pom.xml index 65410171a..dc7292d0c 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-impl-ui/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-impl-ui/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -30,7 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.netconf netconf-artifacts - 9.0.0 + 9.0.1 import pom diff --git a/southbound/southbound-features/odl-ovsdb-southbound-impl/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-impl/pom.xml index b5ec38bb7..b6592466b 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-impl/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-impl/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -30,7 +30,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.infrautils infrautils-artifacts - 7.1.4 + 7.1.7 pom import diff --git a/southbound/southbound-features/odl-ovsdb-southbound-test/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-test/pom.xml index 3b2c46274..72a7efe0d 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-test/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-test/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 diff --git a/southbound/southbound-features/pom.xml b/southbound/southbound-features/pom.xml index bc9fa5fba..e3e87b128 100644 --- a/southbound/southbound-features/pom.xml +++ b/southbound/southbound-features/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 diff --git a/southbound/southbound-karaf/pom.xml b/southbound/southbound-karaf/pom.xml index 48d733f8a..13c258d30 100644 --- a/southbound/southbound-karaf/pom.xml +++ b/southbound/southbound-karaf/pom.xml @@ -9,7 +9,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.odlparent karaf4-parent - 14.1.0 + 14.1.3 4.0.0 diff --git a/utils/odl-ovsdb-utils/pom.xml b/utils/odl-ovsdb-utils/pom.xml index e015cc817..dd14da4b6 100644 --- a/utils/odl-ovsdb-utils/pom.xml +++ b/utils/odl-ovsdb-utils/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent single-feature-parent - 14.1.0 + 14.1.3 @@ -29,7 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.controller controller-artifacts - 11.0.0 + 11.0.2 pom import diff --git a/utils/pom.xml b/utils/pom.xml index 4c076084b..775a7eb8d 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.odlparent odlparent-lite - 14.1.0 + 14.1.3 -- 2.34.1 From bba0f0f67186748d04a4d27a85e81118f88619ad Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sun, 24 Aug 2025 10:33:56 +0200 Subject: [PATCH 2/3] WIP: Mass-migrate away from InstanceIdentifier // FIXME: more stuff Change-Id: Idb223c5fd72faae1d94606eaa8965249ec47a90c Signed-off-by: Robert Varga --- .../HwvtepConnectionInstance.java | 9 +- .../HwvtepConnectionManager.java | 32 +-- .../hwvtepsouthbound/HwvtepDeviceInfo.java | 2 +- .../HwvtepOperGlobalListener.java | 53 ++-- .../HwvtepSouthboundMapper.java | 135 +++++------ .../HwvtepSouthboundProvider.java | 13 +- .../HwvtepSouthboundProviderInfo.java | 8 +- .../transact/AbstractTransactCommand.java | 4 +- .../transact/HwvtepOperationalState.java | 16 +- .../transact/TransactUtils.java | 13 +- .../md/HwvtepGlobalRemoveCommand.java | 6 +- .../md/HwvtepLogicalRouterRemoveCommand.java | 17 +- .../md/HwvtepMcastMacsLocalUpdateCommand.java | 21 +- .../DataChangeListenerTestBase.java | 28 ++- .../ovsdb/hwvtepsouthbound/TestBuilders.java | 33 ++- .../ovsdb/southbound/SouthboundMapper.java | 50 ++-- .../BridgeConfigReconciliationTask.java | 27 +-- .../md/OvsdbManagersRemovedCommand.java | 25 +- .../md/OvsdbPortUpdateCommand.java | 28 ++- .../OvsdbDataTreeChangeListenerTest.java | 6 +- .../md/OvsdbManagersRemovedCommandTest.java | 14 +- .../ovsdb/southbound/it/SouthboundIT.java | 226 +++++++++--------- utils/mdsal-utils/pom.xml | 2 - .../ovsdb/utils/mdsal/utils/MdsalUtils.java | 34 ++- .../utils/mdsal/utils/MdsalUtilsTest.java | 72 +++--- .../ovsdb/utils/ovsdb/it/utils/DockerOvs.java | 2 +- .../ovsdb/utils/ovsdb/it/utils/NodeInfo.java | 10 +- utils/southbound-utils/pom.xml | 2 - .../southbound/utils/SouthboundUtils.java | 136 +++++------ 29 files changed, 506 insertions(+), 518 deletions(-) diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java index ba694437e..449430fb5 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionInstance.java @@ -58,6 +58,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hw import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; @@ -68,7 +69,7 @@ public class HwvtepConnectionInstance { private ConnectionInfo connectionInfo; private final OvsdbClient client; private final HwvtepTableReader hwvtepTableReader; - private InstanceIdentifier instanceIdentifier; + private DataObjectIdentifier instanceIdentifier; private final TransactionInvoker txInvoker; private Map transactInvokers; private MonitorCallBack callback; @@ -91,7 +92,7 @@ public class HwvtepConnectionInstance { private TransactionHistory deviceUpdateHistory; HwvtepConnectionInstance(final HwvtepConnectionManager hwvtepConnectionManager, final ConnectionInfo key, - final OvsdbClient client, final InstanceIdentifier iid, final TransactionInvoker txInvoker, + final OvsdbClient client, final DataObjectIdentifier iid, final TransactionInvoker txInvoker, final DataBroker dataBroker, final Operations ops) { this.hwvtepConnectionManager = hwvtepConnectionManager; this.connectionInfo = key; @@ -304,7 +305,7 @@ public class HwvtepConnectionInstance { this.connectionInfo = key; } - public InstanceIdentifier getInstanceIdentifier() { + public DataObjectIdentifier getInstanceIdentifier() { return instanceIdentifier; } @@ -317,7 +318,7 @@ public class HwvtepConnectionInstance { return getNodeKey().getNodeId(); } - public void setInstanceIdentifier(final InstanceIdentifier iid) { + public void setInstanceIdentifier(final DataObjectIdentifier iid) { this.instanceIdentifier = iid; hwvtepConnectionManager.putConnectionInstance(instanceIdentifier, this); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java index 010850052..d674c3fc0 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepConnectionManager.java @@ -66,6 +66,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hw import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfo; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; @@ -85,16 +86,16 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo private final DataBroker db; private final TransactionInvoker txInvoker; private final Operations ops; - private final Map> instanceIdentifiers = new ConcurrentHashMap<>(); + private final Map> instanceIdentifiers = new ConcurrentHashMap<>(); private final Map entityConnectionMap = new ConcurrentHashMap<>(); private final EntityOwnershipService entityOwnershipService; private final HwvtepDeviceEntityOwnershipListener hwvtepDeviceEntityOwnershipListener; private final ReconciliationManager reconciliationManager; - private final Map, HwvtepConnectionInstance> nodeIidVsConnectionInstance = + private final Map, HwvtepConnectionInstance> nodeIidVsConnectionInstance = new ConcurrentHashMap<>(); private final HwvtepOperGlobalListener hwvtepOperGlobalListener; - private final Map, TransactionHistory> controllerTxHistory = new ConcurrentHashMap<>(); - private final Map, TransactionHistory> deviceUpdateHistory = new ConcurrentHashMap<>(); + private final Map, TransactionHistory> controllerTxHistory = new ConcurrentHashMap<>(); + private final Map, TransactionHistory> deviceUpdateHistory = new ConcurrentHashMap<>(); private final OvsdbConnection ovsdbConnectionService; private final Map alreadyProcessedClients = new ConcurrentHashMap<>(); private final ScheduledExecutorService dependencyExecutor; @@ -224,17 +225,18 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo } } - public OvsdbClient connect(final InstanceIdentifier iid, final HwvtepGlobalAugmentation hwvtepGlobal) + public OvsdbClient connect(final DataObjectIdentifier iid, final HwvtepGlobalAugmentation hwvtepGlobal) throws UnknownHostException, ConnectException { LOG.info("Connecting to {}", HwvtepSouthboundUtil.connectionInfoToString(hwvtepGlobal.getConnectionInfo())); InetAddress ip = HwvtepSouthboundMapper.createInetAddress(hwvtepGlobal.getConnectionInfo().getRemoteIp()); OvsdbClient client = ovsdbConnectionService .connect(ip, hwvtepGlobal.getConnectionInfo().getRemotePort().getValue().toJava()); if (client != null) { - putInstanceIdentifier(hwvtepGlobal.getConnectionInfo(), iid.firstIdentifierOf(Node.class)); + final var nodeId = iid.trimTo(Node.class); + putInstanceIdentifier(hwvtepGlobal.getConnectionInfo(), nodeId); HwvtepConnectionInstance hwvtepConnectionInstance = connectedButCallBacksNotRegistered(client); hwvtepConnectionInstance.setHwvtepGlobalAugmentation(hwvtepGlobal); - hwvtepConnectionInstance.setInstanceIdentifier(iid.firstIdentifierOf(Node.class)); + hwvtepConnectionInstance.setInstanceIdentifier(nodeId); // Register Cluster Ownership for ConnectionInfo registerEntityForOwnership(hwvtepConnectionInstance); @@ -369,18 +371,18 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo LOG.info("Clients after remove: {}", clients); } - private void removeConnectionInstance(final InstanceIdentifier nodeIid) { + private void removeConnectionInstance(final DataObjectIdentifier nodeIid) { if (nodeIid != null) { nodeIidVsConnectionInstance.remove(nodeIid); } } - private void putInstanceIdentifier(final ConnectionInfo key,final InstanceIdentifier iid) { + private void putInstanceIdentifier(final ConnectionInfo key, final DataObjectIdentifier iid) { ConnectionInfo connectionInfo = HwvtepSouthboundMapper.suppressLocalIpPort(key); instanceIdentifiers.put(connectionInfo, iid); } - public InstanceIdentifier getInstanceIdentifier(final ConnectionInfo key) { + public DataObjectIdentifier getInstanceIdentifier(final ConnectionInfo key) { ConnectionInfo connectionInfo = HwvtepSouthboundMapper.suppressLocalIpPort(key); return instanceIdentifiers.get(connectionInfo); } @@ -584,7 +586,7 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo } else { LOG.debug("Connection {} was switch initiated, no reconciliation is required", - iid.firstKeyOf(Node.class).getNodeId()); + iid.getFirstKeyOf(Node.class).getNodeId()); } } @@ -703,20 +705,20 @@ public class HwvtepConnectionManager implements OvsdbConnectionListener, AutoClo } } - final Map, HwvtepDeviceInfo> allConnectedInstances() { + final Map, HwvtepDeviceInfo> allConnectedInstances() { return Maps.transformValues(Collections.unmodifiableMap(nodeIidVsConnectionInstance), HwvtepConnectionInstance::getDeviceInfo); } - final Map, TransactionHistory> controllerTxHistory() { + final Map, TransactionHistory> controllerTxHistory() { return Collections.unmodifiableMap(controllerTxHistory); } - final Map, TransactionHistory> deviceUpdateHistory() { + final Map, TransactionHistory> deviceUpdateHistory() { return Collections.unmodifiableMap(deviceUpdateHistory); } - public void cleanupOperationalNode(final InstanceIdentifier nodeIid) { + public void cleanupOperationalNode(final DataObjectIdentifier nodeIid) { txInvoker.invoke(new HwvtepGlobalRemoveCommand(nodeIid)); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java index 06eb291bf..f157a082d 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepDeviceInfo.java @@ -351,7 +351,7 @@ public class HwvtepDeviceInfo { dependencyQueue.submit(() -> connectionInstance.transact(transactCommand)); } - public void clearInTransit(Class> cls, InstanceIdentifier key) { + public void clearInTransit(Class> cls, DataObjectIdentifier key) { DeviceData deviceData = getDeviceOperData(cls, key); if (deviceData != null && deviceData.isInTransitState()) { if (deviceData.getData() != null) { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java index 9560406c1..41d71695f 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepOperGlobalListener.java @@ -9,7 +9,6 @@ package org.opendaylight.ovsdb.hwvtepsouthbound; import java.util.ArrayList; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; @@ -29,24 +28,28 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; +import org.opendaylight.yangtools.binding.DataObjectReference; import org.opendaylight.yangtools.concepts.Registration; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public final class HwvtepOperGlobalListener implements DataTreeChangeListener, AutoCloseable { - private static final Logger LOG = LoggerFactory.getLogger(HwvtepOperGlobalListener.class); - private static final Map, ConnectionInfo> NODE_CONNECTION_INFO = new ConcurrentHashMap<>(); - private static final Map, ScheduledFuture> TIMEOUT_FTS = new ConcurrentHashMap<>(); + + // FIXME: static state! + private static final ConcurrentHashMap, ConnectionInfo> NODE_CONNECTION_INFO = + new ConcurrentHashMap<>(); + private static final ConcurrentHashMap, ScheduledFuture> TIMEOUT_FTS = + new ConcurrentHashMap<>(); + private static final ConcurrentHashMap, List>> NODE_DELET_WAITING_JOBS = + new ConcurrentHashMap<>(); + private static final ConcurrentHashMap, Node> CONNECTED_NODES = + new ConcurrentHashMap<>(); private Registration registration; private final HwvtepConnectionManager hcm; private final DataBroker db; - private static final Map, List>> NODE_DELET_WAITING_JOBS - = new ConcurrentHashMap<>(); - private static final Map, Node> CONNECTED_NODES = new ConcurrentHashMap<>(); - HwvtepOperGlobalListener(final DataBroker db, HwvtepConnectionManager hcm) { LOG.info("Registering HwvtepOperGlobalListener"); @@ -82,7 +85,7 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener iid, Runnable job) { + public static void runAfterTimeoutIfNodeNotCreated(DataObjectIdentifier iid, Runnable job) { ScheduledFuture ft = TIMEOUT_FTS.get(iid); if (ft != null) { ft.cancel(false); @@ -96,7 +99,7 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener iid, Callable job) throws Exception { + public void runAfterNodeDeleted(DataObjectIdentifier iid, Callable job) throws Exception { synchronized (HwvtepOperGlobalListener.class) { if (NODE_DELET_WAITING_JOBS.containsKey(iid)) { LOG.error("Node present in the cache {} adding to delete queue", iid); @@ -114,7 +117,7 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener iid) { + private synchronized void runPendingJobs(DataObjectIdentifier iid) { List> jobs = NODE_DELET_WAITING_JOBS.remove(iid); if (jobs != null && !jobs.isEmpty()) { jobs.forEach(job -> { @@ -131,7 +134,7 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener> changes) { changes.forEach(change -> { - InstanceIdentifier key = change.getRootPath().path(); + DataObjectIdentifier key = change.path(); DataObjectModification mod = change.getRootNode(); Node node = getCreated(mod); if (node == null) { @@ -159,7 +162,7 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener> changes) { changes.forEach(change -> { - InstanceIdentifier key = change.getRootPath().path(); + DataObjectIdentifier key = change.path(); DataObjectModification mod = change.getRootNode(); Node node = getUpdated(mod); if (node != null) { @@ -168,13 +171,13 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener key) { + public static Node getNode(final DataObjectIdentifier key) { return CONNECTED_NODES.get(key); } private void disconnect(List> changes) { changes.forEach(change -> { - InstanceIdentifier key = change.getRootPath().path(); + DataObjectIdentifier key = change.path(); DataObjectModification mod = change.getRootNode(); Node node = getRemoved(mod); if (node != null) { @@ -187,19 +190,18 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener iid) { - return iid.firstKeyOf(Node.class).getNodeId().getValue(); + private static String getNodeId(DataObjectIdentifier iid) { + return iid.getFirstKeyOf(Node.class).getNodeId().getValue(); } - public void scheduleOldConnectionNodeDelete(InstanceIdentifier iid) { + public void scheduleOldConnectionNodeDelete(DataObjectIdentifier iid) { ConnectionInfo oldConnectionInfo = getNodeConnectionInfo(iid); HwvtepSouthboundUtil.schedule(() -> { deleteTheNodeOfOldConnection(iid, oldConnectionInfo); }, HwvtepSouthboundConstants.STALE_HWVTEP_CLEANUP_DELAY_SECS, TimeUnit.SECONDS); } - private void deleteTheNodeOfOldConnection(InstanceIdentifier iid, - ConnectionInfo oldConnectionInfo) { + private void deleteTheNodeOfOldConnection(DataObjectIdentifier iid, ConnectionInfo oldConnectionInfo) { if (oldConnectionInfo == null) { return; } @@ -211,7 +213,7 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener iid) { + private static ConnectionInfo getNodeConnectionInfo(DataObjectIdentifier iid) { return NODE_CONNECTION_INFO.get(iid); } @@ -229,10 +231,11 @@ public final class HwvtepOperGlobalListener implements DataTreeChangeListener getWildcardPath() { - return InstanceIdentifier.create(NetworkTopology.class) + private static DataObjectReference getWildcardPath() { + return DataObjectReference.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) - .child(Node.class); + .child(Node.class) + .build(); } private static Node getUpdated(DataObjectModification mod) { diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundMapper.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundMapper.java index 10b8b99a0..f2a066faf 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundMapper.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundMapper.java @@ -14,6 +14,7 @@ import java.net.Inet4Address; import java.net.Inet6Address; import java.net.InetAddress; import java.net.UnknownHostException; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.ovsdb.lib.OvsdbClient; import org.opendaylight.ovsdb.schema.hardwarevtep.ACL; import org.opendaylight.ovsdb.schema.hardwarevtep.Global; @@ -51,7 +52,9 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey; +import org.opendaylight.yangtools.binding.DataObjectReference; import org.opendaylight.yangtools.yang.common.Uint16; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -60,50 +63,51 @@ public final class HwvtepSouthboundMapper { private static final Logger LOG = LoggerFactory.getLogger(HwvtepSouthboundMapper.class); private HwvtepSouthboundMapper() { + // Hidden on purpose } - public static InstanceIdentifier createInstanceIdentifier(final NodeId nodeId) { - return InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) - .child(Node.class,new NodeKey(nodeId)); + public static @NonNull WithKey createInstanceIdentifier(final NodeId nodeId) { + return DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) + .child(Node.class,new NodeKey(nodeId)) + .build(); } - public static InstanceIdentifier createInstanceIdentifier(final OvsdbClient client) { + public static @NonNull WithKey createInstanceIdentifier(final OvsdbClient client) { return createInstanceIdentifier(createIpAddress(client.getConnectionInfo().getRemoteAddress()), new PortNumber(Uint16.valueOf(client.getConnectionInfo().getRemotePort()))); } - private static InstanceIdentifier createInstanceIdentifier(final IpAddress ip, final PortNumber port) { + private static @NonNull WithKey createInstanceIdentifier(final IpAddress ip, final PortNumber port) { String uriString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://" + ip.stringValue() + ":" + port.getValue(); Uri uri = new Uri(uriString); NodeId nodeId = new NodeId(uri); - InstanceIdentifier path = InstanceIdentifier.create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) - .child(Node.class,new NodeKey(nodeId)); - LOG.debug("Created ovsdb path: {}",path); + final var path = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) + .child(Node.class,new NodeKey(nodeId)) + .build(); + LOG.debug("Created ovsdb path: {}", path); return path; } - public static InstanceIdentifier createInstanceIdentifier(final HwvtepConnectionInstance client, + public static @NonNull WithKey createInstanceIdentifier(final HwvtepConnectionInstance client, final PhysicalSwitch physicalSwitch) { //TODO: Clean this up return createInstanceIdentifier(client, new HwvtepNodeName(physicalSwitch.getName())); } - public static InstanceIdentifier createInstanceIdentifier(final HwvtepConnectionInstance client, + public static @NonNull WithKey createInstanceIdentifier(final HwvtepConnectionInstance client, final HwvtepNodeName psName) { - NodeKey nodeKey = new NodeKey(createManagedNodeId(client, psName)); - return InstanceIdentifier.builder(NetworkTopology.class) - .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) - .child(Node.class, nodeKey).build(); + return DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) + .child(Node.class, new NodeKey(createManagedNodeId(client, psName))) + .build(); } - public static InstanceIdentifier createInstanceIdentifier(final HwvtepConnectionInstance client, - final LogicalSwitch logicalSwitch) { - InstanceIdentifier iid = null; - iid = InstanceIdentifier.builder(NetworkTopology.class) + public static @NonNull WithKey createInstanceIdentifier( + final HwvtepConnectionInstance client, final LogicalSwitch logicalSwitch) { + return DataObjectIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) .child(Node.class, client.getNodeKey()).augmentation(HwvtepGlobalAugmentation.class) .child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitch.getName()))) @@ -112,69 +116,67 @@ public final class HwvtepSouthboundMapper { iid = client.getInstanceIdentifier().builder() .child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(lSwitch.getName())))).build() */ - return iid; } - public static InstanceIdentifier createInstanceIdentifier(final HwvtepConnectionInstance client, + public static @NonNull WithKey createInstanceIdentifier(final HwvtepConnectionInstance client, final ACL acl) { - return InstanceIdentifier.builder(NetworkTopology.class) + return DataObjectIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) .child(Node.class, client.getNodeKey()).augmentation(HwvtepGlobalAugmentation.class) .child(Acls.class, new AclsKey(acl.getAclName())) .build(); } - public static InstanceIdentifier createInstanceIdentifier(final InstanceIdentifier nodeIid, - final InstanceIdentifier localTpIid, - final InstanceIdentifier remoteTpIid) { - - TunnelsKey tunnelsKey = new TunnelsKey(new HwvtepPhysicalLocatorRef(localTpIid.toIdentifier()), - new HwvtepPhysicalLocatorRef(remoteTpIid.toIdentifier())); - InstanceIdentifier tunnelInstanceId = nodeIid.builder().augmentation(PhysicalSwitchAugmentation.class) - .child(Tunnels.class, tunnelsKey).build(); - return tunnelInstanceId; + public static @NonNull WithKey createInstanceIdentifier( + final DataObjectIdentifier nodeIid, final DataObjectIdentifier localTpIid, + final DataObjectIdentifier remoteTpIid) { + return nodeIid.toBuilder() + .augmentation(PhysicalSwitchAugmentation.class) + .child(Tunnels.class, new TunnelsKey(new HwvtepPhysicalLocatorRef(localTpIid), + new HwvtepPhysicalLocatorRef(remoteTpIid))) + .build(); } - public static InstanceIdentifier createInstanceIdentifier(final InstanceIdentifier nodeIid, - final PhysicalLocator physicalLocator) { - return nodeIid.child(TerminationPoint.class, getTerminationPointKey(physicalLocator)); + public static @NonNull WithKey createInstanceIdentifier( + final DataObjectIdentifier nodeIid, final PhysicalLocator physicalLocator) { + return nodeIid.toBuilder().child(TerminationPoint.class, getTerminationPointKey(physicalLocator)).build(); } - public static InstanceIdentifier createInstanceIdentifier(final HwvtepConnectionInstance client, - final InstanceIdentifier tpPath, final VlanBindings vlanBindings) { - return tpPath.augmentation(HwvtepPhysicalPortAugmentation.class).child(VlanBindings.class, - new VlanBindingsKey(vlanBindings.key())); - + public static @NonNull WithKey createInstanceIdentifier( + final HwvtepConnectionInstance client, final DataObjectIdentifier tpPath, + final VlanBindings vlanBindings) { + return tpPath.toBuilder() + .augmentation(HwvtepPhysicalPortAugmentation.class) + .child(VlanBindings.class, new VlanBindingsKey(vlanBindings.key())) + .build(); } - public static InstanceIdentifier createInstanceIdentifier() { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) - .child(Node.class); - return path; - } + public static @NonNull DataObjectReference createInstanceIdentifier() { + return DataObjectReference.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) + .child(Node.class) + .build(); + } - public static NodeId createManagedNodeId(final InstanceIdentifier iid) { - NodeKey nodeKey = iid.firstKeyOf(Node.class); - return nodeKey.getNodeId(); + public static @NonNull NodeId createManagedNodeId(final DataObjectIdentifier iid) { + return iid.getFirstKeyOf(Node.class).getNodeId(); } public static NodeId createManagedNodeId(final HwvtepConnectionInstance client, final HwvtepNodeName psName) { String nodeString = client.getNodeKey().getNodeId().getValue() + "/" + HwvtepSouthboundConstants.PSWITCH_URI_PREFIX + "/" + psName.getValue(); - NodeId nodeId = new NodeId(new Uri(nodeString)); - return nodeId; + return new NodeId(new Uri(nodeString)); } + // FIXME: IetfInetUtil.ipAddressFor() does this as well, but does something else for IPv6 public static IpAddress createIpAddress(final InetAddress address) { - IpAddress ip = null; - if (address instanceof Inet4Address) { - ip = createIpAddress((Inet4Address)address); - } else if (address instanceof Inet6Address) { - ip = createIpAddress((Inet6Address)address); + if (address instanceof Inet4Address inet4) { + return createIpAddress(inet4); } - return ip; + if (address instanceof Inet6Address inet6) { + return createIpAddress(inet6); + } + return null; } public static IpAddress createIpAddress(final Inet4Address address) { @@ -182,8 +184,7 @@ public final class HwvtepSouthboundMapper { } public static IpAddress createIpAddress(final Inet6Address address) { - Ipv6Address ipv6 = new Ipv6Address(address.getHostAddress()); - return new IpAddress(ipv6); + return new IpAddress(new Ipv6Address(address.getHostAddress())); } public static ConnectionInfo createConnectionInfo(final OvsdbClient client) { @@ -205,20 +206,20 @@ public final class HwvtepSouthboundMapper { public static InetAddress createInetAddress(final IpAddress ip) throws UnknownHostException { if (ip.getIpv4Address() != null) { return InetAddresses.forString(ip.getIpv4Address().getValue()); - } else if (ip.getIpv6Address() != null) { + } + if (ip.getIpv6Address() != null) { return InetAddress.getByName(ip.getIpv6Address().getValue()); - } else { - throw new UnknownHostException("IP Address has no value"); } + throw new UnknownHostException("IP Address has no value"); } - public static InstanceIdentifier getInstanceIdentifier(final Global global) { + public static @NonNull WithKey getInstanceIdentifier(final Global global) { String nodeString = HwvtepSouthboundConstants.HWVTEP_URI_PREFIX + "://" + HwvtepSouthboundConstants.UUID + "/" + global.getUuid().toString(); NodeId nodeId = new NodeId(new Uri(nodeString)); NodeKey nodeKey = new NodeKey(nodeId); TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID); - return InstanceIdentifier.builder(NetworkTopology.class) + return DataObjectIdentifier.builder(NetworkTopology.class) .child(Topology.class, topoKey) .child(Node.class, nodeKey) .build(); diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java index 57e80829e..418e3ec42 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProvider.java @@ -39,6 +39,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -147,9 +148,9 @@ public final class HwvtepSouthboundProvider } private void initializeHwvtepTopology(final LogicalDatastoreType type) { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)); + final var path = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID)) + .build(); ReadWriteTransaction transaction = dataBroker.newReadWriteTransaction(); FluentFuture hwvtepTp = transaction.exists(type, path); try { @@ -218,17 +219,17 @@ public final class HwvtepSouthboundProvider } @Override - public Map, HwvtepDeviceInfo> getAllConnectedInstances() { + public Map, HwvtepDeviceInfo> getAllConnectedInstances() { return cm.allConnectedInstances(); } @Override - public Map, TransactionHistory> getControllerTxHistory() { + public Map, TransactionHistory> getControllerTxHistory() { return cm.controllerTxHistory(); } @Override - public Map, TransactionHistory> getDeviceUpdateHistory() { + public Map, TransactionHistory> getDeviceUpdateHistory() { return cm.deviceUpdateHistory(); } } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProviderInfo.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProviderInfo.java index 2d1d6f85b..6b2ad66fa 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProviderInfo.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/HwvtepSouthboundProviderInfo.java @@ -12,14 +12,14 @@ import java.util.Map; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionHistory; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; @Beta public interface HwvtepSouthboundProviderInfo { - @NonNull Map, HwvtepDeviceInfo> getAllConnectedInstances(); + @NonNull Map, HwvtepDeviceInfo> getAllConnectedInstances(); - @NonNull Map, TransactionHistory> getControllerTxHistory(); + @NonNull Map, TransactionHistory> getControllerTxHistory(); - @NonNull Map, TransactionHistory> getDeviceUpdateHistory(); + @NonNull Map, TransactionHistory> getDeviceUpdateHistory(); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/AbstractTransactCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/AbstractTransactCommand.java index 36ed707a5..8624f17ea 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/AbstractTransactCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/AbstractTransactCommand.java @@ -313,8 +313,8 @@ public abstract class AbstractTransactCommand, I ext DataObjectModification mod = change.getRootNode(); Node updatedNode = TransactUtils.getUpdated(mod); List updatedData = getData(updatedNode); - Set deleted = getOperationalState().getDeletedKeysInCurrentTx(LogicalSwitches.class); - UnMetDependencyGetter dependencyGetter = getDependencyGetter(); + final var deleted = getOperationalState().getDeletedKeysInCurrentTx(LogicalSwitches.class); + final var dependencyGetter = getDependencyGetter(); if (!HwvtepSouthboundUtil.isEmpty(deleted) && !HwvtepSouthboundUtil.isEmpty(updatedData) && dependencyGetter != null) { List removed = new ArrayList<>(); diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/HwvtepOperationalState.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/HwvtepOperationalState.java index 22a2cd15b..7f3645c3b 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/HwvtepOperationalState.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/HwvtepOperationalState.java @@ -65,14 +65,14 @@ public class HwvtepOperationalState { private static final Logger LOG = LoggerFactory.getLogger(HwvtepOperationalState.class); - private final Map, Node> operationalNodes = new HashMap<>(); + private final Map, Node> operationalNodes = new HashMap<>(); private ReadWriteTransaction transaction; - HashMap, UUID> inflightLocators = new HashMap<>(); + private final HashMap, UUID> inflightLocators = new HashMap<>(); private final HwvtepDeviceInfo deviceInfo; private final HwvtepConnectionInstance connectionInstance; - private final Map>, Map> currentTxUUIDs = + private final Map>, Map> currentTxUUIDs = new ConcurrentHashMap<>(); - private final Map>, Map> currentTxDeletedKeys = + private final Map>, Map> currentTxDeletedKeys = new ConcurrentHashMap<>(); /* stores the modified and deleted data for each child type of each node id @@ -80,7 +80,7 @@ public class HwvtepOperationalState { each updated/ deleted contains Map < child type, List> child type is the child of hwvtep Global augmentation */ - private Map, + private Map, Pair>, List>>, Map>, List>>>> modifiedData = new HashMap<>(); private boolean inReconciliation = false; @@ -325,14 +325,14 @@ public class HwvtepOperationalState { return HwvtepSouthboundUtil.containsKey(currentTxUUIDs, cls, key); } - public Set getDeletedKeysInCurrentTx(final Class> cls) { + public Set getDeletedKeysInCurrentTx(final Class> cls) { if (currentTxDeletedKeys.containsKey(cls)) { return currentTxDeletedKeys.get(cls).keySet(); } return Collections.emptySet(); } - public List> getUpdatedData(final InstanceIdentifier key, + public List> getUpdatedData(final DataObjectIdentifier key, final Class> cls) { List> result = null; if (modifiedData.get(key) != null && modifiedData.get(key).getLeft() != null) { @@ -356,7 +356,7 @@ public class HwvtepOperationalState { return result; } - public void setModifiedData(final Map, + public void setModifiedData(final Map, Pair>, List>>, Map>, List>>>> modifiedData) { this.modifiedData = modifiedData; diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactUtils.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactUtils.java index dde84c071..71275ffe5 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactUtils.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transact/TransactUtils.java @@ -150,7 +150,7 @@ public final class TransactUtils { public static UUID createPhysicalLocator(final TransactionBuilder transaction, final HwvtepOperationalState operationalState, - final InstanceIdentifier iid) { + final DataObjectIdentifier iid) { UUID locatorUuid = null; HwvtepDeviceInfo.DeviceData deviceData = operationalState.getDeviceInfo().getDeviceOperData( TerminationPoint.class, iid); @@ -165,7 +165,7 @@ public final class TransactUtils { HwvtepPhysicalLocatorAugmentationBuilder builder = new HwvtepPhysicalLocatorAugmentationBuilder(); HwvtepPhysicalLocatorAugmentation locatorAugmentation = null; builder.setEncapsulationType(EncapsulationTypeVxlanOverIpv4.VALUE); - String tepKey = iid.firstKeyOf(TerminationPoint.class).getTpId().getValue(); + String tepKey = iid.getFirstKeyOf(TerminationPoint.class).getTpId().getValue(); String ip = tepKey.substring(tepKey.indexOf(":") + 1); builder.setDstIp(parseIpAddress(ip)); locatorAugmentation = builder.build(); @@ -232,12 +232,12 @@ public final class TransactUtils { public static UUID getLogicalSwitchUUID(final InstanceIdentifier lswitchIid) { return new UUID(HwvtepSouthboundConstants.LOGICALSWITCH_UUID_PREFIX - + sanitizeUUID(lswitchIid.firstKeyOf(LogicalSwitches.class).getHwvtepNodeName())); + + sanitizeUUID(lswitchIid.getFirstKeyOf(LogicalSwitches.class).getHwvtepNodeName())); } public static UUID getLogicalSwitchUUID(final TransactionBuilder transaction, final HwvtepOperationalState operationalState, - final InstanceIdentifier lswitchIid) { + final DataObjectIdentifier lswitchIid) { HwvtepDeviceInfo hwvtepDeviceInfo = operationalState.getDeviceInfo(); HwvtepDeviceInfo.DeviceData lsData = hwvtepDeviceInfo.getDeviceOperData(LogicalSwitches.class, lswitchIid); if (lsData != null) { @@ -252,12 +252,11 @@ public final class TransactUtils { LogicalSwitchUpdateCommand cmd = new LogicalSwitchUpdateCommand(operationalState, List.of()); MdsalUtils mdsalUtils = new MdsalUtils(operationalState.getDataBroker()); LogicalSwitches ls = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, lswitchIid); - if (ls != null) { - cmd.updateLogicalSwitch(transaction, lswitchIid.firstIdentifierOf(Node.class), List.of(ls)); - } else { + if (ls == null) { LOG.error("Could not find logical switch in config ds {}", lswitchIid); return null; } + cmd.updateLogicalSwitch(transaction, lswitchIid.firstIdentifierOf(Node.class), List.of(ls)); return getLogicalSwitchUUID(lswitchIid); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepGlobalRemoveCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepGlobalRemoveCommand.java index 6458ca5b4..7214e2b61 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepGlobalRemoveCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepGlobalRemoveCommand.java @@ -24,7 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hw import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; import org.opendaylight.yangtools.binding.DataObjectIdentifier; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,14 +31,15 @@ public class HwvtepGlobalRemoveCommand extends AbstractTransactionCommand { private static final Logger LOG = LoggerFactory.getLogger(HwvtepGlobalRemoveCommand.class); private static final long ONE_CONNECTED_MANAGER = 1; private static final long ONE_ACTIVE_CONNECTION_IN_PASSIVE_MODE = 1; - private final InstanceIdentifier nodeInstanceIdentifier; + + private final DataObjectIdentifier nodeInstanceIdentifier; public HwvtepGlobalRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates, DatabaseSchema dbSchema) { super(key, updates, dbSchema); this.nodeInstanceIdentifier = key.getInstanceIdentifier(); } - public HwvtepGlobalRemoveCommand(InstanceIdentifier nodeInstanceIdentifier) { + public HwvtepGlobalRemoveCommand(DataObjectIdentifier nodeInstanceIdentifier) { super(null, null, null); this.nodeInstanceIdentifier = nodeInstanceIdentifier; } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterRemoveCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterRemoveCommand.java index f6fb8af89..db77b2215 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterRemoveCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepLogicalRouterRemoveCommand.java @@ -5,10 +5,8 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md; -import java.util.Collection; import org.opendaylight.mdsal.binding.api.ReadWriteTransaction; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance; @@ -20,33 +18,32 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hw import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalRouters; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalRoutersKey; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HwvtepLogicalRouterRemoveCommand extends AbstractTransactionCommand { private static final Logger LOG = LoggerFactory.getLogger(HwvtepLogicalRouterRemoveCommand.class); - public HwvtepLogicalRouterRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates, - DatabaseSchema dbSchema) { + public HwvtepLogicalRouterRemoveCommand(final HwvtepConnectionInstance key, final TableUpdates updates, + final DatabaseSchema dbSchema) { super(key, updates, dbSchema); } @Override - public void execute(ReadWriteTransaction transaction) { - Collection deletedLRRows = + public void execute(final ReadWriteTransaction transaction) { + final var deletedLRRows = TyperUtils.extractRowsRemoved(LogicalRouter.class, getUpdates(), getDbSchema()).values(); if (deletedLRRows != null) { for (LogicalRouter router : deletedLRRows) { HwvtepNodeName routerNode = new HwvtepNodeName(router.getName()); LOG.debug("Clearing device operational data for logical router {}", routerNode); - InstanceIdentifier routerIid = getOvsdbConnectionInstance().getInstanceIdentifier() + final var routerIid = getOvsdbConnectionInstance().getInstanceIdentifier().toBuilder() .augmentation(HwvtepGlobalAugmentation.class) - .child(LogicalRouters.class, new LogicalRoutersKey(routerNode)); + .child(LogicalRouters.class, new LogicalRoutersKey(routerNode)) + .build(); transaction.delete(LogicalDatastoreType.OPERATIONAL, routerIid); getOvsdbConnectionInstance().getDeviceInfo().clearDeviceOperData(LogicalRouters.class, routerIid); } } } - } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMcastMacsLocalUpdateCommand.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMcastMacsLocalUpdateCommand.java index 29d0f2df3..222deed8d 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMcastMacsLocalUpdateCommand.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/main/java/org/opendaylight/ovsdb/hwvtepsouthbound/transactions/md/HwvtepMcastMacsLocalUpdateCommand.java @@ -37,7 +37,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hw import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSetBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder; -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransactionCommand { @@ -46,8 +45,8 @@ public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransaction private final Map updatedPLocSetRows; private final Map updatedPLocRows; - public HwvtepMcastMacsLocalUpdateCommand(HwvtepConnectionInstance key, TableUpdates updates, - DatabaseSchema dbSchema) { + public HwvtepMcastMacsLocalUpdateCommand(final HwvtepConnectionInstance key, final TableUpdates updates, + final DatabaseSchema dbSchema) { super(key, updates, dbSchema); updatedMMacsLocalRows = TyperUtils.extractRowsUpdated(McastMacsLocal.class, getUpdates(), getDbSchema()); updatedPLocSetRows = TyperUtils.extractRowsUpdated(PhysicalLocatorSet.class, getUpdates(), getDbSchema()); @@ -55,13 +54,13 @@ public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransaction } @Override - public void execute(ReadWriteTransaction transaction) { + public void execute(final ReadWriteTransaction transaction) { for (McastMacsLocal mcastMacsLocal : updatedMMacsLocalRows.values()) { updateData(transaction, mcastMacsLocal); } } - private void updateData(ReadWriteTransaction transaction, McastMacsLocal macLocal) { + private void updateData(final ReadWriteTransaction transaction, final McastMacsLocal macLocal) { final InstanceIdentifier connectionIId = getOvsdbConnectionInstance().getInstanceIdentifier(); // Ensure the node exists @@ -81,7 +80,7 @@ public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransaction } } - private LocalMcastMacs buildLocalMcastMacs(McastMacsLocal macLocal) { + private LocalMcastMacs buildLocalMcastMacs(final McastMacsLocal macLocal) { LocalMcastMacsBuilder macLocalBuilder = new LocalMcastMacsBuilder(); if (macLocal.getMac().equals(HwvtepSouthboundConstants.UNKNOWN_DST_STRING)) { macLocalBuilder.setMacEntryKey(HwvtepSouthboundConstants.UNKNOWN_DST_MAC); @@ -96,7 +95,7 @@ public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransaction return macLocalBuilder.build(); } - private void setLogicalSwitch(LocalMcastMacsBuilder macLocalBuilder, McastMacsLocal macLocal) { + private void setLogicalSwitch(final LocalMcastMacsBuilder macLocalBuilder, final McastMacsLocal macLocal) { if (macLocal.getLogicalSwitchColumn() != null && macLocal.getLogicalSwitchColumn().getData() != null) { UUID lsUUID = macLocal.getLogicalSwitchColumn().getData(); LogicalSwitch logicalSwitch = getOvsdbConnectionInstance().getDeviceInfo().getLogicalSwitch(lsUUID); @@ -108,13 +107,13 @@ public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransaction } } - private static void setIpAddress(LocalMcastMacsBuilder macLocalBuilder, McastMacsLocal macLocal) { + private static void setIpAddress(final LocalMcastMacsBuilder macLocalBuilder, final McastMacsLocal macLocal) { if (macLocal.getIpAddr() != null && !macLocal.getIpAddr().isEmpty()) { macLocalBuilder.setIpaddr(TransactUtils.parseIpAddress(macLocal.getIpAddr())); } } - private void setLocatorSet(LocalMcastMacsBuilder macLocalBuilder, McastMacsLocal macLocal) { + private void setLocatorSet(final LocalMcastMacsBuilder macLocalBuilder, final McastMacsLocal macLocal) { if (macLocal.getLocatorSetColumn() != null && macLocal.getLocatorSetColumn().getData() != null) { UUID locSetUUID = macLocal.getLocatorSetColumn().getData(); PhysicalLocatorSet plSet = updatedPLocSetRows.get(locSetUUID); @@ -127,10 +126,10 @@ public final class HwvtepMcastMacsLocalUpdateCommand extends AbstractTransaction if (locator == null) { locator = getOvsdbConnectionInstance().getDeviceInfo().getPhysicalLocator(locUUID); } - InstanceIdentifier tpIid = HwvtepSouthboundMapper.createInstanceIdentifier( + final var tpIid = HwvtepSouthboundMapper.createInstanceIdentifier( getOvsdbConnectionInstance().getInstanceIdentifier(), locator); plsList.add(new LocatorSetBuilder() - .setLocatorRef(new HwvtepPhysicalLocatorRef(tpIid.toIdentifier())).build()); + .setLocatorRef(new HwvtepPhysicalLocatorRef(tpIid)).build()); } macLocalBuilder.setLocatorSet(plsList); } diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/DataChangeListenerTestBase.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/DataChangeListenerTestBase.java index 280fa320c..8371a3753 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/DataChangeListenerTestBase.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/DataChangeListenerTestBase.java @@ -67,6 +67,8 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; import org.opendaylight.yangtools.binding.DataObject; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -89,9 +91,9 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest { ArgumentCaptor transactCaptor; String nodeUuid; - protected InstanceIdentifier nodeIid; - InstanceIdentifier ls0Iid; - InstanceIdentifier ls1Iid; + protected DataObjectIdentifier nodeIid; + DataObjectIdentifier ls0Iid; + DataObjectIdentifier ls1Iid; Operations mockOp; @@ -225,9 +227,9 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest { return mergeNode(logicalDatastoreType, nodeIid, nodeBuilder); } - void deleteData(final LogicalDatastoreType datastoreType, final InstanceIdentifier... iids) { + void deleteData(final LogicalDatastoreType datastoreType, final DataObjectIdentifier... iids) { WriteTransaction transaction = getDataBroker().newWriteOnlyTransaction(); - for (InstanceIdentifier id : iids) { + for (var id : iids) { transaction.delete(datastoreType, id); } transaction.commit(); @@ -238,8 +240,10 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest { ReadWriteTransaction tx = getDataBroker().newReadWriteTransaction(); if (LogicalSwitches.class == dataObject) { for (LogicalSwitchesKey key : TestBuilders.logicalSwitches(data).keySet()) { - tx.delete(logicalDatastoreType, - nodeIid.augmentation(HwvtepGlobalAugmentation.class).child(LogicalSwitches.class, key)); + tx.delete(logicalDatastoreType, nodeIid.toBuilder() + .augmentation(HwvtepGlobalAugmentation.class) + .child(LogicalSwitches.class, key) + .build()); } } if (TerminationPoint.class == dataObject) { @@ -262,11 +266,11 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest { tx.commit(); } - NodeBuilder prepareNode(final InstanceIdentifier iid) { - return new NodeBuilder().setNodeId(iid.firstKeyOf(Node.class).getNodeId()); + NodeBuilder prepareNode(final DataObjectIdentifier iid) { + return new NodeBuilder().setNodeId(iid.getFirstKeyOf(Node.class).getNodeId()); } - Node mergeNode(final LogicalDatastoreType datastoreType, final InstanceIdentifier id, + Node mergeNode(final LogicalDatastoreType datastoreType, final DataObjectIdentifier id, final NodeBuilder nodeBuilder) { Node node = nodeBuilder.build(); WriteTransaction transaction = getDataBroker().newWriteOnlyTransaction(); @@ -275,11 +279,11 @@ public class DataChangeListenerTestBase extends AbstractDataBrokerTest { return node; } - public InstanceIdentifier createInstanceIdentifier(final String nodeIdString) { + public WithKey createInstanceIdentifier(final String nodeIdString) { NodeId nodeId = new NodeId(new Uri(nodeIdString)); NodeKey nodeKey = new NodeKey(nodeId); TopologyKey topoKey = new TopologyKey(HwvtepSouthboundConstants.HWVTEP_TOPOLOGY_ID); - return InstanceIdentifier.builder(NetworkTopology.class) + return DataObjectIdentifier.builder(NetworkTopology.class) .child(Topology.class, topoKey) .child(Node.class, nodeKey) .build(); diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java index ff7f9135b..7e1bef476 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/src/test/java/org/opendaylight/ovsdb/hwvtepsouthbound/TestBuilders.java @@ -36,8 +36,8 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.binding.util.BindingMap; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public final class TestBuilders { @@ -50,35 +50,36 @@ public final class TestBuilders { return Arrays.stream(data).map(TestBuilders::buildLogicalSwitch).collect(BindingMap.toOrderedMap()); } - public static Map remoteMcastMacs(InstanceIdentifier iid, + public static Map remoteMcastMacs(DataObjectIdentifier iid, String[]... data) { return Arrays.stream(data) .map(row -> TestBuilders.buildRemoteMcastMacs(iid, row[0], row[1], Arrays.copyOfRange(row, 2, row.length))) .collect(BindingMap.toOrderedMap()); } - public static Map remoteUcastMacs(InstanceIdentifier iid, + public static Map remoteUcastMacs(DataObjectIdentifier iid, String[]... data) { return Arrays.stream(data) .map(row -> TestBuilders.buildRemoteUcastMacs(iid, row[0], row[1], row[2], row[3])) .collect(BindingMap.toOrderedMap()); } - public static Map globalTerminationPoints(InstanceIdentifier nodeIid, + public static Map globalTerminationPoints(DataObjectIdentifier nodeIid, String[]... data) { return Arrays.stream(data) .map(row -> TestBuilders.buildTerminationPoint(nodeIid, row[0])) .collect(BindingMap.toOrderedMap()); } - public static HwvtepLogicalSwitchRef buildLogicalSwitchesRef(InstanceIdentifier nodeIid, + public static HwvtepLogicalSwitchRef buildLogicalSwitchesRef(DataObjectIdentifier nodeIid, String logicalSwitchName) { - InstanceIdentifier switchIid = nodeIid.augmentation(HwvtepGlobalAugmentation.class) - .child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitchName))); - return new HwvtepLogicalSwitchRef(switchIid.toIdentifier()); + return new HwvtepLogicalSwitchRef(nodeIid.toBuilder() + .augmentation(HwvtepGlobalAugmentation.class) + .child(LogicalSwitches.class, new LogicalSwitchesKey(new HwvtepNodeName(logicalSwitchName))) + .build()); } - public static RemoteUcastMacs buildRemoteUcastMacs(InstanceIdentifier nodeIid, String vmMac, + public static RemoteUcastMacs buildRemoteUcastMacs(DataObjectIdentifier nodeIid, String vmMac, String vmip, String tepIp, String logicalSwitchName) { RemoteUcastMacsBuilder ucmlBuilder = new RemoteUcastMacsBuilder(); ucmlBuilder.setIpaddr(TransactUtils.parseIpAddress(vmip)); @@ -89,7 +90,7 @@ public final class TestBuilders { return ucmlBuilder.build(); } - public static TerminationPoint buildTerminationPoint(InstanceIdentifier nodeIid, String ip) { + public static TerminationPoint buildTerminationPoint(DataObjectIdentifier nodeIid, String ip) { TerminationPointKey tpKey = new TerminationPointKey(new TpId("vxlan_over_ipv4:" + ip)); TerminationPointBuilder tpBuilder = new TerminationPointBuilder(); if (nodeIid != null) { @@ -116,7 +117,7 @@ public final class TestBuilders { return logicalSwitchesBuilder.build(); } - public static RemoteMcastMacs buildRemoteMcastMacs(InstanceIdentifier iid, String mac, + public static RemoteMcastMacs buildRemoteMcastMacs(DataObjectIdentifier iid, String mac, String logicalSwitchName, String[] tepIps) { RemoteMcastMacsBuilder macLocalBuilder = new RemoteMcastMacsBuilder(); @@ -136,18 +137,16 @@ public final class TestBuilders { return macLocalBuilder.build(); } - public static HwvtepPhysicalLocatorRef buildLocatorRef(InstanceIdentifier nodeIid,String tepIp) { - InstanceIdentifier tepId = buildTpId(nodeIid, tepIp); - return new HwvtepPhysicalLocatorRef(tepId.toIdentifier()); + public static HwvtepPhysicalLocatorRef buildLocatorRef(DataObjectIdentifier nodeIid,String tepIp) { + return new HwvtepPhysicalLocatorRef(buildTpId(nodeIid, tepIp)); } public static Uuid getUUid(String key) { return new Uuid(UUID.nameUUIDFromBytes(key.getBytes()).toString()); } - public static InstanceIdentifier buildTpId(InstanceIdentifier nodeIid,String tepIp) { + public static DataObjectIdentifier buildTpId(DataObjectIdentifier nodeIid, String tepIp) { String tpKeyStr = VXLAN_OVER_IPV4 + ':' + tepIp; - TerminationPointKey tpKey = new TerminationPointKey(new TpId(tpKeyStr)); - return nodeIid.child(TerminationPoint.class, tpKey); + return nodeIid.toBuilder().child(TerminationPoint.class, new TerminationPointKey(new TpId(tpKeyStr))).build(); } } diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java index 0f5e2e03e..21d0a9283 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/SouthboundMapper.java @@ -26,6 +26,7 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.ovsdb.lib.OvsdbClient; import org.opendaylight.ovsdb.lib.error.SchemaVersionMismatchException; import org.opendaylight.ovsdb.lib.notation.UUID; @@ -95,6 +96,8 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; import org.opendaylight.yangtools.binding.DataObject; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.common.Uint32; @@ -164,13 +167,14 @@ public final class SouthboundMapper { return new IpAddress(ipv6); } - public static InstanceIdentifier createTopologyInstanceIdentifier() { - return InstanceIdentifier.create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)); + public static @NonNull WithKey createTopologyInstanceIdentifier() { + return DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) + .build(); } - public static InstanceIdentifier createInstanceIdentifier(final NodeId nodeId) { - return createTopologyInstanceIdentifier().child(Node.class, new NodeKey(nodeId)); + public static @NonNull WithKey createInstanceIdentifier(final NodeId nodeId) { + return createTopologyInstanceIdentifier().toBuilder().child(Node.class, new NodeKey(nodeId)).build(); } @SuppressWarnings("unchecked") @@ -222,31 +226,29 @@ public final class SouthboundMapper { public static InetAddress createInetAddress(final IpAddress ip) throws UnknownHostException { if (ip.getIpv4Address() != null) { return InetAddresses.forString(ip.getIpv4Address().getValue()); - } else if (ip.getIpv6Address() != null) { + } + if (ip.getIpv6Address() != null) { return InetAddress.getByName(ip.getIpv6Address().getValue()); - } else { - throw new UnknownHostException("IP Address has no value"); } + throw new UnknownHostException("IP Address has no value"); } public static DatapathId createDatapathId(final Bridge bridge) { requireNonNull(bridge); if (bridge.getDatapathIdColumn() == null) { return null; - } else { - return createDatapathId(bridge.getDatapathIdColumn().getData()); } + return createDatapathId(bridge.getDatapathIdColumn().getData()); } public static DatapathId createDatapathId(final Set dpids) { requireNonNull(dpids); if (dpids.isEmpty()) { return null; - } else { - String[] dpidArray = new String[dpids.size()]; - dpids.toArray(dpidArray); - return createDatapathId(dpidArray[0]); } + String[] dpidArray = new String[dpids.size()]; + dpids.toArray(dpidArray); + return createDatapathId(dpidArray[0]); } public static DatapathId createDatapathId(final String dpid) { @@ -550,9 +552,8 @@ public final class SouthboundMapper { if (mapper.get(type) == null) { LOG.info("QoS type not found in model: {}", type); return QosTypeBase.VALUE; - } else { - return mapper.get(type); } + return mapper.get(type); } public static String createQosType(final QosTypeBase qosTypeClass) { @@ -575,16 +576,15 @@ public final class SouthboundMapper { && ovs.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) { String iidString = ovs.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY); return (InstanceIdentifier) instanceIdentifierCodec.bindingDeserializerOrNull(iidString); - } else { - String nodeString = SouthboundConstants.OVSDB_URI_PREFIX + "://" + SouthboundConstants.UUID + "/" - + ovs.getUuid().toString(); - NodeId nodeId = new NodeId(new Uri(nodeString)); - NodeKey nodeKey = new NodeKey(nodeId); - return InstanceIdentifier.builder(NetworkTopology.class) - .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) - .child(Node.class,nodeKey) - .build(); } + String nodeString = SouthboundConstants.OVSDB_URI_PREFIX + "://" + SouthboundConstants.UUID + "/" + + ovs.getUuid().toString(); + NodeId nodeId = new NodeId(new Uri(nodeString)); + NodeKey nodeKey = new NodeKey(nodeId); + return InstanceIdentifier.builder(NetworkTopology.class) + .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) + .child(Node.class,nodeKey) + .build(); } public static Map, DataObject> extractTerminationPointConfigurationChanges( diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTask.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTask.java index 26f8634ec..c2e6ea855 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTask.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/reconciliation/configuration/BridgeConfigReconciliationTask.java @@ -44,7 +44,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yangtools.binding.DataObject; import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -151,9 +150,8 @@ public class BridgeConfigReconciliationTask extends ReconciliationTask { LOG.trace("Reconcile Bridge from InclusionList {} only", bridgeReconcileIncludeList); for (String bridgeNodeIid : bridgeReconcileIncludeList) { try (ReadTransaction tx = reconciliationManager.getDb().newReadOnlyTransaction()) { - InstanceIdentifier nodeInstanceIdentifier = - SouthboundMapper.createInstanceIdentifier(new NodeId(bridgeNodeIid)); - readNodeFuture = tx.read(LogicalDatastoreType.CONFIGURATION, nodeInstanceIdentifier); + readNodeFuture = tx.read(LogicalDatastoreType.CONFIGURATION, + SouthboundMapper.createInstanceIdentifier(new NodeId(bridgeNodeIid))); } readNodeFuture.addCallback(new FutureCallback>() { @Override @@ -208,34 +206,29 @@ public class BridgeConfigReconciliationTask extends ReconciliationTask { return true; } - private static Map, DataObject> extractBridgeConfigurationChanges( + private static Map, DataObject> extractBridgeConfigurationChanges( final Node bridgeNode, final OvsdbBridgeAugmentation ovsdbBridge) { - Map, DataObject> changes = new HashMap<>(); - final InstanceIdentifier bridgeNodeIid = - SouthboundMapper.createInstanceIdentifier(bridgeNode.getNodeId()); - final InstanceIdentifier ovsdbBridgeIid = - bridgeNodeIid.builder().augmentation(OvsdbBridgeAugmentation.class).build(); + Map, DataObject> changes = new HashMap<>(); + final var bridgeNodeIid = SouthboundMapper.createInstanceIdentifier(bridgeNode.getNodeId()); + final var ovsdbBridgeIid = bridgeNodeIid.toBuilder().augmentation(OvsdbBridgeAugmentation.class).build(); changes.put(bridgeNodeIid, bridgeNode); changes.put(ovsdbBridgeIid, ovsdbBridge); final Map protocols = ovsdbBridge.getProtocolEntry(); if (protocols != null) { for (ProtocolEntry protocol : protocols.values()) { - if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) != null) { - KeyedInstanceIdentifier protocolIid = - ovsdbBridgeIid.child(ProtocolEntry.class, protocol.key()); - changes.put(protocolIid, protocol); - } else { + if (SouthboundConstants.OVSDB_PROTOCOL_MAP.get(protocol.getProtocol()) == null) { throw new IllegalArgumentException("Unknown protocol " + protocol.getProtocol()); } + final var protocolIid = ovsdbBridgeIid.toBuilder().child(ProtocolEntry.class, protocol.key()).build(); + changes.put(protocolIid, protocol); } } final Map controllers = ovsdbBridge.getControllerEntry(); if (controllers != null) { for (ControllerEntry controller : controllers.values()) { - KeyedInstanceIdentifier controllerIid = - ovsdbBridgeIid.child(ControllerEntry.class, controller.key()); + var controllerIid = ovsdbBridgeIid.toBuilder().child(ControllerEntry.class, controller.key()).build(); changes.put(controllerIid, controller); } } diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java index 25b9f1af5..1eafe9bc2 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommand.java @@ -29,7 +29,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntryKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; public class OvsdbManagersRemovedCommand extends AbstractTransactionCommand { private final Map oldOpenVSwitchRows; @@ -57,20 +57,19 @@ public class OvsdbManagersRemovedCommand extends AbstractTransactionCommand { @VisibleForTesting void deleteManagers(ReadWriteTransaction transaction, - List> managerEntryIids) { + List> managerEntryIids) { for (var managerEntryIid : managerEntryIids) { transaction.delete(LogicalDatastoreType.OPERATIONAL, managerEntryIid); } } @VisibleForTesting - List> managerEntriesToRemove( - InstanceIdentifier ovsdbNodeIid, OpenVSwitch openVSwitch) { + List> managerEntriesToRemove( + DataObjectIdentifier ovsdbNodeIid, OpenVSwitch openVSwitch) { requireNonNull(ovsdbNodeIid); requireNonNull(openVSwitch); - List> result = - new ArrayList<>(); + List> result = new ArrayList<>(); OpenVSwitch oldOvsdbNode = oldOpenVSwitchRows.get(openVSwitch.getUuid()); if (oldOvsdbNode != null && oldOvsdbNode.getManagerOptionsColumn() != null) { @@ -80,14 +79,12 @@ public class OvsdbManagersRemovedCommand extends AbstractTransactionCommand { Manager manager = removedManagerRows.get(managerUuid); if (!checkIfManagerPresentInUpdatedManagersList(manager)) { if (manager != null && manager.getTargetColumn() != null) { - InstanceIdentifier iid = ovsdbNodeIid - .augmentation(OvsdbNodeAugmentation.class) - .child(ManagerEntry.class, - new ManagerEntryKey( - new Uri(manager.getTargetColumn().getData()))); - result.add(iid); - } - + result.add(ovsdbNodeIid.toBuilder() + .augmentation(OvsdbNodeAugmentation.class) + .child(ManagerEntry.class, new ManagerEntryKey( + new Uri(manager.getTargetColumn().getData()))) + .build()); + } } } } diff --git a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java index 7f5e6c449..ee7297ff1 100644 --- a/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java +++ b/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbPortUpdateCommand.java @@ -437,14 +437,15 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { } @SuppressWarnings("unchecked") - private InstanceIdentifier getQosIid(NodeId nodeId, OvsdbNodeAugmentation ovsdbNode, UUID qosUuid) { + private DataObjectIdentifier getQosIid(NodeId nodeId, OvsdbNodeAugmentation ovsdbNode, UUID qosUuid) { // Search for the QoS entry first in the operational datastore final Uuid uuid = new Uuid(qosUuid.toString()); for (QosEntries qosEntry : ovsdbNode.nonnullQosEntries().values()) { if (uuid.equals(qosEntry.getQosUuid())) { - return SouthboundMapper.createInstanceIdentifier(nodeId) - .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, qosEntry.key()); + return SouthboundMapper.createInstanceIdentifier(nodeId).toBuilder() + .augmentation(OvsdbNodeAugmentation.class) + .child(QosEntries.class, qosEntry.key()) + .build(); } } @@ -453,21 +454,22 @@ public class OvsdbPortUpdateCommand extends AbstractTransactionCommand { Qos qos = qosUpdate.getValue(); if (qos.getUuid().equals(qosUuid)) { if (qos.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) { - return (InstanceIdentifier) instanceIdentifierCodec.bindingDeserializerOrNull( + return (DataObjectIdentifier) instanceIdentifierCodec.bindingDeserializerOrNull( qos.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY)); } else { - return SouthboundMapper.createInstanceIdentifier(nodeId) - .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, new QosEntriesKey( - new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString()))); + return SouthboundMapper.createInstanceIdentifier(nodeId)toBuilder() + .augmentation(OvsdbNodeAugmentation.class) + .child(QosEntries.class, new QosEntriesKey( + new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid))) + .build(); } } } LOG.debug("QoS UUID {} assigned to port not found in operational node {} or QoS updates", qosUuid, ovsdbNode); - return SouthboundMapper.createInstanceIdentifier(nodeId) - .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, new QosEntriesKey( - new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString()))); + return SouthboundMapper.createInstanceIdentifier(nodeId).toBuilder() + .augmentation(OvsdbNodeAugmentation.class) + .child(QosEntries.class, new QosEntriesKey(new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid))) + .build(); } private static void updateIfIndex(final Interface interf, diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataTreeChangeListenerTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataTreeChangeListenerTest.java index 4671edc43..61b248868 100644 --- a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataTreeChangeListenerTest.java +++ b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/OvsdbDataTreeChangeListenerTest.java @@ -29,8 +29,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types. import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfoBuilder; -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.common.Uint16; /** @@ -71,9 +69,9 @@ public class OvsdbDataTreeChangeListenerTest extends AbstractConcurrentDataBroke .setRemoteIp(ipAddress) .setRemotePort(portNumber) .build(); - final InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); WriteTransaction transaction = dataBroker.newReadWriteTransaction(); - transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, iid, + transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, + SouthboundUtils.createInstanceIdentifier(connectionInfo), SouthboundUtils.createNode(connectionInfo)); transaction.commit().get(); diff --git a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommandTest.java b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommandTest.java index 9c4568c16..9903bd7b1 100644 --- a/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommandTest.java +++ b/southbound/southbound-impl/src/test/java/org/opendaylight/ovsdb/southbound/transactions/md/OvsdbManagersRemovedCommandTest.java @@ -43,7 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.re import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntry; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagerEntryKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.powermock.api.mockito.PowerMockito; import org.powermock.api.support.membermodification.MemberModifier; @@ -105,13 +105,15 @@ public class OvsdbManagersRemovedCommandTest { @Test public void testDeleteManagers() throws Exception { ReadWriteTransaction transaction = mock(ReadWriteTransaction.class); - List> managerEntryIids = new ArrayList<>(); + List> managerEntryIids = new ArrayList<>(); managerEntryIids.add(SouthboundMapper.createInstanceIdentifier(new NodeId("test")) + .toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(ManagerEntry.class, new ManagerEntryKey(new Uri("testUri")))); - doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); + .child(ManagerEntry.class, new ManagerEntryKey(new Uri("testUri"))) + .build()); + doNothing().when(transaction).delete(any(LogicalDatastoreType.class), any(DataObjectIdentifier.class)); ovsdbManagersRemovedCommand.deleteManagers(transaction, managerEntryIids); - verify(transaction).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); + verify(transaction).delete(any(LogicalDatastoreType.class), any(DataObjectIdentifier.class)); } @Test @@ -134,7 +136,7 @@ public class OvsdbManagersRemovedCommandTest { when(oldOvsdbNode.getManagerOptionsColumn()).thenReturn(column); when(column.getData()).thenReturn(set); when(openVSwitch.getManagerOptionsColumn()).thenReturn(column); - InstanceIdentifier bridgeIid = SouthboundMapper.createInstanceIdentifier(new NodeId("test")); + final var bridgeIid = SouthboundMapper.createInstanceIdentifier(new NodeId("test")); List> resultManagerEntries = ovsdbManagersRemovedCommand.managerEntriesToRemove(bridgeIid, openVSwitch); diff --git a/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java b/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java index 25c22deeb..9245fa100 100644 --- a/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java +++ b/southbound/southbound-it/src/test/java/org/opendaylight/ovsdb/southbound/it/SouthboundIT.java @@ -156,16 +156,17 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; import org.opendaylight.yangtools.binding.DataObject; import org.opendaylight.yangtools.binding.DataObjectIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey; import org.opendaylight.yangtools.binding.EntryObject; import org.opendaylight.yangtools.binding.Key; import org.opendaylight.yangtools.binding.util.BindingMap; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier; import org.opendaylight.yangtools.yang.common.Uint16; import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.common.Uint8; @@ -222,17 +223,17 @@ public class SouthboundIT extends AbstractMdsalTestBase { private static final int RETRY_WAIT = 100; private final LogicalDatastoreType type; - private final Set> createdIids = new HashSet<>(); - private final Set> removedIids = new HashSet<>(); - private final Set> updatedIids = new HashSet<>(); - private final InstanceIdentifier iid; + private final Set> createdIids = new HashSet<>(); + private final Set> removedIids = new HashSet<>(); + private final Set> updatedIids = new HashSet<>(); + private final DataObjectIdentifier iid; private NotifyingDataChangeListener(final LogicalDatastoreType type) { this.type = type; iid = null; } - private NotifyingDataChangeListener(final LogicalDatastoreType type, final InstanceIdentifier iid) { + private NotifyingDataChangeListener(final LogicalDatastoreType type, final DataObjectIdentifier iid) { this.type = type; this.iid = iid; } @@ -241,7 +242,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { public void onDataTreeChanged(final List> changes) { for (DataTreeModification change: changes) { DataObjectModification rootNode = change.getRootNode(); - final InstanceIdentifier identifier = change.getRootPath().path(); + final var identifier = change.path(); switch (rootNode.modificationType()) { case SUBTREE_MODIFIED: case WRITE: @@ -253,8 +254,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { if (obj instanceof ManagedNodeEntry managedNodeEntry) { LOG.info("{} DataChanged: created managed {}", managedNodeEntry.getBridgeRef().getValue()); - createdIids.add(((DataObjectIdentifier) managedNodeEntry.getBridgeRef().getValue()) - .toLegacy()); + createdIids.add((DataObjectIdentifier) managedNodeEntry.getBridgeRef().getValue()); } } else { LOG.info("{} DataTreeChanged: updated {}", type, identifier); @@ -275,15 +275,15 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - public boolean isCreated(final InstanceIdentifier path) { + public boolean isCreated(final DataObjectIdentifier path) { return createdIids.remove(path); } - public boolean isRemoved(final InstanceIdentifier path) { + public boolean isRemoved(final DataObjectIdentifier path) { return removedIids.remove(path); } - public boolean isUpdated(final InstanceIdentifier path) { + public boolean isUpdated(final DataObjectIdentifier path) { return updatedIids.remove(path); } @@ -294,7 +294,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } public void registerDataChangeListener() { - dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.of(type, (InstanceIdentifier)iid), this); + dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.of(type, (DataObjectIdentifier) iid), this); } public void waitForCreation(final long timeout) throws InterruptedException { @@ -454,11 +454,11 @@ public class SouthboundIT extends AbstractMdsalTestBase { mdsalUtils = new MdsalUtils(dataBroker); assertTrue("Did not find " + SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue(), getOvsdbTopology()); final ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber); - final InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.of(LogicalDatastoreType.CONFIGURATION, - (InstanceIdentifier)iid), CONFIGURATION_LISTENER); + (DataObjectIdentifier) iid), CONFIGURATION_LISTENER); dataBroker.registerDataTreeChangeListener(DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, - (InstanceIdentifier)iid), OPERATIONAL_LISTENER); + (DataObjectIdentifier) iid), OPERATIONAL_LISTENER); ovsdbNode = connectOvsdbNode(connectionInfo); OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsdbNode.augmentation(OvsdbNodeAugmentation.class); @@ -505,21 +505,21 @@ public class SouthboundIT extends AbstractMdsalTestBase { LOG.info("getOvsdbTopology: looking for {}...", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue()); Boolean found = false; final TopologyId topologyId = SouthboundUtils.OVSDB_TOPOLOGY_ID; - InstanceIdentifier path = - InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId)); + final var path = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(topologyId)) + .build(); for (int i = 0; i < 60; i++) { Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, path); if (topology != null) { LOG.info("getOvsdbTopology: found {}...", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue()); found = true; break; - } else { - LOG.info("getOvsdbTopology: still looking ({})...", i); - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - LOG.warn("Interrupted while waiting for {}", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue(), e); - } + } + LOG.info("getOvsdbTopology: still looking ({})...", i); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + LOG.warn("Interrupted while waiting for {}", SouthboundUtils.OVSDB_TOPOLOGY_ID.getValue(), e); } } return found; @@ -559,19 +559,19 @@ public class SouthboundIT extends AbstractMdsalTestBase { @Test public void testNetworkTopology() throws InterruptedException { NetworkTopology networkTopology = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, - InstanceIdentifier.create(NetworkTopology.class)); + DataObjectIdentifier.builder(NetworkTopology.class).build()); assertNotNull("NetworkTopology could not be found in " + LogicalDatastoreType.CONFIGURATION, networkTopology); networkTopology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, - InstanceIdentifier.create(NetworkTopology.class)); + DataObjectIdentifier.builder(NetworkTopology.class).build()); assertNotNull("NetworkTopology could not be found in " + LogicalDatastoreType.OPERATIONAL, networkTopology); } @Test public void testOvsdbTopology() throws InterruptedException { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)); + var path = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) + .build(); Topology topology = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, path); assertNotNull("Topology could not be found in " + LogicalDatastoreType.CONFIGURATION, topology); @@ -582,9 +582,8 @@ public class SouthboundIT extends AbstractMdsalTestBase { } private static Node connectOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException { - final InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); - assertTrue( - mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, iid, SouthboundUtils.createNode(connectionInfo))); + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); + assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, iid, SouthboundUtils.createNode(connectionInfo))); waitForOperationalCreation(iid); Node node = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, iid); assertNotNull(node); @@ -592,7 +591,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { return node; } - private static void waitForOperationalCreation(final InstanceIdentifier iid) throws InterruptedException { + private static void waitForOperationalCreation(final DataObjectIdentifier iid) throws InterruptedException { synchronized (OPERATIONAL_LISTENER) { long start = System.currentTimeMillis(); LOG.info("Waiting for OPERATIONAL DataChanged creation on {}", iid); @@ -604,7 +603,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private static void waitForOperationalDeletion(final InstanceIdentifier iid) throws InterruptedException { + private static void waitForOperationalDeletion(final DataObjectIdentifier iid) throws InterruptedException { synchronized (OPERATIONAL_LISTENER) { long start = System.currentTimeMillis(); LOG.info("Waiting for OPERATIONAL DataChanged deletion on {}", iid); @@ -616,7 +615,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private static void waitForOperationalUpdate(final InstanceIdentifier iid) throws InterruptedException { + private static void waitForOperationalUpdate(final DataObjectIdentifier iid) throws InterruptedException { synchronized (OPERATIONAL_LISTENER) { long start = System.currentTimeMillis(); LOG.info("Waiting for OPERATIONAL DataChanged update on {}", iid); @@ -629,7 +628,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } private static void disconnectOvsdbNode(final ConnectionInfo connectionInfo) throws InterruptedException { - final InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo); assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, iid)); waitForOperationalDeletion(iid); Node node = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, iid); @@ -659,7 +658,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { LOG.info("dp type is {}", dpTypeStr); if (dpTypeStr.equals(NETDEV_DP_TYPE)) { LOG.info("Found a DPDK node; adding a corresponding netdev device"); - InstanceIdentifier bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, + final var bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)); NodeId bridgeNodeId = SouthboundUtils.createManagedNodeId(bridgeIid); try (TestBridge testBridge = new TestBridge(connectionInfo, bridgeIid, @@ -687,7 +686,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } // Verify that all DPDK ports are created - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -737,9 +736,8 @@ public class SouthboundIT extends AbstractMdsalTestBase { if (otherConfig.getOtherConfigKey().equals("local_ip")) { LOG.info("local_ip: {}", otherConfig.getOtherConfigValue()); break; - } else { - LOG.info("other_config {}:{}", otherConfig.getOtherConfigKey(), otherConfig.getOtherConfigValue()); } + LOG.info("other_config {}:{}", otherConfig.getOtherConfigKey(), otherConfig.getOtherConfigValue()); } } else { LOG.info("other_config is not present"); @@ -783,8 +781,8 @@ public class SouthboundIT extends AbstractMdsalTestBase { private static void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder, final ConnectionInfo connectionInfo) { - InstanceIdentifier connectionNodePath = SouthboundUtils.createInstanceIdentifier(connectionInfo); - ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath.toIdentifier())); + ovsdbBridgeAugmentationBuilder.setManagedBy( + new OvsdbNodeRef(SouthboundUtils.createInstanceIdentifier(connectionInfo))); } private static Map createMdsalProtocols() { @@ -853,7 +851,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { * @param externalIds The external identifiers if any. * @param otherConfigs The other configuration items if any. */ - TestBridge(final ConnectionInfo connectionInfo, @Nullable InstanceIdentifier bridgeIid, + TestBridge(final ConnectionInfo connectionInfo, @Nullable DataObjectIdentifier bridgeIid, final String bridgeName, NodeId bridgeNodeId, final boolean setProtocolEntries, final OvsdbFailModeBase failMode, final boolean setManagedBy, @Nullable final DatapathTypeBase dpType, @@ -900,8 +898,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { @Override public void close() { - final InstanceIdentifier iid = - SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName)); + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName)); assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, iid)); try { Thread.sleep(OVSDB_UPDATE_TIMEOUT); @@ -935,9 +932,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { .setMappings(mappings) .setAutoattachExternalIds(externalIds) .build(); - InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Autoattach.class, aaEntry.key()); + .child(Autoattach.class, aaEntry.key()) + .build(); final NotifyingDataChangeListener aaOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, iid); aaOperationalListener.registerDataChangeListener(); @@ -952,9 +950,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { @Override public void close() { - final InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Autoattach.class, new AutoattachKey(autoattachId)); + .child(Autoattach.class, new AutoattachKey(autoattachId)) + .build(); final NotifyingDataChangeListener aaOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, iid); aaOperationalListener.registerDataChangeListener(); @@ -1016,9 +1015,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { .setAutoattachId(new Uri(testAutoattachId)) .setMappings(mappings) .build(); - InstanceIdentifier iid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var iid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Autoattach.class, updatedAa.key()); + .child(Autoattach.class, updatedAa.key()) + .build(); final NotifyingDataChangeListener aaOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, iid); aaOperationalListener.registerDataChangeListener(); @@ -1105,9 +1105,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { .setQosExternalIds(externalIds) .setQosOtherConfig(otherConfigs) .build(); - InstanceIdentifier qeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var qeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, qosEntry.key()); + .child(QosEntries.class, qosEntry.key()) + .build(); final NotifyingDataChangeListener qosOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, qeIid); qosOperationalListener.registerDataChangeListener(); @@ -1124,9 +1125,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { @Override public void close() { - final InstanceIdentifier qeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var qeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, new QosEntriesKey(qosId)); + .child(QosEntries.class, new QosEntriesKey(qosId)) + .build(); final NotifyingDataChangeListener qosOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, qeIid); qosOperationalListener.registerDataChangeListener(); @@ -1143,7 +1145,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { private static class TestQueue implements AutoCloseable { private final ConnectionInfo connectionInfo; private final Uri queueId; - private final InstanceIdentifier queueIid; + private final DataObjectIdentifier queueIid; /** * Creates a test queue entry which can be automatically removed when no longer necessary. @@ -1166,9 +1168,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { .setQueuesExternalIds(externalIds) .setQueuesOtherConfig(otherConfigs) .build(); - queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Queues.class, queue.key()); + .child(Queues.class, queue.key()) + .build(); final NotifyingDataChangeListener queueOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, queueIid); queueOperationalListener.registerDataChangeListener(); @@ -1182,15 +1185,16 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - public InstanceIdentifier getInstanceIdentifier() { + public DataObjectIdentifier getInstanceIdentifier() { return queueIid; } @Override public void close() { - InstanceIdentifier queuesIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var queuesIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Queues.class, new QueuesKey(queueId)); + .child(Queues.class, new QueuesKey(queueId)) + .build(); final NotifyingDataChangeListener queueOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, queuesIid); queueOperationalListener.registerDataChangeListener(); @@ -1206,7 +1210,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { private static OvsdbNodeAugmentation getOvsdbNode(final ConnectionInfo connectionInfo, final LogicalDatastoreType store) { - InstanceIdentifier nodeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo); + final var nodeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo); Node node = mdsalUtils.read(store, nodeIid); assertNotNull(node); OvsdbNodeAugmentation ovsdbNodeAugmentation = node.augmentation(OvsdbNodeAugmentation.class); @@ -1260,9 +1264,8 @@ public class SouthboundIT extends AbstractMdsalTestBase { */ private static Node getBridgeNode(final ConnectionInfo connectionInfo, final String bridgeName, final LogicalDatastoreType store) { - InstanceIdentifier bridgeIid = - SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName)); - return mdsalUtils.read(store, bridgeIid); + return mdsalUtils.read(store, + SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName))); } /** @@ -1288,7 +1291,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } } - private static InstanceIdentifier getTpIid(final ConnectionInfo connectionInfo, + private static @NonNull WithKey getTpIid(final ConnectionInfo connectionInfo, final OvsdbBridgeAugmentation bridge) { return SouthboundUtils.createInstanceIdentifier(connectionInfo, bridge.getBridgeName()); } @@ -1336,7 +1339,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { ovsdbTerminationBuilder.setName(portName); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -1373,7 +1376,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { ovsdbTerminationBuilder.setOfport(ofportExpected); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -1418,7 +1421,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { ovsdbTerminationBuilder.setOfport(ofportInput); ovsdbTerminationBuilder.setOfportRequest(ofPortRequestExpected); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -1644,17 +1647,17 @@ public class SouthboundIT extends AbstractMdsalTestBase { String portName = port1; ovsdbTerminationBuilder.setName(portName); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)); portName = port1; - InstanceIdentifier nodePath = - SouthboundUtils.createInstanceIdentifier(connectionInfo, - new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)) - .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))); + var nodePath = SouthboundUtils.createInstanceIdentifier(connectionInfo, + new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)).toBuilder() + .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))) + .build(); assertTrue("failed to delete port " + portName, mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, nodePath)); @@ -1678,13 +1681,11 @@ public class SouthboundIT extends AbstractMdsalTestBase { terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); - SouthboundUtils.createInstanceIdentifier(connectionInfo, - new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)); portName = port1; - nodePath = - SouthboundUtils.createInstanceIdentifier(connectionInfo, - new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)) - .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))); + nodePath = SouthboundUtils.createInstanceIdentifier(connectionInfo, + new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)).toBuilder() + .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))) + .build(); assertTrue("failed to delete port " + portName, mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, nodePath)); @@ -1696,7 +1697,9 @@ public class SouthboundIT extends AbstractMdsalTestBase { portName = port2; nodePath = SouthboundUtils.createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(SouthboundITConstants.BRIDGE_NAME)) - .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))); + .toBuilder() + .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))) + .build(); assertTrue("failed to delete port " + portName, mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, nodePath)); @@ -1728,7 +1731,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { ovsdbTerminationBuilder.setName(portName); ovsdbTerminationBuilder.setVlanTag(new VlanId(createdVlanId)); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -1795,7 +1798,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { ovsdbTerminationBuilder.setName(portName); ovsdbTerminationBuilder.setVlanMode(vlanMode); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -1880,7 +1883,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { List trunks = buildTrunkList(vlanSet); ovsdbTerminationBuilder.setTrunks(trunks); assertTrue(addTerminationPoint(nodeId, portName, ovsdbTerminationBuilder)); - InstanceIdentifier terminationPointIid = getTpIid(connectionInfo, bridge); + final var terminationPointIid = getTpIid(connectionInfo, bridge); Node terminationPointNode = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, terminationPointIid); assertNotNull(terminationPointNode); @@ -1959,8 +1962,9 @@ public class SouthboundIT extends AbstractMdsalTestBase { // READ and check that qos uuid has been added to the port - InstanceIdentifier tpEntryIid = getTpIid(connectionInfo, bridge) - .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))); + final var tpEntryIid = getTpIid(connectionInfo, bridge).toBuilder() + .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))) + .build(); TerminationPoint terminationPoint = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, tpEntryIid); assertNotNull(terminationPoint); @@ -1973,8 +1977,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build()); tpUpdateBuilder.setTpId(new TpId(portName)); - assertTrue( - mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpEntryIid, tpUpdateBuilder.build())); + assertTrue(mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpEntryIid, tpUpdateBuilder.build())); Thread.sleep(OVSDB_UPDATE_TIMEOUT); // READ and verify that qos uuid has been removed from port @@ -1988,13 +1991,13 @@ public class SouthboundIT extends AbstractMdsalTestBase { @Test public void testGetOvsdbNodes() throws InterruptedException { ConnectionInfo connectionInfo = getConnectionInfo(addressStr, portNumber); - InstanceIdentifier topologyPath = InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)); + final var topologyPath = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) + .build(); Topology topology = mdsalUtils.read(LogicalDatastoreType.OPERATIONAL, topologyPath); - InstanceIdentifier expectedNodeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo); - NodeId expectedNodeId = expectedNodeIid.firstKeyOf(Node.class).getNodeId(); + final var expectedNodeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo); + NodeId expectedNodeId = expectedNodeIid.getFirstKeyOf(Node.class).getNodeId(); assertNotNull("Expected to find topology: " + topologyPath, topology); assertNotNull("Expected to find some nodes" + topology.getNode()); LOG.info("expectedNodeId: {}, getNode: {}", expectedNodeId, topology.getNode()); @@ -2036,8 +2039,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { // CREATE: Create the test bridge final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName(testBridgeName); - final InstanceIdentifier bridgeIid = - SouthboundUtils.createInstanceIdentifier(connectionInfo, ovsdbBridgeName); + final var bridgeIid = SouthboundUtils.createInstanceIdentifier(connectionInfo, ovsdbBridgeName); final NodeId bridgeNodeId = SouthboundMapper.createManagedNodeId(bridgeIid); final NodeBuilder bridgeCreateNodeBuilder = new NodeBuilder(); bridgeCreateNodeBuilder.setNodeId(bridgeNodeId); @@ -2249,9 +2251,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { Uint8.valueOf(45), null, null)) { QueuesBuilder queuesBuilder = new QueuesBuilder(); queuesBuilder.setQueueId(new Uri(testQueueId)); - InstanceIdentifier queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Queues.class, queuesBuilder.build().key()); + .child(Queues.class, queuesBuilder.build().key()) + .build(); final NotifyingDataChangeListener queueConfigurationListener = new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, queueIid); queueConfigurationListener.registerDataChangeListener(); @@ -2335,9 +2338,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { for (short dscp = 1; dscp < 64; dscp++) { QueuesBuilder queuesBuilder = new QueuesBuilder(); queuesBuilder.setQueueId(new Uri(testQueueId)); - InstanceIdentifier queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var queueIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(Queues.class, queuesBuilder.build().key()); + .child(Queues.class, queuesBuilder.build().key()) + .build(); final NotifyingDataChangeListener queueOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, queueIid); queueOperationalListener.registerDataChangeListener(); @@ -2381,9 +2385,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { SouthboundMapper.createQosType(SouthboundConstants.QOS_LINUX_HTB), null, null)) { QosEntriesBuilder qosBuilder = new QosEntriesBuilder(); qosBuilder.setQosId(new Uri(testQosId)); - InstanceIdentifier qosIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var qosIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, qosBuilder.build().key()); + .child(QosEntries.class, qosBuilder.build().key()) + .build(); final NotifyingDataChangeListener qosConfigurationListener = new NotifyingDataChangeListener(LogicalDatastoreType.CONFIGURATION, qosIid); qosConfigurationListener.registerDataChangeListener(); @@ -2470,9 +2475,10 @@ public class SouthboundIT extends AbstractMdsalTestBase { null)) { QosEntriesBuilder qosBuilder = new QosEntriesBuilder(); qosBuilder.setQosId(new Uri(testQosId)); - InstanceIdentifier qosIid = SouthboundUtils.createInstanceIdentifier(connectionInfo) + final var qosIid = SouthboundUtils.createInstanceIdentifier(connectionInfo).toBuilder() .augmentation(OvsdbNodeAugmentation.class) - .child(QosEntries.class, qosBuilder.build().key()); + .child(QosEntries.class, qosBuilder.build().key()) + .build(); final NotifyingDataChangeListener qosOperationalListener = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, qosIid); qosOperationalListener.registerDataChangeListener(); @@ -2486,13 +2492,11 @@ public class SouthboundIT extends AbstractMdsalTestBase { assertNotNull(operQueue1); - InstanceIdentifier queue1Iid = testQueue1.getInstanceIdentifier(); - OvsdbQueueRef queue1Ref = new OvsdbQueueRef(queue1Iid.toIdentifier()); + OvsdbQueueRef queue1Ref = new OvsdbQueueRef(testQueue1.getInstanceIdentifier()); Queues operQueue2 = getQueue(new Uri("queue2"), ovsdbNodeAugmentation); assertNotNull(operQueue2); - InstanceIdentifier queue2Iid = testQueue2.getInstanceIdentifier(); - OvsdbQueueRef queue2Ref = new OvsdbQueueRef(queue2Iid.toIdentifier()); + OvsdbQueueRef queue2Ref = new OvsdbQueueRef(testQueue2.getInstanceIdentifier()); Map queueList = BindingMap.of( new QueueListBuilder().setQueueNumber(Uint32.ONE).setQueueRef(queue1Ref).build(), @@ -2517,8 +2521,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } // DELETE one queue from queue list and check that one remains - KeyedInstanceIdentifier qosQueueIid = qosIid - .child(QueueList.class, new QueueListKey(Uint32.ONE)); + var qosQueueIid = qosIid.toBuilder().child(QueueList.class, new QueueListKey(Uint32.ONE)).build(); assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, qosQueueIid)); qosOperationalListener.waitForUpdate(OVSDB_UPDATE_TIMEOUT); @@ -2542,8 +2545,7 @@ public class SouthboundIT extends AbstractMdsalTestBase { } // DELETE queue list and check that list is empty - qosQueueIid = qosIid - .child(QueueList.class, new QueueListKey(Uint32.ONE)); + qosQueueIid = qosIid.toBuilder().child(QueueList.class, new QueueListKey(Uint32.ONE)).build(); assertTrue(mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, qosQueueIid)); qosOperationalListener.waitForUpdate(OVSDB_UPDATE_TIMEOUT); diff --git a/utils/mdsal-utils/pom.xml b/utils/mdsal-utils/pom.xml index b4644b9ba..4e961f0af 100644 --- a/utils/mdsal-utils/pom.xml +++ b/utils/mdsal-utils/pom.xml @@ -15,9 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ../../commons/binding-parent - org.opendaylight.ovsdb utils.mdsal-utils - 1.21.0-SNAPSHOT bundle diff --git a/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java b/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java index 4b21e50b4..608a2ccc1 100644 --- a/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java +++ b/utils/mdsal-utils/src/main/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtils.java @@ -7,6 +7,8 @@ */ package org.opendaylight.ovsdb.utils.mdsal.utils; +import static java.util.Objects.requireNonNull; + import com.google.common.util.concurrent.FluentFuture; import java.util.Optional; import java.util.concurrent.ExecutionException; @@ -16,6 +18,7 @@ import org.opendaylight.mdsal.binding.api.WriteTransaction; import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yangtools.binding.DataObject; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,19 +36,17 @@ public class MdsalUtils { * @param dataBroker the {@link DataBroker} */ public MdsalUtils(DataBroker dataBroker) { - this.databroker = dataBroker; + this.databroker = requireNonNull(dataBroker); } /** * Executes delete as a blocking transaction. * * @param store {@link LogicalDatastoreType} which should be modified - * @param path {@link InstanceIdentifier} to read from - * @param the data object type + * @param path {@link DataObjectIdentifier} to delete * @return the result of the request */ - public boolean delete( - final LogicalDatastoreType store, final InstanceIdentifier path) { + public boolean delete( final LogicalDatastoreType store, final DataObjectIdentifier path) { boolean result = false; final WriteTransaction transaction = databroker.newWriteOnlyTransaction(); transaction.delete(store, path); @@ -63,12 +64,12 @@ public class MdsalUtils { * Executes merge as a blocking transaction. * * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified - * @param path {@link InstanceIdentifier} for path to read + * @param path {@link DataObjectIdentifier} for path to read * @param the data object type * @return the result of the request */ public boolean merge( - final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier path, D data) { + final LogicalDatastoreType logicalDatastoreType, final DataObjectIdentifier path, D data) { boolean result = false; final WriteTransaction transaction = databroker.newWriteOnlyTransaction(); transaction.mergeParentStructureMerge(logicalDatastoreType, path, data); @@ -86,12 +87,12 @@ public class MdsalUtils { * Executes put as a blocking transaction. * * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified - * @param path {@link InstanceIdentifier} for path to read + * @param path {@link DataObjectIdentifier} for path to read * @param the data object type * @return the result of the request */ public boolean put( - final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier path, D data) { + final LogicalDatastoreType logicalDatastoreType, final DataObjectIdentifier path, D data) { boolean result = false; final WriteTransaction transaction = databroker.newWriteOnlyTransaction(); transaction.mergeParentStructurePut(logicalDatastoreType, path, data); @@ -113,8 +114,7 @@ public class MdsalUtils { * @param the data object type * @return the result as the data object requested */ - public D read( - final LogicalDatastoreType store, final InstanceIdentifier path) { + public D read(final LogicalDatastoreType store, final DataObjectIdentifier path) { Optional optionalDataObject = readOptional(store, path); if (optionalDataObject.isPresent()) { return optionalDataObject.orElseThrow(); @@ -125,12 +125,12 @@ public class MdsalUtils { } public Optional readOptional( - final LogicalDatastoreType store, final InstanceIdentifier path) { + final LogicalDatastoreType store, final DataObjectIdentifier path) { int trialNo = 0; ReadTransaction transaction = databroker.newReadOnlyTransaction(); do { try { - Optional result = transaction.read(store, (InstanceIdentifier)path).get(); + Optional result = transaction.read(store, path).get(); transaction.close(); return result; } catch (InterruptedException | ExecutionException e) { @@ -150,9 +150,7 @@ public class MdsalUtils { return Optional.empty(); } - - public boolean exists( - final LogicalDatastoreType store, final InstanceIdentifier path) { + public boolean exists(final LogicalDatastoreType store, final DataObjectIdentifier path) { int trialNo = 0; ReadTransaction transaction = databroker.newReadOnlyTransaction(); do { @@ -177,9 +175,7 @@ public class MdsalUtils { return false; } - private void logReadFailureError( - InstanceIdentifier path, String cause) { + private static void logReadFailureError(DataObjectIdentifier path, String cause) { LOG.error("{}: Failed to read {} Cause : {}", Thread.currentThread().getStackTrace()[2], path, cause); - } } diff --git a/utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java b/utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java index 33c8fddb7..a9abaca4d 100644 --- a/utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java +++ b/utils/mdsal-utils/src/test/java/org/opendaylight/ovsdb/utils/mdsal/utils/MdsalUtilsTest.java @@ -9,17 +9,15 @@ package org.opendaylight.ovsdb.utils.mdsal.utils; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.util.Optional; +import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.opendaylight.mdsal.binding.api.DataBroker; @@ -27,30 +25,42 @@ import org.opendaylight.mdsal.binding.api.ReadTransaction; import org.opendaylight.mdsal.binding.api.WriteTransaction; import org.opendaylight.mdsal.common.api.CommitInfo; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.yangtools.binding.DataObject; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology; +import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopologyBuilder; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.opendaylight.yangtools.util.concurrent.FluentFutures; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; /** * Unit test for class {@link MdsalUtils}. */ @RunWith(MockitoJUnitRunner.class) -@SuppressWarnings("unchecked") public class MdsalUtilsTest { - - @InjectMocks private MdsalUtils mdsalUtils; - - @Mock private DataBroker databroker; + private static final DataObjectIdentifier DOI = + DataObjectIdentifier.builder(NetworkTopology.class).build(); + private static final NetworkTopology NT = new NetworkTopologyBuilder().build(); + + @Mock + private DataBroker dataBroker; + @Mock + private ReadTransaction readTransaction; + @Mock + private WriteTransaction writeTransaction; + + private MdsalUtils mdsalUtils; + + @Before + public void before() { + mdsalUtils = new MdsalUtils(dataBroker); + } @Test public void testDelete() { - WriteTransaction writeTransaction = mock(WriteTransaction.class); - when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); + when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); - boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class)); + boolean result = mdsalUtils.delete(LogicalDatastoreType.CONFIGURATION, DOI); - verify(writeTransaction, times(1)).delete(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); + verify(writeTransaction, times(1)).delete(LogicalDatastoreType.CONFIGURATION, DOI); verify(writeTransaction, times(1)).commit(); assertTrue("Error, the delete transaction failed", result); @@ -58,15 +68,12 @@ public class MdsalUtilsTest { @Test public void testMerge() { - WriteTransaction writeTransaction = mock(WriteTransaction.class); - when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); + when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); - boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, - mock(InstanceIdentifier.class), mock(DataObject.class)); + boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, DOI, NT); - verify(writeTransaction, times(1)).mergeParentStructureMerge(any(LogicalDatastoreType.class), - any(InstanceIdentifier.class), any(DataObject.class)); + verify(writeTransaction, times(1)).mergeParentStructureMerge(LogicalDatastoreType.CONFIGURATION, DOI, NT); verify(writeTransaction, times(1)).commit(); assertTrue("Error, the merge transaction failed", result); @@ -74,15 +81,12 @@ public class MdsalUtilsTest { @Test public void testPut() { - WriteTransaction writeTransaction = mock(WriteTransaction.class); - when(databroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); + when(dataBroker.newWriteOnlyTransaction()).thenReturn(writeTransaction); doReturn(CommitInfo.emptyFluentFuture()).when(writeTransaction).commit(); - boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, - mock(InstanceIdentifier.class), mock(DataObject.class)); + boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, DOI, NT); - verify(writeTransaction, times(1)).mergeParentStructurePut(any(LogicalDatastoreType.class), - any(InstanceIdentifier.class), any(DataObject.class)); + verify(writeTransaction, times(1)).mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, DOI, NT); verify(writeTransaction, times(1)).commit(); assertTrue("Error, the put transaction failed", result); @@ -90,16 +94,14 @@ public class MdsalUtilsTest { @Test public void testRead() { - ReadTransaction readTransaction = mock(ReadTransaction.class); - doReturn(readTransaction).when(databroker).newReadOnlyTransaction(); - DataObject obj = mock(DataObject.class); - doReturn(FluentFutures.immediateFluentFuture(Optional.of(obj))).when(readTransaction).read( - any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); - DataObject result = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, mock(InstanceIdentifier.class)); - - verify(readTransaction, times(1)).read(any(LogicalDatastoreType.class), any(InstanceIdentifier.class)); + doReturn(readTransaction).when(dataBroker).newReadOnlyTransaction(); + doReturn(FluentFutures.immediateFluentFuture(Optional.of(NT))).when(readTransaction).read( + LogicalDatastoreType.CONFIGURATION, DOI); + final var result = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, DOI); + + verify(readTransaction, times(1)).read(LogicalDatastoreType.CONFIGURATION, DOI); verify(readTransaction, times(1)).close(); - assertEquals("Error, the read transaction failed", obj, result); + assertEquals("Error, the read transaction failed", NT, result); } } diff --git a/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/DockerOvs.java b/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/DockerOvs.java index 3a01d9e3c..b8d50a490 100644 --- a/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/DockerOvs.java +++ b/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/DockerOvs.java @@ -355,7 +355,7 @@ public final class DockerOvs implements AutoCloseable { return dockerComposeServices.size(); } - private String getOvsNumString(int numOvs) { + private static String getOvsNumString(int numOvs) { if (numOvs == 0) { return "ovs1"; } else { diff --git a/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/NodeInfo.java b/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/NodeInfo.java index 49aa9b384..39a7fc4f5 100644 --- a/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/NodeInfo.java +++ b/utils/ovsdb-it-utils/src/main/java/org/opendaylight/ovsdb/utils/ovsdb/it/utils/NodeInfo.java @@ -19,7 +19,7 @@ import org.opendaylight.ovsdb.utils.mdsal.utils.NotifyingDataChangeListener; import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ConnectionInfo; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; -import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,8 +32,8 @@ public class NodeInfo { public static final String INTEGRATION_BRIDGE_NAME = "br-int"; private final ConnectionInfo connectionInfo; - private final InstanceIdentifier ovsdbIid; - private final InstanceIdentifier bridgeIid; + private final DataObjectIdentifier ovsdbIid; + private final DataObjectIdentifier bridgeIid; private final List waitList; private final OvsdbItUtils itUtils; @@ -61,10 +61,10 @@ public class NodeInfo { private void addWaiters() { ovsdbWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, - NotifyingDataChangeListener.BIT_CREATE, ovsdbIid, waitList); + NotifyingDataChangeListener.BIT_CREATE, ovsdbIid.toLegacy(), waitList); ovsdbWaiter.registerDataChangeListener(itUtils.dataBroker); bridgeWaiter = new NotifyingDataChangeListener(LogicalDatastoreType.OPERATIONAL, - NotifyingDataChangeListener.BIT_CREATE, bridgeIid, waitList); + NotifyingDataChangeListener.BIT_CREATE, bridgeIid.toLegacy(), waitList); bridgeWaiter.registerDataChangeListener(itUtils.dataBroker); } diff --git a/utils/southbound-utils/pom.xml b/utils/southbound-utils/pom.xml index f830938d0..fcf475a0e 100644 --- a/utils/southbound-utils/pom.xml +++ b/utils/southbound-utils/pom.xml @@ -15,9 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html ../../commons/binding-parent - org.opendaylight.ovsdb utils.southbound-utils - 1.21.0-SNAPSHOT bundle diff --git a/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java b/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java index aeaa2ebf0..b24497ab3 100644 --- a/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java +++ b/utils/southbound-utils/src/main/java/org/opendaylight/ovsdb/utils/southbound/utils/SouthboundUtils.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.ovsdb.utils.config.ConfigProperties; import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils; @@ -116,6 +117,7 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey; import org.opendaylight.yangtools.binding.DataObject; import org.opendaylight.yangtools.binding.DataObjectIdentifier; +import org.opendaylight.yangtools.binding.DataObjectIdentifier.WithKey; import org.opendaylight.yangtools.binding.Key; import org.opendaylight.yangtools.binding.KeyStep; import org.opendaylight.yangtools.binding.NodeStep; @@ -130,14 +132,14 @@ import org.slf4j.LoggerFactory; public class SouthboundUtils { private abstract static class UtilsProvider { - abstract T read(LogicalDatastoreType store, InstanceIdentifier path); + abstract T read(LogicalDatastoreType store, DataObjectIdentifier path); - abstract boolean delete(LogicalDatastoreType store, InstanceIdentifier path); + abstract boolean delete(LogicalDatastoreType store, DataObjectIdentifier path); - abstract boolean put(LogicalDatastoreType store, InstanceIdentifier path, + abstract boolean put(LogicalDatastoreType store, DataObjectIdentifier path, T createNode); - abstract boolean merge(LogicalDatastoreType store, InstanceIdentifier path, T data); + abstract boolean merge(LogicalDatastoreType store, DataObjectIdentifier path, T data); } private static final class MdsalUtilsProvider extends UtilsProvider { @@ -148,22 +150,22 @@ public class SouthboundUtils { } @Override - T read(LogicalDatastoreType store, InstanceIdentifier path) { + T read(LogicalDatastoreType store, DataObjectIdentifier path) { return mdsalUtils.read(store, path); } @Override - boolean put(LogicalDatastoreType store, InstanceIdentifier path, T data) { + boolean put(LogicalDatastoreType store, DataObjectIdentifier path, T data) { return mdsalUtils.put(store, path, data); } @Override - boolean delete(LogicalDatastoreType store, InstanceIdentifier path) { + boolean delete(LogicalDatastoreType store, DataObjectIdentifier path) { return mdsalUtils.delete(store, path); } @Override - boolean merge(LogicalDatastoreType store, InstanceIdentifier path, T data) { + boolean merge(LogicalDatastoreType store, DataObjectIdentifier path, T data) { return mdsalUtils.merge(store, path, data); } } @@ -254,47 +256,48 @@ public class SouthboundUtils { return new OvsdbNodeAugmentationBuilder().setConnectionInfo(key).build(); } - public static InstanceIdentifier createInstanceIdentifier(NodeId nodeId) { - return InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) - .child(Node.class,new NodeKey(nodeId)); + public static @NonNull WithKey createInstanceIdentifier(NodeId nodeId) { + return DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) + .child(Node.class, new NodeKey(nodeId)) + .build(); } - public static InstanceIdentifier createInstanceIdentifier(NodeKey ovsdbNodeKey, String bridgeName) { + public static @NonNull WithKey createInstanceIdentifier(NodeKey ovsdbNodeKey, String bridgeName) { return createInstanceIdentifier(createManagedNodeId(ovsdbNodeKey.getNodeId(), bridgeName)); } - public static InstanceIdentifier createInstanceIdentifier(ConnectionInfo key) { + public static @NonNull WithKey createInstanceIdentifier(ConnectionInfo key) { return createInstanceIdentifier(key.getRemoteIp(), key.getRemotePort()); } - public static InstanceIdentifier createInstanceIdentifier(IpAddress ip, PortNumber port) { - InstanceIdentifier path = InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) - .child(Node.class,createNodeKey(ip,port)); - LOG.debug("Created ovsdb path: {}",path); + public static @NonNull WithKey createInstanceIdentifier(IpAddress ip, PortNumber port) { + final var path = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) + .child(Node.class, createNodeKey(ip,port)) + .build(); + LOG.debug("Created ovsdb path: {}", path); return path; } - public static InstanceIdentifier createInstanceIdentifier(ConnectionInfo key, OvsdbBridgeName bridgeName) { + public static @NonNull WithKey createInstanceIdentifier(ConnectionInfo key, + OvsdbBridgeName bridgeName) { return createInstanceIdentifier(createManagedNodeId(key, bridgeName)); } - public static InstanceIdentifier createInstanceIdentifier(ConnectionInfo key, String bridgeName) { + public static @NonNull WithKey createInstanceIdentifier(ConnectionInfo key, String bridgeName) { return createInstanceIdentifier(key, new OvsdbBridgeName(bridgeName)); } - public InstanceIdentifier createTerminationPointInstanceIdentifier(Node node, String portName) { - - InstanceIdentifier terminationPointPath = InstanceIdentifier - .create(NetworkTopology.class) - .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) - .child(Node.class,node.key()) - .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))); + public @NonNull WithKey createTerminationPointInstanceIdentifier(Node node, + String portName) { + final var terminationPointPath = DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) + .child(Node.class,node.key()) + .child(TerminationPoint.class, new TerminationPointKey(new TpId(portName))) + .build(); - LOG.debug("Termination point InstanceIdentifier generated : {}",terminationPointPath); + LOG.debug("Termination point InstanceIdentifier generated : {}", terminationPointPath); return terminationPointPath; } @@ -316,9 +319,8 @@ public class SouthboundUtils { + "/" + BRIDGE_URI_PREFIX + "/" + bridgeName.getValue()); } - public static NodeId createManagedNodeId(InstanceIdentifier iid) { - NodeKey nodeKey = iid.firstKeyOf(Node.class); - return nodeKey.getNodeId(); + public static NodeId createManagedNodeId(DataObjectIdentifier iid) { + return iid.getFirstKeyOf(Node.class).getNodeId(); } public OvsdbNodeAugmentation extractOvsdbNode(Node node) { @@ -491,8 +493,7 @@ public class SouthboundUtils { * @return store type data store contents */ public Node getBridgeNode(ConnectionInfo connectionInfo, String bridgeName, LogicalDatastoreType store) { - InstanceIdentifier bridgeIid = createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName)); - return provider.read(store, bridgeIid); + return provider.read(store, createInstanceIdentifier(connectionInfo, new OvsdbBridgeName(bridgeName))); } public Node getBridgeNode(Node node, String bridgeName) { @@ -515,9 +516,7 @@ public class SouthboundUtils { Node bridgeNode = null; ConnectionInfo connectionInfo = getConnectionInfo(ovsdbNode); if (connectionInfo != null) { - InstanceIdentifier bridgeIid = - createInstanceIdentifier(node.key(), name); - bridgeNode = provider.read(LogicalDatastoreType.OPERATIONAL, bridgeIid); + bridgeNode = provider.read(LogicalDatastoreType.OPERATIONAL, createInstanceIdentifier(node.key(), name)); } return bridgeNode; } @@ -537,9 +536,8 @@ public class SouthboundUtils { Node ovsdbNode = null; OvsdbBridgeAugmentation bridgeAugmentation = extractBridgeAugmentation(bridgeNode); if (bridgeAugmentation != null) { - InstanceIdentifier ovsdbNodeIid = - ((DataObjectIdentifier) bridgeAugmentation.getManagedBy().getValue()).toLegacy(); - ovsdbNode = provider.read(LogicalDatastoreType.OPERATIONAL, ovsdbNodeIid); + ovsdbNode = provider.read(LogicalDatastoreType.OPERATIONAL, + (DataObjectIdentifier) bridgeAugmentation.getManagedBy().getValue()); } else { LOG.debug("readOvsdbNode: Provided node is not a bridge node : {}",bridgeNode); } @@ -586,14 +584,14 @@ public class SouthboundUtils { * @return success of bridge addition * @throws InterruptedException */ - public boolean addBridge(final ConnectionInfo connectionInfo, InstanceIdentifier bridgeIid, + public boolean addBridge(final ConnectionInfo connectionInfo, DataObjectIdentifier bridgeIid, final String bridgeName, NodeId bridgeNodeId, final boolean setProtocolEntries, final OvsdbFailModeBase failMode, final boolean setManagedBy, final DatapathTypeBase dpType, final Map externalIds, final Map controllerEntries, final Map otherConfigs, - final String dpid, long timeout) throws InterruptedException { + final String dpid, final long timeout) throws InterruptedException { NodeBuilder bridgeNodeBuilder = new NodeBuilder(); if (bridgeIid == null) { @@ -686,7 +684,7 @@ public class SouthboundUtils { ovsdbBridgeAugmentationBuilder.setDatapathType(DatapathTypeNetdev.VALUE); } - InstanceIdentifier bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName); + final var bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName); Node node = new NodeBuilder() .addAugmentation(ovsdbBridgeAugmentationBuilder.build()) .setNodeId(createManagedNodeId(bridgeIid)) @@ -731,7 +729,7 @@ public class SouthboundUtils { LOG.debug("setBridgeController: ovsdbNode: {}, bridgeNode: {}, controller(s): {}", ovsdbNode, bridgeName, controllers); - InstanceIdentifier bridgeNodeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName); + final var bridgeNodeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName); Node bridgeNode = provider.read(LogicalDatastoreType.CONFIGURATION, bridgeNodeIid); if (bridgeNode == null) { LOG.info("setBridgeController could not find bridge in configuration {}", bridgeNodeIid); @@ -758,7 +756,7 @@ public class SouthboundUtils { return true; } - InstanceIdentifier bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName); + final var bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName); return provider.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, new NodeBuilder(bridgeNode) .addAugmentation(new OvsdbBridgeAugmentationBuilder(bridgeAug) .setControllerEntry(newControllerEntries) @@ -767,9 +765,8 @@ public class SouthboundUtils { } private static void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder, - final ConnectionInfo connectionInfo) { - InstanceIdentifier connectionNodePath = createInstanceIdentifier(connectionInfo); - ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(connectionNodePath.toIdentifier())); + final ConnectionInfo connectionInfo) { + ovsdbBridgeAugmentationBuilder.setManagedBy(new OvsdbNodeRef(createInstanceIdentifier(connectionInfo))); } public boolean addTerminationPoint( @@ -806,9 +803,9 @@ public class SouthboundUtils { tpAugmentationBuilder.setInterfaceExternalIds(builder.build()); } - InstanceIdentifier tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); + final var tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder() - .withKey(InstanceIdentifier.keyOf(tpIid)) + .withKey(tpIid.key()) .addAugmentation(tpAugmentationBuilder.build()) .build()); } @@ -828,15 +825,15 @@ public class SouthboundUtils { tpAugmentationBuilder.setOptions(buildOptions(options)); - InstanceIdentifier tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); + final var tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder() - .withKey(InstanceIdentifier.keyOf(tpIid)) + .withKey(tpIid.key()) .addAugmentation(tpAugmentationBuilder.build()) .build()); } public Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type) { - InstanceIdentifier tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); + final var tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder(); @@ -845,7 +842,7 @@ public class SouthboundUtils { tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type)); } return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder() - .withKey(InstanceIdentifier.keyOf(tpIid)) + .withKey(tpIid.key()) .addAugmentation(tpAugmentationBuilder.build()) .build()); } @@ -1060,14 +1057,9 @@ public class SouthboundUtils { } public OvsdbBridgeAugmentation getBridgeFromConfig(Node node, String bridge) { - OvsdbBridgeAugmentation ovsdbBridgeAugmentation = null; - InstanceIdentifier bridgeIid = - createInstanceIdentifier(node.key(), bridge); - Node bridgeNode = provider.read(LogicalDatastoreType.CONFIGURATION, bridgeIid); - if (bridgeNode != null) { - ovsdbBridgeAugmentation = bridgeNode.augmentation(OvsdbBridgeAugmentation.class); - } - return ovsdbBridgeAugmentation; + Node bridgeNode = provider.read(LogicalDatastoreType.CONFIGURATION, + createInstanceIdentifier(node.key(), bridge)); + return bridgeNode == null ? null : bridgeNode.augmentation(OvsdbBridgeAugmentation.class); } public boolean isOvsdbNodeDpdk(Node ovsdbNode) { @@ -1159,10 +1151,11 @@ public class SouthboundUtils { LOG.error("readTerminationPointAugmentations: Node value is null"); return Collections.emptyList(); } - Node operNode = provider.read(LogicalDatastoreType.OPERATIONAL, InstanceIdentifier - .create(NetworkTopology.class) + Node operNode = provider.read(LogicalDatastoreType.OPERATIONAL, + DataObjectIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) - .child(Node.class, new NodeKey(node.getNodeId()))); + .child(Node.class, new NodeKey(node.getNodeId())) + .build()); if (operNode != null) { return extractTerminationPointAugmentations(operNode); } @@ -1174,9 +1167,10 @@ public class SouthboundUtils { * @return a list of nodes or null if the topology could not found */ public Map getOvsdbNodes() { - InstanceIdentifier inst = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, - new TopologyKey(OVSDB_TOPOLOGY_ID)); - Topology topology = provider.read(LogicalDatastoreType.OPERATIONAL, inst); + Topology topology = provider.read(LogicalDatastoreType.OPERATIONAL, + DataObjectIdentifier.builder(NetworkTopology.class) + .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) + .build()); return topology != null ? topology.getNode() : null; } @@ -1249,7 +1243,7 @@ public class SouthboundUtils { return null; } - public String getDatapathIdFromNodeInstanceId(InstanceIdentifier nodeInstanceId) { + public String getDatapathIdFromNodeInstanceId(DataObjectIdentifier nodeInstanceId) { Node node = provider.read(LogicalDatastoreType.OPERATIONAL, nodeInstanceId); String dpId = node != null ? getDataPathIdStr(node) : null; if (dpId != null) { -- 2.34.1 From b248d9fe47b98fdc50dd80e5173adbd3baafda22 Mon Sep 17 00:00:00 2001 From: jenkins-releng Date: Mon, 22 Sep 2025 10:28:12 +0000 Subject: [PATCH 3/3] Release Validate --- commons/binding-parent/pom.xml | 2 +- commons/it/pom.xml | 2 +- commons/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-api/pom.xml | 4 ++-- hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound-api/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound-rest/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound-test/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound-ui/pom.xml | 2 +- .../odl-ovsdb-hwvtepsouthbound/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-features/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-it/pom.xml | 2 +- hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml | 2 +- hwvtepsouthbound/pom.xml | 2 +- library/artifacts/pom.xml | 2 +- library/features/features/pom.xml | 2 +- library/features/odl-ovsdb-library/pom.xml | 2 +- library/features/pom.xml | 2 +- library/impl/pom.xml | 4 ++-- library/it/pom.xml | 6 +++--- library/karaf/pom.xml | 2 +- library/pom.xml | 2 +- pom.xml | 2 +- schemas/hardwarevtep/pom.xml | 4 ++-- schemas/openvswitch/pom.xml | 4 ++-- schemas/pom.xml | 2 +- southbound/pom.xml | 2 +- southbound/southbound-api/pom.xml | 4 ++-- southbound/southbound-artifacts/pom.xml | 2 +- southbound/southbound-features/features/pom.xml | 2 +- .../southbound-features/odl-ovsdb-southbound-api/pom.xml | 2 +- .../odl-ovsdb-southbound-impl-rest/pom.xml | 2 +- .../odl-ovsdb-southbound-impl-ui/pom.xml | 2 +- .../southbound-features/odl-ovsdb-southbound-impl/pom.xml | 2 +- .../southbound-features/odl-ovsdb-southbound-test/pom.xml | 2 +- southbound/southbound-features/pom.xml | 2 +- southbound/southbound-impl/pom.xml | 2 +- southbound/southbound-it/pom.xml | 2 +- southbound/southbound-karaf/pom.xml | 2 +- utils/config/pom.xml | 4 ++-- utils/hwvtepsouthbound-utils/pom.xml | 4 ++-- utils/mdsal-utils/pom.xml | 2 +- utils/odl-ovsdb-utils/pom.xml | 2 +- utils/ovsdb-it-utils/pom.xml | 2 +- utils/pom.xml | 2 +- utils/servicehelper/pom.xml | 4 ++-- utils/southbound-utils/pom.xml | 2 +- utils/yang-utils/pom.xml | 2 +- 50 files changed, 60 insertions(+), 60 deletions(-) diff --git a/commons/binding-parent/pom.xml b/commons/binding-parent/pom.xml index dd7de44f9..c036ca9fe 100644 --- a/commons/binding-parent/pom.xml +++ b/commons/binding-parent/pom.xml @@ -17,7 +17,7 @@ org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/commons/it/pom.xml b/commons/it/pom.xml index ceb066a2a..a1eb31678 100644 --- a/commons/it/pom.xml +++ b/commons/it/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb it - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/commons/pom.xml b/commons/pom.xml index 34aca8ab6..34f297700 100644 --- a/commons/pom.xml +++ b/commons/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb parents - 1.21.0-SNAPSHOT + 1.21.0 ODL :: ovsdb :: ${project.artifactId} diff --git a/hwvtepsouthbound/hwvtepsouthbound-api/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-api/pom.xml index bb448e222..bbe86cd82 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-api/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-api/pom.xml @@ -10,14 +10,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent 4.0.0 org.opendaylight.ovsdb hwvtepsouthbound-api - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml index 25f0582fd..91a4bec20 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-artifacts/pom.xml @@ -19,7 +19,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb hwvtepsouthbound-artifacts - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml index 426563d22..c4621ffb0 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/features/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb hwvtepsouthbound-features - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml index 71a779a41..083de6f75 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-api/pom.xml @@ -11,7 +11,7 @@ org.opendaylight.ovsdb odl-ovsdb-hwvtepsouthbound-api - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml index 0d9d6671d..3a34c8db0 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-features/odl-ovsdb-hwvtepsouthbound-rest/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb odl-ovsdb-hwvtepsouthbound-rest - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml index 37459cc24..3c9b1fbbd 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-impl/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent diff --git a/hwvtepsouthbound/hwvtepsouthbound-it/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-it/pom.xml index 73caeb8eb..3f106b319 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-it/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-it/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb it - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/it diff --git a/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml b/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml index 4bf06b5d3..8172f7feb 100644 --- a/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml +++ b/hwvtepsouthbound/hwvtepsouthbound-karaf/pom.xml @@ -15,7 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL 4.0.0 org.opendaylight.ovsdb hwvtepsouthbound-karaf - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/hwvtepsouthbound/pom.xml b/hwvtepsouthbound/pom.xml index fee019496..64960da4d 100644 --- a/hwvtepsouthbound/pom.xml +++ b/hwvtepsouthbound/pom.xml @@ -17,7 +17,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.ovsdb hwvtepsouthbound-aggregator - 1.21.0-SNAPSHOT + 1.21.0 ODL :: ovsdb :: ${project.artifactId} diff --git a/library/artifacts/pom.xml b/library/artifacts/pom.xml index 64e07e28c..793c743cc 100644 --- a/library/artifacts/pom.xml +++ b/library/artifacts/pom.xml @@ -19,7 +19,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb library-artifacts - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/library/features/features/pom.xml b/library/features/features/pom.xml index 20d932c07..93ed9cbd5 100644 --- a/library/features/features/pom.xml +++ b/library/features/features/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb library-features - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/library/features/odl-ovsdb-library/pom.xml b/library/features/odl-ovsdb-library/pom.xml index 1027f9a8b..5a86f229a 100644 --- a/library/features/odl-ovsdb-library/pom.xml +++ b/library/features/odl-ovsdb-library/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb odl-ovsdb-library - 1.21.0-SNAPSHOT + 1.21.0 feature ODL :: ovsdb :: ${project.artifactId} diff --git a/library/impl/pom.xml b/library/impl/pom.xml index 49998cbd5..0fe91f0ab 100644 --- a/library/impl/pom.xml +++ b/library/impl/pom.xml @@ -12,14 +12,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent 4.0.0 org.opendaylight.ovsdb library - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/library/it/pom.xml b/library/it/pom.xml index d56d180ef..c9338da76 100644 --- a/library/it/pom.xml +++ b/library/it/pom.xml @@ -11,14 +11,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb it - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/it 4.0.0 org.opendaylight.ovsdb library-it - 1.21.0-SNAPSHOT + 1.21.0 jar @@ -27,7 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb library-karaf - 1.21.0-SNAPSHOT + 1.21.0 zip diff --git a/library/karaf/pom.xml b/library/karaf/pom.xml index 03c0b083d..07771d2ee 100644 --- a/library/karaf/pom.xml +++ b/library/karaf/pom.xml @@ -15,7 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL 4.0.0 org.opendaylight.ovsdb library-karaf - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/library/pom.xml b/library/pom.xml index 65d6b9447..d82e025b5 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -17,7 +17,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb library-aggregator - 1.21.0-SNAPSHOT + 1.21.0 ODL :: ovsdb :: ${project.artifactId} diff --git a/pom.xml b/pom.xml index 2046edd1e..8c49f8729 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb - 1.21.0-SNAPSHOT + 1.21.0 ${project.artifactId} pom diff --git a/schemas/hardwarevtep/pom.xml b/schemas/hardwarevtep/pom.xml index 99f2ce62a..2a1f78cdb 100644 --- a/schemas/hardwarevtep/pom.xml +++ b/schemas/hardwarevtep/pom.xml @@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent org.opendaylight.ovsdb schema.hardwarevtep - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/schemas/openvswitch/pom.xml b/schemas/openvswitch/pom.xml index 88317e50d..0eafaad9d 100644 --- a/schemas/openvswitch/pom.xml +++ b/schemas/openvswitch/pom.xml @@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent org.opendaylight.ovsdb schema.openvswitch - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/schemas/pom.xml b/schemas/pom.xml index a7adddaed..a7fa4d449 100644 --- a/schemas/pom.xml +++ b/schemas/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb schemas - 1.21.0-SNAPSHOT + 1.21.0 ODL :: ovsdb :: ${project.artifactId} diff --git a/southbound/pom.xml b/southbound/pom.xml index 96bbc80bd..b266dcd54 100644 --- a/southbound/pom.xml +++ b/southbound/pom.xml @@ -16,7 +16,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL org.opendaylight.ovsdb southbound-aggregator - 1.21.0-SNAPSHOT + 1.21.0 ODL :: ovsdb :: ${project.artifactId} diff --git a/southbound/southbound-api/pom.xml b/southbound/southbound-api/pom.xml index 1858bb419..d677ede12 100644 --- a/southbound/southbound-api/pom.xml +++ b/southbound/southbound-api/pom.xml @@ -10,14 +10,14 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent 4.0.0 org.opendaylight.ovsdb southbound-api - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/southbound/southbound-artifacts/pom.xml b/southbound/southbound-artifacts/pom.xml index de7846880..48256b476 100644 --- a/southbound/southbound-artifacts/pom.xml +++ b/southbound/southbound-artifacts/pom.xml @@ -19,7 +19,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb southbound-artifacts - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/southbound/southbound-features/features/pom.xml b/southbound/southbound-features/features/pom.xml index ed1fa02aa..c1a2e8664 100644 --- a/southbound/southbound-features/features/pom.xml +++ b/southbound/southbound-features/features/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb southbound-features - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml index 80ef48e2b..db254c548 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-api/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb odl-ovsdb-southbound-api - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml b/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml index 65e1f06de..0234ce658 100644 --- a/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml +++ b/southbound/southbound-features/odl-ovsdb-southbound-impl-rest/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb odl-ovsdb-southbound-impl-rest - 1.21.0-SNAPSHOT + 1.21.0 feature ODL :: ovsdb :: ${project.artifactId} diff --git a/southbound/southbound-impl/pom.xml b/southbound/southbound-impl/pom.xml index 445789ec4..0a3b110f7 100644 --- a/southbound/southbound-impl/pom.xml +++ b/southbound/southbound-impl/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent diff --git a/southbound/southbound-it/pom.xml b/southbound/southbound-it/pom.xml index fd146668b..31f2319ea 100644 --- a/southbound/southbound-it/pom.xml +++ b/southbound/southbound-it/pom.xml @@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb it - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/it 4.0.0 diff --git a/southbound/southbound-karaf/pom.xml b/southbound/southbound-karaf/pom.xml index 13c258d30..0744193bb 100644 --- a/southbound/southbound-karaf/pom.xml +++ b/southbound/southbound-karaf/pom.xml @@ -15,7 +15,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL 4.0.0 org.opendaylight.ovsdb southbound-karaf - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/utils/config/pom.xml b/utils/config/pom.xml index be6174cd5..852ae6f1a 100644 --- a/utils/config/pom.xml +++ b/utils/config/pom.xml @@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent org.opendaylight.ovsdb utils.config - 1.21.0-SNAPSHOT + 1.21.0 ODL :: ovsdb :: ${project.artifactId} diff --git a/utils/hwvtepsouthbound-utils/pom.xml b/utils/hwvtepsouthbound-utils/pom.xml index 09c0955af..e38009edf 100644 --- a/utils/hwvtepsouthbound-utils/pom.xml +++ b/utils/hwvtepsouthbound-utils/pom.xml @@ -11,13 +11,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent org.opendaylight.ovsdb utils.hwvtepsouthbound-utils - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/utils/mdsal-utils/pom.xml b/utils/mdsal-utils/pom.xml index 4e961f0af..0c1297689 100644 --- a/utils/mdsal-utils/pom.xml +++ b/utils/mdsal-utils/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent diff --git a/utils/odl-ovsdb-utils/pom.xml b/utils/odl-ovsdb-utils/pom.xml index dd14da4b6..cd56eaf6a 100644 --- a/utils/odl-ovsdb-utils/pom.xml +++ b/utils/odl-ovsdb-utils/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb odl-ovsdb-utils - 1.21.0-SNAPSHOT + 1.21.0 feature diff --git a/utils/ovsdb-it-utils/pom.xml b/utils/ovsdb-it-utils/pom.xml index 3ce5cb4af..6a3d66d07 100644 --- a/utils/ovsdb-it-utils/pom.xml +++ b/utils/ovsdb-it-utils/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent diff --git a/utils/pom.xml b/utils/pom.xml index 775a7eb8d..22d184709 100644 --- a/utils/pom.xml +++ b/utils/pom.xml @@ -18,7 +18,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb utils - 1.21.0-SNAPSHOT + 1.21.0 pom diff --git a/utils/servicehelper/pom.xml b/utils/servicehelper/pom.xml index 1cd1b45b9..cc5a3f95f 100644 --- a/utils/servicehelper/pom.xml +++ b/utils/servicehelper/pom.xml @@ -12,13 +12,13 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent org.opendaylight.ovsdb utils.servicehelper - 1.21.0-SNAPSHOT + 1.21.0 bundle diff --git a/utils/southbound-utils/pom.xml b/utils/southbound-utils/pom.xml index fcf475a0e..7f4a8b06e 100644 --- a/utils/southbound-utils/pom.xml +++ b/utils/southbound-utils/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent diff --git a/utils/yang-utils/pom.xml b/utils/yang-utils/pom.xml index 7de0da12f..14a56e546 100644 --- a/utils/yang-utils/pom.xml +++ b/utils/yang-utils/pom.xml @@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html org.opendaylight.ovsdb ovsdb-binding-parent - 1.21.0-SNAPSHOT + 1.21.0 ../../commons/binding-parent -- 2.34.1