package org.opendaylight.netvirt.elan.l2gw.listeners;
import org.opendaylight.genius.datastoreutils.hwvtep.HwvtepClusteredDataTreeChangeListener;
+import org.opendaylight.genius.utils.hwvtep.HwvtepNodeHACache;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
-import org.opendaylight.netvirt.elan.internal.ElanInstanceManager;
+import org.opendaylight.netvirt.elan.cache.ElanInstanceCache;
import org.opendaylight.netvirt.elan.l2gw.jobs.LogicalSwitchAddedJob;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayMulticastUtils;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayUtils;
// Id of L2 Gateway connection responsible for this logical switch creation
private final Uuid l2GwConnId;
- private final ElanInstanceManager elanInstanceManager;
+ private final ElanInstanceCache elanInstanceCache;
private final ElanL2GatewayUtils elanL2GatewayUtils;
private final ElanClusterUtils elanClusterUtils;
private final ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils;
/**
* Instantiates a new hardware vtep logical switch listener.
*/
- public HwvtepLogicalSwitchListener(ElanInstanceManager elanInstanceManager, ElanL2GatewayUtils elanL2GatewayUtils,
+ public HwvtepLogicalSwitchListener(ElanInstanceCache elanInstanceCache, ElanL2GatewayUtils elanL2GatewayUtils,
ElanClusterUtils elanClusterUtils, ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils,
L2GatewayConnectionUtils l2GatewayConnectionUtils, L2GatewayDevice l2GatewayDevice,
- String logicalSwitchName, Devices physicalDevice, Integer defaultVlanId, Uuid l2GwConnId) {
- super(LogicalSwitches.class, HwvtepLogicalSwitchListener.class);
- this.elanInstanceManager = elanInstanceManager;
+ String logicalSwitchName, Devices physicalDevice, Integer defaultVlanId, Uuid l2GwConnId,
+ HwvtepNodeHACache hwvtepNodeHACache) {
+ super(LogicalSwitches.class, HwvtepLogicalSwitchListener.class, hwvtepNodeHACache);
+ this.elanInstanceCache = elanInstanceCache;
this.elanL2GatewayUtils = elanL2GatewayUtils;
this.elanClusterUtils = elanClusterUtils;
this.elanL2GatewayMulticastUtils = elanL2GatewayMulticastUtils;
LogicalSwitchAddedJob logicalSwitchAddedWorker = new LogicalSwitchAddedJob(
elanL2GatewayUtils, elanL2GatewayMulticastUtils, logicalSwitchName, physicalDevice, elanDevice,
- defaultVlanId, () -> elanInstanceManager.getElanInstanceByName(logicalSwitchName));
+ defaultVlanId);
elanClusterUtils.runOnlyInOwnerNode(logicalSwitchAddedWorker.getJobKey(),
"create vlan mappings and mcast configurations", logicalSwitchAddedWorker);
} catch (RuntimeException e) {