Update MRI projects for Aluminium 81/89581/10
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 27 May 2020 16:22:34 +0000 (18:22 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 31 May 2020 18:11:03 +0000 (20:11 +0200)
This bumps versions to the following:
- odlparent-7.0.2
- yangtools-5.0.2
- mdsal-6.0.1
- controller-2.0.1

Change-Id: I376f6152857682a9c9f7094a00324787d2666640
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Lori Jakab <lojakab@cisco.com>
36 files changed:
artifacts/pom.xml
commons/parent/pom.xml
features/features-lispflowmapping/pom.xml
features/odl-lispflowmapping-inmemorydb/pom.xml
features/odl-lispflowmapping-mappingservice-shell/pom.xml
features/odl-lispflowmapping-mappingservice/pom.xml
features/odl-lispflowmapping-models/pom.xml
features/odl-lispflowmapping-msmr/pom.xml
features/odl-lispflowmapping-neutron/pom.xml
features/odl-lispflowmapping-southbound/pom.xml
features/odl-lispflowmapping-southbound/src/main/feature/feature.xml
features/pom.xml
integrationtest/pom.xml
integrationtest/src/test/java/org/opendaylight/lispflowmapping/integrationtest/MappingServiceIntegrationTest.java
lispflowmapping-karaf/pom.xml
mappingservice/api/pom.xml
mappingservice/dsbackend/pom.xml
mappingservice/dsbackend/src/main/java/org/opendaylight/lispflowmapping/dsbackend/DataStoreBackEnd.java
mappingservice/dsbackend/src/test/java/org/opendaylight/lispflowmapping/dsbackend/DataStoreBackEndTest.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/LispMappingService.java
mappingservice/implementation/src/main/java/org/opendaylight/lispflowmapping/implementation/util/MappingMergeUtil.java
mappingservice/implementation/src/test/java/org/opendaylight/lispflowmapping/implementation/util/MappingMergeUtilTest.java
mappingservice/lisp-proto/pom.xml
mappingservice/lisp-proto/src/main/java/org/opendaylight/lispflowmapping/lisp/serializer/MapReplySerializer.java
mappingservice/lisp-proto/src/main/yang/odl-lisp-proto.yang
mappingservice/lisp-proto/src/test/java/org/opendaylight/lispflowmapping/lisp/util/LispAddressStringifierTest.java
mappingservice/lisp-proto/src/test/java/org/opendaylight/lispflowmapping/serializer/address/ExplicitLocatorPathSerializerTest.java
mappingservice/neutron/pom.xml
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/PortDataProcessor.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/listener/VppEndpointListener.java
mappingservice/neutron/src/main/java/org/opendaylight/lispflowmapping/neutron/intenthandler/util/VppNodeReader.java
mappingservice/neutron/src/test/java/org/opendaylight/lispflowmapping/neutron/PortDataProcessorTest.java
mappingservice/pom.xml
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/AuthenticationKeyDataListener.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java
mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandlerTest.java

index fc8d468e6856631ff16205340331a9d27f54e6e4..a8d4e5d728ff5b547920507182ed551249bd5d11 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
index ceba0549d37a695983725eab04e3674ae35b0fa7..ad16ea8853ef8299659dba8976adbce2d2e43ba4 100644 (file)
@@ -15,7 +15,7 @@
          for plugin configuration etc. -->
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -48,7 +48,7 @@
       <dependency>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>5.0.9</version>
+        <version>6.0.1</version>
         <type>pom</type>
        <scope>import</scope>
       </dependency>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.controller</groupId>
-        <artifactId>config-artifacts</artifactId>
-        <version>0.12.0</version>
-        <type>pom</type>
-        <scope>import</scope>
-      </dependency>
-      <dependency>
-        <groupId>org.opendaylight.controller</groupId>
-        <artifactId>mdsal-artifacts</artifactId>
-        <version>1.11.0</version>
+        <artifactId>controller-artifacts</artifactId>
+        <version>2.0.1</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index 99b5d0db2a5a318a28edec1445ee21cca939b4e2..20202423e75564b043fb2c7fd7bc63c935247a3c 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>feature-repo-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
index 579153ce5845e9964ecc4679dc8763c44b52cc10..2a049949bb4070dded1b4fa119931174a387f008 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -28,7 +28,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>odl-mdsal-broker</artifactId>
-      <version>1.11.0</version>
+      <version>2.0.1</version>
       <type>xml</type>
       <classifier>features</classifier>
     </dependency>
index e964e8afe61243768b64141066f93b1121686bed..61b86f51fe27a18dde7a5b830c49e8cba10beec8 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
index 9f146b8d5ffa415bb0b65f94307dc824e08eb812..948f972bfc665576607b306aa5a93d34c720215a 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -35,7 +35,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>odl-mdsal-broker</artifactId>
-      <version>1.11.0</version>
+      <version>2.0.1</version>
       <type>xml</type>
       <classifier>features</classifier>
     </dependency>
index fafe3911510818ca6c53caf4d119b7460a2b47a4..adaf614cf59fa230b2180595f694cb1c2bcf53ec 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -29,7 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>5.0.9</version>
+        <version>6.0.1</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index 93b01becdcb49c043dc05d757d5225d17f1fc69c..fbdf7ed5a003292786426ead1597505a38c1559d 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
index a5ac6f92290021f41d324b4667d831e53335666c..c2f3cc4b7ce6c14e7e3714b2e93c0a980200b35c 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -29,7 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
       <dependency>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>5.0.9</version>
+        <version>6.0.1</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index 28fda91c6531f0c47b05ef5ad26cd33241d0958d..0e607faa0c46f83a06cc91f33ca78548c2ff7a10 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>single-feature-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -35,7 +35,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>odl-mdsal-broker</artifactId>
-      <version>1.11.0</version>
+      <version>2.0.1</version>
       <type>xml</type>
       <classifier>features</classifier>
     </dependency>
index 26fdada85feb5330d19aaea6cc652ed1069c2664..9dde01ee3b2b51830870386a8f4edaea00f48c16 100644 (file)
@@ -8,7 +8,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
 -->
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-lispflowmapping-southbound">
     <feature name="odl-lispflowmapping-southbound">
-        <feature version="[6,7)">odl-netty-4</feature>
-        <feature version="[6,7)">odl-guava</feature>
+        <feature version="[7,8)">odl-netty-4</feature>
+        <feature version="[7,8)">odl-guava</feature>
     </feature>
 </features>
index 20f546b2aba98a579c037f5471dfe95d6475f1f2..118d410cabca1b90e11f4abaa1c012b47802d66b 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
index b791b52fd4c89a06e0151a2b9fc8fe85d6a88253..02cf41d9b709b4aaa00bb6e3c7cbd140ca8fb0bf 100644 (file)
@@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.controller</groupId>
     <artifactId>mdsal-it-parent</artifactId>
-    <version>1.11.0</version>
+    <version>2.0.1</version>
     <relativePath/>
   </parent>
 
index 8365f3f44d4db3bf12132cbbfb74bd267c43fc10..b32cc66594095cf80b8bf10c75d5974881056671 100644 (file)
@@ -1707,7 +1707,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         sendMapRequest(mapRequest);
         MapReply mapReply = receiveMapReply();
         assertEquals(4, mapReply.getNonce().longValue());
-        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().size());
+        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().nonnullLocatorRecord().size());
         MapRegister mapRegister = MappingServiceIntegrationTestUtil.getDefaultMapRegisterBuilder(eid).build();
         sendMapRegister(mapRegister);
         MapNotify mapNotify = receiveMapNotify();
