import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
import org.opendaylight.netvirt.elan.cache.ElanInstanceCache;
import org.opendaylight.netvirt.elan.cache.ElanInstanceDpnsCache;
+import org.opendaylight.netvirt.elan.l2gw.jobs.BcGroupUpdateJob;
+import org.opendaylight.netvirt.elan.l2gw.jobs.DpnDmacJob;
+import org.opendaylight.netvirt.elan.l2gw.jobs.McastUpdateJob;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayMulticastUtils;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayUtils;
+import org.opendaylight.netvirt.elan.l2gw.utils.ElanRefUtil;
import org.opendaylight.netvirt.elan.utils.ElanClusterUtils;
+import org.opendaylight.netvirt.elan.utils.ElanDmacUtils;
+import org.opendaylight.netvirt.elan.utils.ElanItmUtils;
import org.opendaylight.netvirt.elanmanager.utils.ElanL2GwCacheUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanDpnInterfaces;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.ElanDpnInterfacesList;
private final EntityOwnershipUtils entityOwnershipUtils;
private final ElanL2GatewayUtils elanL2GatewayUtils;
private final ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils;
+ private final ElanRefUtil elanRefUtil;
+ private final ElanDmacUtils elanDmacUtils;
+ private final ElanItmUtils elanItmUtils;
private final ElanClusterUtils elanClusterUtils;
private final JobCoordinator jobCoordinator;
private final ElanInstanceCache elanInstanceCache;
ElanClusterUtils elanClusterUtils, JobCoordinator jobCoordinator,
ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils,
ElanInstanceCache elanInstanceCache,
- ElanInstanceDpnsCache elanInstanceDpnsCache) {
+ ElanInstanceDpnsCache elanInstanceDpnsCache,
+ ElanRefUtil elanRefUtil, ElanDmacUtils elanDmacUtils,
+ ElanItmUtils elanItmUtils) {
this.broker = broker;
this.entityOwnershipUtils = entityOwnershipUtils;
this.elanL2GatewayUtils = elanL2GatewayUtils;
this.elanL2GatewayMulticastUtils = elanL2GatewayMulticastUtils;
+ this.elanRefUtil = elanRefUtil;
+ this.elanDmacUtils = elanDmacUtils;
+ this.elanItmUtils = elanItmUtils;
this.elanClusterUtils = elanClusterUtils;
this.jobCoordinator = jobCoordinator;
this.elanInstanceCache = elanInstanceCache;
if (entityOwnershipUtils.isEntityOwner(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
HwvtepSouthboundConstants.ELAN_ENTITY_NAME)) {
// deleting Elan L2Gw Devices UcastLocalMacs From Dpn
- elanL2GatewayUtils.deleteElanL2GwDevicesUcastLocalMacsFromDpn(elanName,
- dpnInterfaces.getDpId());
+ DpnDmacJob.uninstallDmacFromL2gws(elanName, dpnInterfaces, elanL2GatewayUtils, elanRefUtil,
+ elanDmacUtils);
//Removing this dpn from cache to avoid race between this and local ucast mac listener
elanInstanceDpnsCache.remove(getElanName(identifier), dpnInterfaces);
// updating remote mcast mac on l2gw devices
- elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName);
+ McastUpdateJob.updateAllMcastsForDpnDelete(elanName, elanL2GatewayMulticastUtils,
+ elanClusterUtils, dpnInterfaces.getDpId(), elanItmUtils);
+ BcGroupUpdateJob.updateAllBcGroups(elanName, elanRefUtil, elanL2GatewayMulticastUtils,
+ broker, false);
}
} finally {
elanInstanceDpnsCache.remove(getElanName(identifier), dpnInterfaces);
List<String> interfaces = dpnInterfaces.getInterfaces();
if (interfaces != null && !interfaces.isEmpty()) {
LOG.debug("dpninterfaces update fired new size {}", interfaces.size());
- elanInstanceDpnsCache.remove(getElanName(identifier), dpnInterfaces);
+ elanInstanceDpnsCache.remove(getElanName(identifier), original);
+ elanInstanceDpnsCache.add(getElanName(identifier), dpnInterfaces);
LOG.debug("dpninterfaces last dpn interface on this elan {} ", dpnInterfaces.key());
// this is the last dpn interface on this elan
handleUpdate(identifier, dpnInterfaces);
HwvtepSouthboundConstants.ELAN_ENTITY_NAME)) {
ElanInstance elanInstance = elanInstanceCache.get(elanName).orNull();
if (elanInstance != null) {
- elanL2GatewayUtils.installElanL2gwDevicesLocalMacsInDpn(
- dpnInterfaces.getDpId(), elanInstance, dpnInterfaces.getInterfaces().get(0));
-
+ BcGroupUpdateJob.updateAllBcGroups(elanName, elanRefUtil, elanL2GatewayMulticastUtils,
+ broker, true);
// updating remote mcast mac on l2gw devices
- elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName);
+ McastUpdateJob.updateAllMcastsForDpnAdd(elanName, elanL2GatewayMulticastUtils,
+ elanClusterUtils);
+ DpnDmacJob.installDmacFromL2gws(elanName, dpnInterfaces, elanL2GatewayUtils, elanRefUtil,
+ elanDmacUtils);
}
}
return emptyList();
});
}
- private String getElanName(InstanceIdentifier<DpnInterfaces> identifier) {
+ private static String getElanName(InstanceIdentifier<DpnInterfaces> identifier) {
return identifier.firstKeyOf(ElanDpnInterfacesList.class).getElanInstanceName();
}