Create l3vpn & asso with ext-nw failed
[netvirt.git] / vpnmanager / impl / src / main / java / org / opendaylight / netvirt / vpnmanager / VpnInterfaceManager.java
index 4212b5fd643632cce66d0cf24a664736ad9672fe..96ad97f4f3637ed35b9d695cb0d2d3f4bb4795db 100755 (executable)
@@ -53,7 +53,7 @@ import org.opendaylight.genius.utils.JvmGlobalLocks;
 import org.opendaylight.infrautils.caches.CacheProvider;
 import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
 import org.opendaylight.infrautils.utils.concurrent.Executors;
-import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
+import org.opendaylight.infrautils.utils.concurrent.LoggingFutures;
 import org.opendaylight.mdsal.binding.api.DataBroker;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
@@ -350,7 +350,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
                                 LOG.info("addVpnInterface: Router interface {} for vpn {} on dpn {}", interfaceName,
                                     vpnName, vpnInterface.getDpnId());
                             });
-                        ListenableFutures.addErrorLogging(future, LOG,
+                        LoggingFutures.addErrorLogging(future, LOG,
                             "Error creating FIB entry for interface {} on VPN {}", vpnInterface.getName(), vpnName);
                         return Collections.singletonList(future);
                     });
@@ -784,7 +784,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
         for (Adjacency nextHop : nextHopsMap.values()) {
             String rd = primaryRd;
             String nexthopIpValue = nextHop.getIpAddress().split("/")[0];
-            if (vpnInstanceOpData.getBgpvpnType() == VpnInstanceOpDataEntry.BgpvpnType.BGPVPNInternet
+            if (vpnInstanceOpData.getBgpvpnType() == VpnInstanceOpDataEntry.BgpvpnType.InternetBGPVPN
                     && NWUtil.isIpv4Address(nexthopIpValue)) {
                 String prefix = nextHop.getIpAddress() == null ?  "null" :
                       VpnUtil.getIpPrefix(nextHop.getIpAddress());
@@ -1189,7 +1189,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
         for (VpnInstanceOpDataEntry vpn : vpnsToExportRoute) {
             List<VrfEntry> vrfEntries = vpnUtil.getAllVrfEntries(vpn.getVrfId());
             if (vrfEntries != null) {
-                ListenableFutures.addErrorLogging(
+                LoggingFutures.addErrorLogging(
                     txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION, confTx -> {
                         for (VrfEntry vrfEntry : vrfEntries) {
                             try {
@@ -1259,7 +1259,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
                         deleteFibEntryForRouterInterface(vpnInterface, confTx, vpnName);
                         LOG.info("remove: Router interface {} for vpn {}", interfaceName, vpnName);
                     });
-                ListenableFutures.addErrorLogging(future, LOG, "Error removing call for interface {} on VPN {}",
+                LoggingFutures.addErrorLogging(future, LOG, "Error removing call for interface {} on VPN {}",
                         vpnInterface.getName(), vpnName);
                 return Collections.singletonList(future);
             }, DJC_MAX_RETRIES);
@@ -1405,7 +1405,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
             }
             AdjacenciesOp adjacencies = vpnInterfaceOpDataEnteryOptional.get().augmentation(AdjacenciesOp.class);
 
-            if (adjacencies != null && !adjacencies.getAdjacency().isEmpty()) {
+            if (adjacencies != null && adjacencies.getAdjacency() != null) {
                 Map<AdjacencyKey, Adjacency> nextHopsMap = adjacencies.nonnullAdjacency();
                 LOG.info("removeAdjacenciesFromVpn: NextHops for interface {} on dpn {} for vpn {} are {}",
                         interfaceName, dpnId, vpnName, nextHopsMap);
@@ -1708,7 +1708,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
                         String primaryRd = vpnUtil.getPrimaryRd(newVpnName);
                         VpnInstanceOpDataEntry vpnInstanceOpDataEntry = vpnUtil.getVpnInstanceOpData(primaryRd);
                         if (vpnInstanceOpDataEntry.getBgpvpnType() == VpnInstanceOpDataEntry
-                                .BgpvpnType.BGPVPNExternal) {
+                                .BgpvpnType.BGPVPN) {
                             externalBgpVpnList.add(newVpnName);
                             break;
                         }
@@ -1725,7 +1725,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
                         String primaryRd = vpnUtil.getPrimaryRd(newVpnName);
                         VpnInstanceOpDataEntry vpnInstanceOpDataEntry = vpnUtil.getVpnInstanceOpData(primaryRd);
                         if (vpnInstanceOpDataEntry.getBgpvpnType() == VpnInstanceOpDataEntry
-                                .BgpvpnType.VPN) {
+                                .BgpvpnType.BGPVPN) {
                             routerVpnList.add(newVpnName);
                             break;
                         }
@@ -1897,7 +1897,7 @@ public class VpnInterfaceManager extends AbstractAsyncDataTreeChangeListener<Vpn
                     MoreExecutors.directExecutor());
                 futures.add(configTxFuture);
                 for (ListenableFuture<Void> future : futures) {
-                    ListenableFutures.addErrorLogging(future, LOG, "update: failed for interface {} on vpn {}",
+                    LoggingFutures.addErrorLogging(future, LOG, "update: failed for interface {} on vpn {}",
                             update.getName(), update.getVpnInstanceNames());
                 }
             } else {