@@ -2304,7 +2304,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         mapRequest.getEidItem().add(new EidItemBuilder().setEid(unMatchedAddress).build());
         sendMapRequest(mapRequest.build());
         mapReply = receiveMapReply();
-        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().size());
+        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().nonnullLocatorRecord().size());
     }
 /*
     // This registers an IP with a MapRegister, then adds a password via the
@@ -2730,7 +2730,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         sendMapRequest(mapRequest);
         MapReply mapReply = receiveMapReply();
         assertEquals(4, mapReply.getNonce().longValue());
-        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().size());
+        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().nonnullLocatorRecord().size());
 
         MapRegister mapRegister = MappingServiceIntegrationTestUtil.getDefaultMapRegisterBuilder(eid).build();
         sendMapRegister(mapRegister);
@@ -2747,7 +2747,7 @@ public class MappingServiceIntegrationTest extends AbstractMdsalTestBase {
         causeEntryToBeCleaned();
         sendMapRequest(mapRequest);
         mapReply = receiveMapReply();
-        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().getLocatorRecord().size());
+        assertEquals(0, mapReply.getMappingRecordItem().get(0).getMappingRecord().nonnullLocatorRecord().size());
     }
 
     public void mapRequestMapRegisterAndMapRequestTestNativelyForwardTimeoutResponse() throws Exception {
index ac6987ca45c93322c7d760dae2873c61f55ca8b5..f098ccee1e659f1c1f36402be020d5e08fc9cb2a 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
index dff6df0ed918302e76aa1e262e448955b27c7330..88c778eab71930418667f8c4c01ff0eaea4e1e2c 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.9</version>
+    <version>6.0.1</version>
     <relativePath/>
   </parent>
 
index b8bf0b4030f6eb874ea1751abdd108490ac17473..6faa9cad86bc3ae7b45cf703c9df63bbd0e18537 100644 (file)
@@ -36,8 +36,8 @@
       <artifactId>mdsal-binding-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>javax.xml.bind</groupId>
-      <artifactId>jaxb-api</artifactId>
+      <groupId>jakarta.xml.bind</groupId>
+      <artifactId>jakarta.xml.bind-api</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
index 66a62ee88e8e010c0924f9c2e7d074277bacdb3f..abcb493ee83ab733dfa3ac413058d7b684561f12 100644 (file)
@@ -196,8 +196,8 @@ public class DataStoreBackEnd implements TransactionChainListener {
         MappingDatabase mdb = readTransaction(DATABASE_ROOT, logicalDataStore);
 
         if (mdb != null && mdb.getVirtualNetworkIdentifier() != null) {
-            for (VirtualNetworkIdentifier id : mdb.getVirtualNetworkIdentifier()) {
-                List<Mapping> ms = id.getMapping();
+            for (VirtualNetworkIdentifier id : mdb.nonnullVirtualNetworkIdentifier().values()) {
+                List<Mapping> ms = new ArrayList<>(id.nonnullMapping().values());
                 if (ms != null) {
                     mappings.addAll(ms);
                 }
@@ -213,8 +213,8 @@ public class DataStoreBackEnd implements TransactionChainListener {
         MappingDatabase mdb = readTransaction(DATABASE_ROOT, LogicalDatastoreType.CONFIGURATION);
 
         if (mdb != null && mdb.getVirtualNetworkIdentifier() != null) {
-            for (VirtualNetworkIdentifier id : mdb.getVirtualNetworkIdentifier()) {
-                List<AuthenticationKey> keys = id.getAuthenticationKey();
+            for (VirtualNetworkIdentifier id : mdb.nonnullVirtualNetworkIdentifier().values()) {
+                List<AuthenticationKey> keys = new ArrayList<>(id.nonnullAuthenticationKey().values());
                 if (keys != null) {
                     authKeys.addAll(keys);
                 }
@@ -258,7 +258,8 @@ public class DataStoreBackEnd implements TransactionChainListener {
     private <U extends org.opendaylight.yangtools.yang.binding.DataObject> void writePutTransaction(
             InstanceIdentifier<U> addIID, U data, LogicalDatastoreType logicalDatastoreType, String errMsg) {
         WriteTransaction writeTx = txChain.newWriteOnlyTransaction();
-        writeTx.put(logicalDatastoreType, addIID, data, true);
+        // TODO: is is a utility method, hence we do not have enough lifecycle knowledge to use plain put()
+        writeTx.mergeParentStructurePut(logicalDatastoreType, addIID, data);
         writeTx.commit().addCallback(new FutureCallback<CommitInfo>() {
 
             @Override
index 0659bcfc29189aeefaac7af2df79084e6e2122c5..4c9147cbeead7ad351bc1f58fe62eafe15c5ca3c 100644 (file)
@@ -9,9 +9,10 @@ package org.opendaylight.lispflowmapping.dsbackend;
 
 import static org.junit.Assert.assertEquals;
 
-import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.FluentFuture;
 import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.Optional;
 import javax.xml.bind.DatatypeConverter;
 import org.junit.Before;
@@ -51,8 +52,10 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev15090
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.mapping.XtrIdMappingKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifier;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.mapping.database.VirtualNetworkIdentifierKey;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
 import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PowerMockIgnore;
 import org.powermock.core.classloader.annotations.PrepareForTest;
@@ -112,8 +115,8 @@ public class DataStoreBackEndTest {
         final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
 
         dataStoreBackEnd.addAuthenticationKey(authenticationKey);
-        Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture(),
-                Mockito.eq(authenticationKey), Mockito.eq(true));
+        Mockito.verify(wTxMock).mergeParentStructurePut(Mockito.eq(LogicalDatastoreType.CONFIGURATION),
+                iidCaptorAuthKey.capture(), Mockito.eq(authenticationKey));
 
         // result
         AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
@@ -130,8 +133,8 @@ public class DataStoreBackEndTest {
                 .setOrigin(MappingOrigin.Northbound).build();
 
         dataStoreBackEnd.addMapping(mapping);
-        Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorMapping.capture(),
-                Mockito.eq(mapping), Mockito.eq(true));
+        Mockito.verify(wTxMock).mergeParentStructurePut(Mockito.eq(LogicalDatastoreType.CONFIGURATION),
+                iidCaptorMapping.capture(), Mockito.eq(mapping));
 
         // result
         MappingKey result = iidCaptorMapping.getValue().firstKeyOf(Mapping.class);
@@ -149,8 +152,8 @@ public class DataStoreBackEndTest {
                 .setMappingRecord(getDefaultMappingRecordBuilder().build()).build();
 
         dataStoreBackEnd.addXtrIdMapping(xtrIdMapping);
-        Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.OPERATIONAL), iidCaptorXtrIdMapping.capture(),
-                Mockito.eq(xtrIdMapping), Mockito.eq(true));
+        Mockito.verify(wTxMock).mergeParentStructurePut(Mockito.eq(LogicalDatastoreType.OPERATIONAL),
+                iidCaptorXtrIdMapping.capture(), Mockito.eq(xtrIdMapping));
 
         // result
         XtrIdMappingKey xtrIdResult = iidCaptorXtrIdMapping.getValue().firstKeyOf(XtrIdMapping.class);
@@ -223,8 +226,8 @@ public class DataStoreBackEndTest {
         final AuthenticationKey authenticationKey = getDefaultAuthenticationKeyBuilder().build();
 
         dataStoreBackEnd.updateAuthenticationKey(authenticationKey);
-        Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorAuthKey.capture(),
-                Mockito.eq(authenticationKey), Mockito.eq(true));
+        Mockito.verify(wTxMock).mergeParentStructurePut(Mockito.eq(LogicalDatastoreType.CONFIGURATION),
+                iidCaptorAuthKey.capture(), Mockito.eq(authenticationKey));
 
         // result
         AuthenticationKeyKey result = iidCaptorAuthKey.getValue().firstKeyOf(AuthenticationKey.class);
@@ -241,8 +244,8 @@ public class DataStoreBackEndTest {
                 .setOrigin(MappingOrigin.Northbound).build();
 
         dataStoreBackEnd.updateMapping(mapping);
-        Mockito.verify(wTxMock).put(Mockito.eq(LogicalDatastoreType.CONFIGURATION), iidCaptorMapping.capture(),
-                Mockito.eq(mapping), Mockito.eq(true));
+        Mockito.verify(wTxMock).mergeParentStructurePut(Mockito.eq(LogicalDatastoreType.CONFIGURATION),
+                iidCaptorMapping.capture(), Mockito.eq(mapping));
 
         // result
         MappingKey result = iidCaptorMapping.getValue().firstKeyOf(Mapping.class);
@@ -321,7 +324,8 @@ public class DataStoreBackEndTest {
         return new AuthenticationKeyBuilder()
                 .withKey(new AuthenticationKeyKey(new EidUri(DUMMY_URI)))
                 .setEid(EID_IPV4_1)
-                .setMappingAuthkey(new MappingAuthkeyBuilder().setKeyString("password").setKeyType(0).build());
+                .setMappingAuthkey(new MappingAuthkeyBuilder().setKeyString("password").setKeyType(Uint16.valueOf(0))
+                .build());
     }
 
     private static MappingDatabaseBuilder getDefaultMappingDatabase() {
@@ -334,6 +338,13 @@ public class DataStoreBackEndTest {
         final Mapping mapping_4 = new MappingBuilder()
                 .setMappingRecord(getDefaultMappingRecordBuilder().setEid(EID_IPV4_4).build()).build();
 
+        final Map<MappingKey, Mapping> mappingEntries_1 = new LinkedHashMap<>();
+        mappingEntries_1.put(new MappingKey(new EidUri("uri-1"), MappingOrigin.Northbound), mapping_1);
+        mappingEntries_1.put(new MappingKey(new EidUri("uri-2"), MappingOrigin.Northbound), mapping_2);
+        final Map<MappingKey, Mapping> mappingEntries_2 = new LinkedHashMap<>();
+        mappingEntries_2.put(new MappingKey(new EidUri("uri-3"), MappingOrigin.Northbound), mapping_3);
+        mappingEntries_2.put(new MappingKey(new EidUri("uri-4"), MappingOrigin.Northbound), mapping_4);
+
         final AuthenticationKey authenticationKey_1 = new AuthenticationKeyBuilder()
                 .withKey(new AuthenticationKeyKey(new EidUri("uri-1"))).build();
         final AuthenticationKey authenticationKey_2 = new AuthenticationKeyBuilder()
@@ -343,14 +354,26 @@ public class DataStoreBackEndTest {
         final AuthenticationKey authenticationKey_4 = new AuthenticationKeyBuilder()
                 .withKey(new AuthenticationKeyKey(new EidUri("uri-4"))).build();
 
+        final Map<AuthenticationKeyKey, AuthenticationKey> authKey_1 = new LinkedHashMap<>();
+        authKey_1.put(new AuthenticationKeyKey(new EidUri("uri-1")), authenticationKey_1);
+        authKey_1.put(new AuthenticationKeyKey(new EidUri("uri-2")), authenticationKey_2);
+        final Map<AuthenticationKeyKey, AuthenticationKey> authKey_2 = new LinkedHashMap<>();
+        authKey_2.put(new AuthenticationKeyKey(new EidUri("uri-3")), authenticationKey_3);
+        authKey_2.put(new AuthenticationKeyKey(new EidUri("uri-4")), authenticationKey_4);
+
         final VirtualNetworkIdentifier vni_1 = new VirtualNetworkIdentifierBuilder()
                 .setVni(new VniUri("vni/uri/1"))
-                .setMapping(Lists.newArrayList(mapping_1, mapping_2))
-                .setAuthenticationKey(Lists.newArrayList(authenticationKey_1, authenticationKey_2)).build();
+                .setMapping(mappingEntries_1)
+                .setAuthenticationKey(authKey_1).build();
         final VirtualNetworkIdentifier vni_2 = new VirtualNetworkIdentifierBuilder()
                 .setVni(new VniUri("vni/uri/2"))
-                .setMapping(Lists.newArrayList(mapping_3, mapping_4))
-                .setAuthenticationKey(Lists.newArrayList(authenticationKey_3, authenticationKey_4)).build();
-        return new MappingDatabaseBuilder().setVirtualNetworkIdentifier(Lists.newArrayList(vni_1, vni_2));
+                .setMapping(mappingEntries_2)
+                .setAuthenticationKey(authKey_2).build();
+
+        final Map<VirtualNetworkIdentifierKey, VirtualNetworkIdentifier> vniEntries = new LinkedHashMap<>();
+        vniEntries.put(new VirtualNetworkIdentifierKey(new VniUri("vni/uri/1")), vni_1);
+        vniEntries.put(new VirtualNetworkIdentifierKey(new VniUri("vni/uri/2")), vni_2);
+
+        return new MappingDatabaseBuilder().setVirtualNetworkIdentifier(vniEntries);
     }
 }
index c14f74f7fd589f73e71386ee60894b9e0ddc8e49..6624f6b2da0105f74f70511315742270491ae0ba 100644 (file)
@@ -233,7 +233,7 @@ public class LispMappingService implements IFlowMapping, IMapRequestResultHandle
     @Override
     public void onMappingKeepAlive(MappingKeepAlive notification) {
         final MapRegisterCacheMetadata cacheMetadata = notification.getMapRegisterCacheMetadata();
-        for (EidLispAddress eidLispAddress : cacheMetadata.getEidLispAddress()) {
+        for (EidLispAddress eidLispAddress : cacheMetadata.nonnullEidLispAddress().values()) {
             final Eid eid = eidLispAddress.getEid();
             final XtrId xtrId = cacheMetadata.getXtrId();
             final Long timestamp = cacheMetadata.getTimestamp();
index 540d08a5500c47acbaf407f3a08ce3898500b4bf..a62ff90d7567a31e9fdfcc6c29973e2052bf2970 100644 (file)
@@ -287,7 +287,7 @@ public final class MappingMergeUtil {
             return null;
         }
 
-        List<LocatorRecord> sbLocators = sbMapping.getLocatorRecord();
+        List<LocatorRecord> sbLocators = sbMapping.nonnullLocatorRecord();
 
         // We assume locators are unique and don't show up several times (with different or identical p/w/mp/mw),
         // so we create a HashMap of the locators from the SB mapping record, keyed by the Rloc
index 71a5197cc75dd6f17f3f286b484ca1b82ba45007..63327b27dbaabb3e93abad138d05a58530a1cfbe 100644 (file)
@@ -183,7 +183,7 @@ public class MappingMergeUtilTest {
 
         // result
         MappingData result = MappingMergeUtil.computeNbSbIntersection(nbMappingData, sbMappingData);
-        assertEquals(0, result.getRecord().getLocatorRecord().size());
+        assertTrue(result.getRecord().nonnullLocatorRecord().isEmpty());
     }
 
     /**
index fbb8ce6f39da5d046304254d848e4f98e8bfc7ac..ecd80ba6d01408202556ad623c2dd265692e2d0f 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.9</version>
+    <version>6.0.1</version>
     <relativePath/>
   </parent>
 
index de90b60852fb685128606b42c8384fe8f6f79e24..f38650bf5703607b02133155a8f84810074c6b08 100644 (file)
@@ -36,7 +36,7 @@ public final class MapReplySerializer {
 
     public ByteBuffer serialize(MapReply mapReply) {
         int size = Length.HEADER_SIZE;
-        for (MappingRecordItem eidToLocatorRecord : mapReply.getMappingRecordItem()) {
+        for (MappingRecordItem eidToLocatorRecord : mapReply.nonnullMappingRecordItem()) {
             size += MappingRecordSerializer.getInstance().getSerializationSize(eidToLocatorRecord.getMappingRecord());
         }
 
@@ -55,7 +55,7 @@ public final class MapReplySerializer {
         }
         replyBuffer.putLong(NumberUtil.asLong(mapReply.getNonce()));
         if (mapReply.getMappingRecordItem() != null) {
-            for (MappingRecordItem eidToLocatorRecord : mapReply.getMappingRecordItem()) {
+            for (MappingRecordItem eidToLocatorRecord : mapReply.nonnullMappingRecordItem()) {
                 MappingRecordSerializer.getInstance().serialize(replyBuffer, eidToLocatorRecord.getMappingRecord());
             }
         }
index de88a6956bf4e4d272e6126a576514581c23cf2e..05ab2dc0d6fbbbcbb4d2cca29c2fee9df2746d1b 100644 (file)
@@ -76,6 +76,7 @@ module odl-lisp-proto {
     grouping eid-list {
         list eid-item {
             key "eid-item-id";
+            ordered-by user;
             leaf eid-item-id {
                 type string;
             }
@@ -86,6 +87,7 @@ module odl-lisp-proto {
     grouping LocatorRecords {
         list LocatorRecord {
             key "locator-id";
+            ordered-by user;
             leaf locator-id {
                 type string;
             }
@@ -192,6 +194,7 @@ module odl-lisp-proto {
     grouping mapping-record-list {
         list mapping-record-item {
             key "mapping-record-item-id";
+            ordered-by user;
             leaf mapping-record-item-id {
                 type string;
             }
@@ -284,6 +287,7 @@ module odl-lisp-proto {
         }
         list itrRloc {
             key "itr-rloc-id";
+            ordered-by user;
             leaf itr-rloc-id {
                 type string;
             }
index eb14c4599ecf7f7ca238cfecd87a7a85f8a1da80..eea5e1338abe1042a3b5c89fd0702d04c3591342 100644 (file)
@@ -188,12 +188,6 @@ public class LispAddressStringifierTest {
             .withKey(new HopKey("hop_2"))
             .setLrsBits(new Hop.LrsBits(true, true, true)).build();
     private static final List<Hop> HOP_LIST = new ArrayList<>();
-    private static final ExplicitLocatorPath EXPLICIT_LOCATOR_PATH = new ExplicitLocatorPathBuilder()
-            .setExplicitLocatorPath(new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types
-                    .rev151105.lisp.address.address.explicit.locator.path.ExplicitLocatorPathBuilder().setHop(HOP_LIST)
-                    .build()).build();
-    private static final LispAddress LISP_EXPLICIT_LOCATOR_PATH = new EidBuilder().setAddress(EXPLICIT_LOCATOR_PATH)
-            .build();
 
     // SourceDestKey
     private static final SourceDestKey SOURCE_DEST_KEY = new SourceDestKeyBuilder().setSourceDestKey(new org
@@ -461,7 +455,12 @@ public class LispAddressStringifierTest {
         HOP_LIST.add(HOP_1);
         HOP_LIST.add(HOP_2);
 
-        assertEquals(getStringFromExplicLocPath(), LispAddressStringifier.getString(LISP_EXPLICIT_LOCATOR_PATH));
+        ExplicitLocatorPath elp = new ExplicitLocatorPathBuilder().setExplicitLocatorPath(
+                new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.address.types.rev151105.lisp
+                        .address.address.explicit.locator.path.ExplicitLocatorPathBuilder().setHop(HOP_LIST)
+                        .build()).build();
+        LispAddress lelp = new EidBuilder().setAddress(elp).build();
+        assertEquals(getStringFromExplicLocPath(), LispAddressStringifier.getString(lelp));
     }
 
     private static String getStringFromSrcDstKey() {
index 3e81c87270f4ec085ee68c904e14e792bddea1af..17e97add6ce0996468fdee992ca99c6ae82a5848 100644 (file)
@@ -77,7 +77,7 @@ public class ExplicitLocatorPathSerializerTest extends BaseTestCase {
         ExplicitLocatorPath elp = (ExplicitLocatorPath) address.getAddress();
 
         List<Hop> hops = elp.getExplicitLocatorPath().getHop();
-        assertEquals(0, hops.size());
+        assertNull(hops);
     }
 
     @Test(expected = LispSerializationException.class)
index 27a78ed8fba7ac183a28e08bf271e05838ceefab..409e5a7183faafb8432a7b96dac8b1529ad8359e 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.9</version>
+    <version>6.0.1</version>
     <relativePath/>
   </parent>
 
@@ -81,7 +81,7 @@
     <dependency>
       <groupId>org.opendaylight.mdsal</groupId>
       <artifactId>mdsal-singleton-common-api</artifactId>
-      <version>5.0.9</version>
+      <version>6.0.1</version>
     </dependency>
 
     <!--Needed for testing-->
index c240796c36a90d370eab0124712100f25b087767..a8c38410e6c5d88e886cd1ffc55c30b8c2d37f15 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.lispflowmapping.neutron;
 
-import java.util.List;
+import java.util.Map;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
 import org.opendaylight.lispflowmapping.neutron.mappingmanager.HostInformationManager;
 import org.opendaylight.lispflowmapping.neutron.mappingmanager.PortData;
@@ -15,6 +15,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.lisp.addres
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.PortBindingExtension;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIpsKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -55,10 +56,10 @@ public class PortDataProcessor implements DataProcessor<Port> {
             return;
         }
 
-        List<FixedIps> fixedIPs = port.getFixedIps();
+        Map<FixedIpsKey, FixedIps> fixedIPs = port.nonnullFixedIps();
         if (fixedIPs != null && fixedIPs.size() > 0) {
             Eid eidAddress;
-            for (FixedIps ip : fixedIPs) {
+            for (FixedIps ip : fixedIPs.values()) {
 
                 // TODO Add check/support for IPv6.
                 // Get subnet for this port, based on v4 or v6 decide address
@@ -72,7 +73,7 @@ public class PortDataProcessor implements DataProcessor<Port> {
         LOG.info("Neutron Port Created: Port name: "
                 + port.getName()
                 + " Port Fixed IP: "
-                + (port.getFixedIps() != null ? port.getFixedIps().get(0)
+                + (port.getFixedIps() != null ? port.getFixedIps().values().iterator().next()
                 : "No Fixed IP assigned"));
     }
 
@@ -92,10 +93,10 @@ public class PortDataProcessor implements DataProcessor<Port> {
             return;
         }
 
-        List<FixedIps> fixedIPs = port.getFixedIps();
+        Map<FixedIpsKey, FixedIps> fixedIPs = port.getFixedIps();
         if (fixedIPs != null && fixedIPs.size() > 0) {
             Eid eidAddress;
-            for (FixedIps ip : fixedIPs) {
+            for (FixedIps ip : fixedIPs.values()) {
 
                 eidAddress = getEid(port, ip);
 
@@ -107,7 +108,7 @@ public class PortDataProcessor implements DataProcessor<Port> {
         LOG.info("Neutron Port updated: Port name: "
                 + port.getName()
                 + " Port Fixed IP: "
-                + (port.getFixedIps() != null ? port.getFixedIps().get(0)
+                + (port.getFixedIps() != null ? port.getFixedIps().values().iterator().next()
                 : "No Fixed IP assigned"));
         LOG.debug("Neutron Port Updated : " + port.toString());
     }
@@ -119,15 +120,15 @@ public class PortDataProcessor implements DataProcessor<Port> {
         LOG.info("Neutron Port Deleted: Port name: "
                 + port.getName()
                 + " Port Fixed IP: "
-                + (port.getFixedIps() != null ? port.getFixedIps().get(0)
+                + (port.getFixedIps() != null ? port.getFixedIps().values().iterator().next()
                 : "No Fixed IP assigned"));
         LOG.debug("Neutron Port Deleted : " + port.toString());
 
-        List<FixedIps> fixedIPs = port.getFixedIps();
+        Map<FixedIpsKey, FixedIps> fixedIPs = port.getFixedIps();
         if (fixedIPs != null && fixedIPs.size() > 0) {
             Eid eidAddress;
 
-            for (FixedIps ip : fixedIPs) {
+            for (FixedIps ip : fixedIPs.values()) {
 
                 // TODO Add check/support for IPv6.
                 // Get subnet for this port, based on v4 or v6 decide address
index 2dcb8d9c677ceed5be5ed6decf5f488d3fd7759b..c9af410f43e55d3ee9ba1bbc470584bac7fe45c0 100644 (file)
@@ -151,7 +151,7 @@ public class VppEndpointListener implements AutoCloseable, ClusteredDataTreeChan
     }
 
     private void processNodeOnConnection(final Node newOrModifiedNode) {
-        for (SupportingNode supportingNode : newOrModifiedNode.getSupportingNode()) {
+        for (SupportingNode supportingNode : newOrModifiedNode.nonnullSupportingNode().values()) {
             final NodeId nodeMount = supportingNode.getNodeRef();
             final VppNetconfConnectionProbe probe = new VppNetconfConnectionProbe(supportingNode.getNodeRef(),
                     dataBroker);
index aad0d57e2aa063af3dd41bbf9ad92ef3b3dfa7a0..4d956a3d7f77d82cadfcbb7f5c81e61907e15118 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.lispflowmapping.neutron.intenthandler.util;
 
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
-import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.lispflowmapping.neutron.intenthandler.exception.RlocNotFoundOnVppNode;
@@ -23,6 +23,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.Interface2;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.Ipv4;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.Address;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ip.rev140616.interfaces.state._interface.ipv4.AddressKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev170607.Loopback;
 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;
@@ -74,7 +75,7 @@ public class VppNodeReader {
                     LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(InterfacesState.class));
             if (interfacesOnVppNodeOptional.isPresent()) {
 
-                for (Interface intf : interfacesOnVppNodeOptional.get().getInterface()) {
+                for (Interface intf : interfacesOnVppNodeOptional.get().nonnullInterface().values()) {
 
                     if (intf.getType().equals(Loopback.class)) {
                         continue;
@@ -114,13 +115,13 @@ public class VppNodeReader {
             return Optional.empty();
         }
 
-        final List<Address> addresses = ipv4.getAddress();
+        final Map<AddressKey, Address> addresses = ipv4.getAddress();
         if (addresses == null || addresses.isEmpty()) {
             LOG.debug("Ipv4 addresses list is empty for interface {} on node {}", augIntf, InfoUtil.node(iiToVpp));
             return Optional.empty();
         }
 
-        final Ipv4AddressNoZone ip = addresses.iterator().next().getIp();
+        final Ipv4AddressNoZone ip = addresses.values().iterator().next().getIp();
         if (ip == null) {
             LOG.debug("Ipv4AddressNoZone is null for node {}", InfoUtil.node(iiToVpp));
             return Optional.empty();
index 9314974f6b6734ab452ed56d097c58d8ff2e1a00..04aec63cdef140e5cdbf41a5d01c6b62e70ddbcc 100644 (file)
@@ -11,7 +11,8 @@ import com.google.common.collect.Lists;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
-import java.util.List;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import org.junit.Before;
@@ -37,6 +38,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev15090
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.binding.rev150712.PortBindingExtension;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIpsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIpsKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 
@@ -56,6 +58,7 @@ public class PortDataProcessorTest {
     private static final String IPV4 = "192.168.0.1";
     private static final Address ADDRESS = new DistinguishedNameBuilder()
             .setDistinguishedName(new DistinguishedNameType(HOST_ID_1)).build();
+    private static final String UUID_STRING = "123e4567-e89b-12d3-a456-426655440000";
 
     private PortDataProcessor portDataProcessor = new PortDataProcessor(iLispNeutronServiceMock);
 
@@ -89,9 +92,9 @@ public class PortDataProcessorTest {
                    IllegalAccessException, InvocationTargetException {
         portDataProcessor.create(portMock);
 
-        List<FixedIps> fixedIps = portMock.getFixedIps();
+        Map<FixedIpsKey, FixedIps> fixedIps = portMock.nonnullFixedIps();
 
-        for (FixedIps ip : fixedIps) {
+        for (FixedIps ip : fixedIps.values()) {
             Mockito.verify(hostInformationManager).addHostRelatedInfo(HOST_ID_1,
                     getEid(portDataProcessor, portMock, ip));
         }
@@ -107,7 +110,7 @@ public class PortDataProcessorTest {
 
         portDataProcessor.create(portMock);
 
-        List<FixedIps> fixedIps = portMock.getFixedIps();
+        Map<FixedIpsKey, FixedIps> fixedIps = portMock.getFixedIps();
 
         Mockito.verifyZeroInteractions(hostInformationManager);
     }
@@ -147,10 +150,11 @@ public class PortDataProcessorTest {
         return new MappingRecordBuilder().setLocatorRecord(Lists.newArrayList(getDefaultLocatorRecord())).build();
     }
 
-    private static List<FixedIps> getDefaultListOfFixedIps() {
-        FixedIps fixedIps = new FixedIpsBuilder().setIpAddress(new IpAddress(new Ipv4Address(IPV4))).build();
+    private static Map<FixedIpsKey, FixedIps> getDefaultListOfFixedIps() {
+        IpAddress ipv4 = new IpAddress(new Ipv4Address(IPV4));
+        FixedIps fixedIps = new FixedIpsBuilder().setIpAddress(ipv4).build();
 
-        return Lists.newArrayList(fixedIps);
+        return new LinkedHashMap<>(Map.of(new FixedIpsKey(ipv4, new Uuid(UUID_STRING)), fixedIps));
     }
 
     private static Eid getEid(PortDataProcessor portDataProcessor, Port port, FixedIps ip)
index 47315a5026cb477002abb4c3cb1360ed7850a19e..c93472ac40c42fed24d7af4a54c12c1b7a2c1396 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>6.0.4</version>
+    <version>7.0.2</version>
     <relativePath/>
   </parent>
 
@@ -39,7 +39,7 @@
       <dependency>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>5.0.9</version>
+        <version>6.0.1</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index 32c0d2a9ad88074ab33ed29f0f06119e2905296b..8da1c3e5137ac4abf82f22cfe3d014d87ce02048 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.lispflowmapping.southbound.lisp;
 
 import java.util.Collection;
-import java.util.List;
+import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import org.opendaylight.lispflowmapping.lisp.util.LispAddressUtil;
 import org.opendaylight.lispflowmapping.mapcache.AuthKeyDb;
@@ -21,6 +21,7 @@ import org.opendaylight.mdsal.binding.api.DataTreeModification;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddress;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddressKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.MappingDatabase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.mappingservice.rev150906.db.instance.AuthenticationKeyBuilder;
@@ -111,10 +112,10 @@ public class AuthenticationKeyDataListener implements ClusteredDataTreeChangeLis
      * @param timeout MapRegister cache timeout value
      * @return false if any of the EIDs in the eids list was updated in the last timout period, true otherwise
      */
