MRI version bumpup for Aluminium
[netvirt.git] / ipv6service / impl / src / main / java / org / opendaylight / netvirt / ipv6service / NeutronPortChangeListener.java
index d90c1ff9b7fe2ffadaae64813344ea5249857b71..f963eab3d58ef97e542b09d938419478d2794684 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.netvirt.ipv6service;
 
 import com.google.common.base.Strings;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
@@ -69,7 +70,7 @@ public class NeutronPortChangeListener extends AbstractClusteredAsyncDataTreeCha
         }
 
         LOG.debug("Add port notification handler is invoked for port {} ", port);
-        for (FixedIps fixedip : port.nonnullFixedIps()) {
+        for (FixedIps fixedip : port.nonnullFixedIps().values()) {
             if (fixedip.getIpAddress().getIpv4Address() != null) {
                 continue;
             }
@@ -107,17 +108,17 @@ public class NeutronPortChangeListener extends AbstractClusteredAsyncDataTreeCha
 
         LOG.debug("update port notification handler is invoked for port {} ", update);
 
-        Set<FixedIps> ipsBefore = getFixedIpSet(original.getFixedIps());
-        Set<FixedIps> ipsAfter = getFixedIpSet(update.getFixedIps());
+        Set<FixedIps> ipsBefore = getFixedIpSet(new ArrayList<FixedIps>(original.getFixedIps().values()));
+        Set<FixedIps> ipsAfter = getFixedIpSet(new ArrayList<FixedIps>(update.getFixedIps().values()));
 
-        Set<FixedIps> deletedIps = new HashSet<>(ipsBefore);
+        Set<FixedIps> deletedIps = new HashSet<FixedIps>(ipsBefore);
         deletedIps.removeAll(ipsAfter);
 
         if (!ipsBefore.equals(ipsAfter)) {
             Boolean portIncludesV6Address = Boolean.FALSE;
             ifMgr.clearAnyExistingSubnetInfo(update.getUuid());
 
-            Set<FixedIps> remainingIps = new HashSet<>(ipsAfter);
+            Set<FixedIps> remainingIps = new HashSet<FixedIps>(ipsAfter);
             remainingIps.removeAll(deletedIps);
             for (FixedIps fixedip : remainingIps) {
                 if (fixedip.getIpAddress().getIpv4Address() != null) {
@@ -128,8 +129,8 @@ public class NeutronPortChangeListener extends AbstractClusteredAsyncDataTreeCha
             }
 
             if (update.getDeviceOwner().equalsIgnoreCase(Ipv6ServiceConstants.NETWORK_ROUTER_INTERFACE)) {
-                ifMgr.updateRouterIntf(update.getUuid(), new Uuid(update.getDeviceId()), update.getFixedIps(),
-                        deletedIps);
+                ifMgr.updateRouterIntf(update.getUuid(), new Uuid(update.getDeviceId()),
+                        new ArrayList<FixedIps>(update.getFixedIps().values()), deletedIps);
             } else {
                 ifMgr.updateHostIntf(update.getUuid(), portIncludesV6Address);
             }
@@ -137,7 +138,7 @@ public class NeutronPortChangeListener extends AbstractClusteredAsyncDataTreeCha
         //Neutron Port update with proper device owner information
         if ((Strings.isNullOrEmpty(original.getDeviceOwner()) || Strings.isNullOrEmpty(original.getDeviceId()))
                 && !Strings.isNullOrEmpty(update.getDeviceOwner()) && !Strings.isNullOrEmpty(update.getDeviceId())) {
-            for (FixedIps fixedip : update.nonnullFixedIps()) {
+            for (FixedIps fixedip : update.nonnullFixedIps().values()) {
                 if (fixedip.getIpAddress().getIpv4Address() != null) {
                     continue;
                 }