-    public synchronized boolean authKeysForEidsUnchanged(List<EidLispAddress> eids, long timeout) {
+    public synchronized boolean authKeysForEidsUnchanged(Map<EidLispAddressKey, EidLispAddress> eids, long timeout) {
         boolean result = true;
         Long currentTime = System.currentTimeMillis();
-        for (EidLispAddress eidLispAddress : eids) {
+        for (EidLispAddress eidLispAddress : eids.values()) {
             Long updateTime = updatedEntries.get(eidLispAddress.getEid());
             if (updateTime != null) {
                 result = false;
index b6972db6d43fa39d2145221925224c434f1ecf53..5fc3a9108797d1bcc93df836bd07d888d3551286 100644 (file)
@@ -18,8 +18,8 @@ import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.channel.socket.DatagramPacket;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
-import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -58,6 +58,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.ma
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.MapRegisterCacheMetadataBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddressBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.metadata.container.map.register.cache.metadata.EidLispAddressKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.value.grouping.MapRegisterCacheValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.map.register.cache.value.grouping.MapRegisterCacheValueBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.mapping.authkey.container.MappingAuthkey;
@@ -246,7 +247,8 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
     }
 
     private MapRegisterCacheValue refreshAuthKeyIfNecessary(MapRegisterCacheValue mapRegisterCacheValue) {
-        final List<EidLispAddress> eids = mapRegisterCacheValue.getMapRegisterCacheMetadata().getEidLispAddress();
+        final Map<EidLispAddressKey, EidLispAddress> eids = mapRegisterCacheValue.getMapRegisterCacheMetadata()
+                .getEidLispAddress();
 
         if (lispSbPlugin.getAuthenticationKeyDataListener().authKeysForEidsUnchanged(
                 eids, lispSbPlugin.getMapRegisterCacheTimeout())) {
@@ -291,10 +293,13 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
     /**
      * Returns null if not all of eids have the same value of authentication key.
      */
-    private MappingAuthkey provideAuthenticateKey(final List<EidLispAddress> eidLispAddresses) {
+    private MappingAuthkey provideAuthenticateKey(final Map<EidLispAddressKey, EidLispAddress> eidLispAddresses) {
         MappingAuthkey firstAuthKey = null;
+        if (eidLispAddresses == null) {
+            return null;
+        }
         for (int i = 0; i < eidLispAddresses.size(); i++) {
-            final Eid eid = eidLispAddresses.get(i).getEid();
+            final Eid eid = eidLispAddresses.get(new EidLispAddressKey(Integer.toString(i))).getEid();
             if (i == 0) {
                 firstAuthKey = lispSbPlugin.getAkdb().getAuthenticationKey(eid);
             } else {
@@ -348,14 +353,15 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
         return buffer;
     }
 
-    private List<EidLispAddress> provideEidPrefixesFromMessage(final MapRegister mapRegister) {
-        List<EidLispAddress> eidsResult = new ArrayList<>();
+    private Map<EidLispAddressKey, EidLispAddress> provideEidPrefixesFromMessage(final MapRegister mapRegister) {
+        Map<EidLispAddressKey, EidLispAddress> eidsResult = new LinkedHashMap<>();
+        int idx = 0;
         for (MappingRecordItem mappingRecordItem : mapRegister.getMappingRecordItem()) {
             final EidLispAddressBuilder eidLispAddressBuilder = new EidLispAddressBuilder();
             final Eid eid = mappingRecordItem.getMappingRecord().getEid();
             eidLispAddressBuilder.setEidLispAddressId(LispAddressStringifier.getString(eid));
             eidLispAddressBuilder.setEid(eid);
-            eidsResult.add(eidLispAddressBuilder.build());
+            eidsResult.put(new EidLispAddressKey(Integer.toString(idx)), eidLispAddressBuilder.build());
         }
         return eidsResult;
     }
index b188aa01584292fa321404d549c0c9c758784846..db7f04b7941351535852993be00ed1a159e6c95e 100644 (file)
@@ -140,7 +140,7 @@ public class LispSouthboundHandlerTest extends BaseTestCase {
                 .thenReturn(new MappingAuthkeyBuilder().setKeyType(1).setKeyString("password").build());
 
         akdl = Mockito.mock(AuthenticationKeyDataListener.class);
-        Mockito.when(akdl.authKeysForEidsUnchanged(Mockito.anyList(), Mockito.anyLong())).thenReturn(true);
+        Mockito.when(akdl.authKeysForEidsUnchanged(Mockito.anyMap(), Mockito.anyLong())).thenReturn(true);
     }
 
     @Override