The controller EOS APIs are deprecated.
Change-Id: Ic0b4cbc2fc6b3e11958841d2704407f38edf7504
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
*/
package org.opendaylight.netvirt.elan.internal;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-
import java.util.Collections;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase;
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
-import org.opendaylight.genius.utils.clustering.ClusteringUtils;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayMulticastUtils;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayUtils;
private static final Logger LOG = LoggerFactory.getLogger(ElanDpnInterfaceClusteredListener.class);
private final DataBroker broker;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
private final ElanL2GatewayUtils elanL2GatewayUtils;
private final ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils;
- public ElanDpnInterfaceClusteredListener(DataBroker broker, EntityOwnershipService entityOwnershipService,
+ public ElanDpnInterfaceClusteredListener(DataBroker broker, EntityOwnershipUtils entityOwnershipUtils,
ElanUtils elanUtils, ElanL2GatewayUtils elanL2GatewayUtils) {
this.broker = broker;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.elanL2GatewayUtils = elanL2GatewayUtils;
this.elanL2GatewayMulticastUtils = elanUtils.getElanL2GatewayMulticastUtils();
}
dpnInterfaces.getDpId());
return;
}
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, elanName, "updating mcast mac upon tunnel event",
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, elanName, "updating mcast mac upon tunnel event",
() -> Collections.singletonList(
elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName)));
}
final String elanName = getElanName(identifier);
//Cache need to be updated in all cluster nodes and not only by leader node .
//Hence moved out from DJC job
- ListenableFuture<Boolean> checkEntityOwnerFuture = ClusteringUtils.checkNodeEntityOwner(
- entityOwnershipService, HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
- HwvtepSouthboundConstants.ELAN_ENTITY_NAME);
- Futures.addCallback(checkEntityOwnerFuture, new FutureCallback<Boolean>() {
- @Override
- public void onSuccess(Boolean isOwner) {
- DataStoreJobCoordinator.getInstance().enqueueJob(elanName + ":l2gw", () -> {
- try {
- if (isOwner) {
- // deleting Elan L2Gw Devices UcastLocalMacs From Dpn
- elanL2GatewayUtils.deleteElanL2GwDevicesUcastLocalMacsFromDpn(elanName,
- dpnInterfaces.getDpId());
-
- //Removing this dpn from cache to avoid race between this and local ucast mac listener
- ElanUtils.removeDPNInterfaceFromElanInCache(getElanName(identifier), dpnInterfaces);
-
- // updating remote mcast mac on l2gw devices
- elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName);
- }
- } finally {
- ElanUtils.addDPNInterfaceToElanInCache(getElanName(identifier), dpnInterfaces);
- }
- return null;
- });
- }
- @Override
- public void onFailure(Throwable error) {
- LOG.error("Error while fetching checkNodeEntityOwner", error);
+ DataStoreJobCoordinator.getInstance().enqueueJob(elanName + ":l2gw", () -> {
+ try {
+ if (entityOwnershipUtils.isEntityOwner(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
+ HwvtepSouthboundConstants.ELAN_ENTITY_NAME)) {
+ // deleting Elan L2Gw Devices UcastLocalMacs From Dpn
+ elanL2GatewayUtils.deleteElanL2GwDevicesUcastLocalMacsFromDpn(elanName,
+ dpnInterfaces.getDpId());
+
+ //Removing this dpn from cache to avoid race between this and local ucast mac listener
+ ElanUtils.removeDPNInterfaceFromElanInCache(getElanName(identifier), dpnInterfaces);
+
+ // updating remote mcast mac on l2gw devices
+ elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName);
+ }
+ } finally {
+ ElanUtils.addDPNInterfaceToElanInCache(getElanName(identifier), dpnInterfaces);
}
+
+ return null;
});
}
@Override
protected void add(InstanceIdentifier<DpnInterfaces> identifier, final DpnInterfaces dpnInterfaces) {
final String elanName = getElanName(identifier);
- ListenableFuture<Boolean> checkEntityOwnerFuture = ClusteringUtils.checkNodeEntityOwner(
- entityOwnershipService, HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
- HwvtepSouthboundConstants.ELAN_ENTITY_NAME);
- Futures.addCallback(checkEntityOwnerFuture, new FutureCallback<Boolean>() {
- @Override
- public void onSuccess(Boolean isOwner) {
- DataStoreJobCoordinator.getInstance().enqueueJob(elanName + ":l2gw", () -> {
- try {
- if (isOwner) {
- ElanUtils.addDPNInterfaceToElanInCache(getElanName(identifier), dpnInterfaces);
- ElanInstance elanInstance = ElanUtils.getElanInstanceByName(broker, elanName);
- elanL2GatewayUtils.installElanL2gwDevicesLocalMacsInDpn(
- dpnInterfaces.getDpId(), elanInstance, dpnInterfaces.getInterfaces().get(0));
-
- // updating remote mcast mac on l2gw devices
- elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName);
- }
- } finally {
- ElanUtils.addDPNInterfaceToElanInCache(getElanName(identifier), dpnInterfaces);
- }
- return null;
- });
- }
- @Override
- public void onFailure(Throwable error) {
- LOG.error("Error while fetching checkNodeEntityOwner", error);
+ DataStoreJobCoordinator.getInstance().enqueueJob(elanName + ":l2gw", () -> {
+ try {
+ if (entityOwnershipUtils.isEntityOwner(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
+ HwvtepSouthboundConstants.ELAN_ENTITY_NAME)) {
+ ElanUtils.addDPNInterfaceToElanInCache(getElanName(identifier), dpnInterfaces);
+ ElanInstance elanInstance = ElanUtils.getElanInstanceByName(broker, elanName);
+ elanL2GatewayUtils.installElanL2gwDevicesLocalMacsInDpn(
+ dpnInterfaces.getDpId(), elanInstance, dpnInterfaces.getInterfaces().get(0));
+
+ // updating remote mcast mac on l2gw devices
+ elanL2GatewayMulticastUtils.updateRemoteMcastMacOnElanL2GwDevices(elanName);
+ }
+ } finally {
+ ElanUtils.addDPNInterfaceToElanInCache(getElanName(identifier), dpnInterfaces);
}
+ return null;
});
}
package org.opendaylight.netvirt.elan.internal;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.netvirt.elan.ElanException;
import org.opendaylight.netvirt.elan.utils.ElanClusterUtils;
import org.opendaylight.netvirt.elan.utils.ElanUtils;
private final DataBroker broker;
private final ElanInterfaceManager elanInterfaceManager;
private final ElanUtils elanUtils;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
/* FIXME:
* Why do we have ElanInterfaceStateChangeListener and ElanInterfaceStateClusteredListener
* both within same module? Refactor this code into single listener.
*/
public ElanInterfaceStateClusteredListener(DataBroker broker, ElanInterfaceManager elanInterfaceManager,
- ElanUtils elanUtils, EntityOwnershipService entityOwnershipService) {
+ ElanUtils elanUtils, EntityOwnershipUtils entityOwnershipUtils) {
this.broker = broker;
this.elanInterfaceManager = elanInterfaceManager;
this.elanUtils = elanUtils;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
}
public void init() {
if (intrf.getOperStatus().equals(Interface.OperStatus.Up)) {
final String interfaceName = intrf.getName();
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, () -> {
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, "external tunnel update", () -> {
LOG.debug("running external tunnel update job for interface {} added", interfaceName);
try {
handleExternalTunnelUpdate(interfaceName, intrf);
package org.opendaylight.netvirt.elan.internal;
import com.google.common.base.Optional;
-
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collection;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.CandidateAlreadyRegisteredException;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.interfacemanager.exceptions.InterfaceAlreadyExistsException;
import org.opendaylight.genius.interfacemanager.globals.IfmConstants;
import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.genius.mdsalutil.nxmatches.NxMatchRegister;
import org.opendaylight.genius.utils.ServiceIndex;
-import org.opendaylight.genius.utils.clustering.EntityOwnerUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.infrautils.inject.AbstractLifecycle;
+import org.opendaylight.mdsal.eos.binding.api.Entity;
+import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipCandidateRegistration;
+import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
+import org.opendaylight.mdsal.eos.common.api.CandidateAlreadyRegisteredException;
import org.opendaylight.netvirt.elan.arp.responder.ArpResponderInput;
import org.opendaylight.netvirt.elan.statusanddiag.ElanStatusMonitor;
import org.opendaylight.netvirt.elan.utils.ElanConstants;
private boolean generateIntBridgeMac = true;
private boolean isL2BeforeL3;
+ private final EntityOwnershipCandidateRegistration candidateRegistration;
+
@Inject
public ElanServiceProvider(IdManagerService idManager, IInterfaceManager interfaceManager,
ElanInstanceManager elanInstanceManager, ElanBridgeManager bridgeMgr,
this.elanStatusMonitor = elanStatusMonitor;
this.elanUtils = elanUtils;
elanInterfaceManager.setElanUtils(elanUtils);
+
+ candidateRegistration = registerCandidate(entityOwnershipService);
+ }
+
+ private static EntityOwnershipCandidateRegistration registerCandidate(
+ EntityOwnershipService entityOwnershipService) {
try {
- EntityOwnerUtils.registerEntityCandidateForOwnerShip(entityOwnershipService,
- HwvtepSouthboundConstants.ELAN_ENTITY_TYPE, HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
- null/*listener*/);
+ return entityOwnershipService.registerCandidate(
+ new Entity(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE, HwvtepSouthboundConstants.ELAN_ENTITY_TYPE));
} catch (CandidateAlreadyRegisteredException e) {
LOG.error("failed to register the entity");
+ return null;
}
}
}
@Override
- protected void stop() throws Exception {
+ protected void stop() {
+ if (candidateRegistration != null) {
+ candidateRegistration.close();
+ }
}
@Override
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.netvirt.elan.internal.ElanInstanceManager;
import org.opendaylight.netvirt.elan.internal.ElanInterfaceManager;
import org.opendaylight.netvirt.elan.utils.ElanClusterUtils;
private final ElanInterfaceManager elanInterfaceManager;
private final DataBroker broker;
private final ElanInstanceManager elanInstanceManager;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
public ElanGroupListener(ElanInterfaceManager elanInterfaceManager, final DataBroker db,
- EntityOwnershipService entityOwnershipService, ElanInstanceManager elanInstanceManager) {
+ EntityOwnershipUtils entityOwnershipUtils, ElanInstanceManager elanInstanceManager) {
super(Group.class, ElanGroupListener.class);
this.elanInterfaceManager = elanInterfaceManager;
broker = db;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.elanInstanceManager = elanInstanceManager;
registerListener(LogicalDatastoreType.CONFIGURATION, broker);
LOG.trace("ElanGroupListener registered");
}
LOG.trace("no of buckets mismatched {} {}", elanInstance.getElanInstanceName(),
update.getKey().getGroupId());
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, elanInstance.getElanInstanceName(),
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, elanInstance.getElanInstanceName(),
"updating broadcast group",
() -> {
elanInterfaceManager.setupElanBroadcastGroups(elanInstance, dpnId);
import java.util.concurrent.ConcurrentHashMap;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.netvirt.elan.l2gw.utils.L2GatewayConnectionUtils;
import org.opendaylight.netvirt.elan.utils.ElanClusterUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanInstances;
private static final Logger LOG = LoggerFactory.getLogger(ElanInstanceListener.class);
private final DataBroker broker;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
private static final Map<String, List<Runnable>> WAITING_JOB_LIST = new ConcurrentHashMap<>();
- public ElanInstanceListener(final DataBroker db, final EntityOwnershipService entityOwnershipService) {
+ public ElanInstanceListener(final DataBroker db, final EntityOwnershipUtils entityOwnershipUtils) {
super(ElanInstance.class, ElanInstanceListener.class);
broker = db;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
registerListener(LogicalDatastoreType.CONFIGURATION, db);
}
public void init() {
}
+ @Override
public void close() {
}
@Override
protected void remove(final InstanceIdentifier<ElanInstance> identifier,
final ElanInstance del) {
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, del.getElanInstanceName(), () -> {
- LOG.info("Elan instance {} deleted from Configuration tree ", del);
- List<L2gatewayConnection> connections =
- L2GatewayConnectionUtils.getL2GwConnectionsByElanName(
- this.broker, del.getElanInstanceName());
- if (connections == null || connections.isEmpty()) {
- return null;
- }
- try {
- ReadWriteTransaction tx = this.broker.newReadWriteTransaction();
- for (L2gatewayConnection connection : connections) {
- InstanceIdentifier<L2gatewayConnection> iid = InstanceIdentifier.create(Neutron.class)
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, del.getElanInstanceName(),
+ "delete Elan instance", () -> {
+ LOG.info("Elan instance {} deleted from Configuration tree ", del);
+ List<L2gatewayConnection> connections =
+ L2GatewayConnectionUtils.getL2GwConnectionsByElanName(
+ this.broker, del.getElanInstanceName());
+ if (connections == null || connections.isEmpty()) {
+ return null;
+ }
+ try {
+ ReadWriteTransaction tx = this.broker.newReadWriteTransaction();
+ for (L2gatewayConnection connection : connections) {
+ InstanceIdentifier<L2gatewayConnection> iid = InstanceIdentifier.create(Neutron.class)
.child(L2gatewayConnections.class).child(L2gatewayConnection.class, connection.getKey());
- tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
+ tx.delete(LogicalDatastoreType.CONFIGURATION, iid);
+ }
+ tx.submit().checkedGet();
+ } catch (TransactionCommitFailedException e) {
+ LOG.error("Failed to delete associated l2gwconnection while deleting network", e);
}
- tx.submit().checkedGet();
- } catch (TransactionCommitFailedException e) {
- LOG.error("Failed to delete associated l2gwconnection while deleting network", e);
- }
- return null;
- });
+ return null;
+ });
}
@Override
return InstanceIdentifier.create(ElanInstances.class).child(ElanInstance.class);
}
-}
\ No newline at end of file
+}
package org.opendaylight.netvirt.elan.l2gw.listeners;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.genius.datastoreutils.hwvtep.HwvtepClusteredDataTreeChangeListener;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.netvirt.elan.l2gw.jobs.LogicalSwitchAddedJob;
import org.opendaylight.netvirt.elan.l2gw.utils.ElanL2GatewayMulticastUtils;
private static final Logger LOG = LoggerFactory.getLogger(HwvtepLogicalSwitchListener.class);
/** The node id. */
- private NodeId nodeId;
+ private final NodeId nodeId;
/** The logical switch name. */
- private String logicalSwitchName;
+ private final String logicalSwitchName;
/** The physical device. */
- private Devices physicalDevice;
+ private final Devices physicalDevice;
/** The l2 gateway device. */
- private L2GatewayDevice l2GatewayDevice;
+ private final L2GatewayDevice l2GatewayDevice;
// The default vlan id
- private Integer defaultVlanId;
+ private final Integer defaultVlanId;
// Id of L2 Gateway connection responsible for this logical switch creation
- private Uuid l2GwConnId;
+ private final Uuid l2GwConnId;
private final DataBroker broker;
private final ElanL2GatewayUtils elanL2GatewayUtils;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
private final ElanUtils elanUtils;
private final ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils;
*
* @param dataBroker DataBroker
* @param elanL2GatewayUtils l2 gateway utils
- * @param entityOwnershipService the entity ownership service
+ * @param entityOwnershipUtils the entity ownership utils
* @param elanUtils the ELAN utilities
* @param elanL2GatewayMulticastUtils l2 gateway multicast utils
* @param l2GatewayDevice the l2 gateway device
* @param l2GwConnId l2 gateway connection id
*/
public HwvtepLogicalSwitchListener(DataBroker dataBroker, ElanL2GatewayUtils elanL2GatewayUtils,
- EntityOwnershipService entityOwnershipService, ElanUtils elanUtils,
+ EntityOwnershipUtils entityOwnershipUtils, ElanUtils elanUtils,
ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils,
L2GatewayDevice l2GatewayDevice,
String logicalSwitchName,
super(LogicalSwitches.class, HwvtepLogicalSwitchListener.class);
this.broker = dataBroker;
this.elanL2GatewayUtils = elanL2GatewayUtils;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.elanUtils = elanUtils;
this.elanL2GatewayMulticastUtils = elanL2GatewayMulticastUtils;
this.nodeId = new NodeId(l2GatewayDevice.getHwvtepNodeId());
LogicalSwitchAddedJob logicalSwitchAddedWorker = new LogicalSwitchAddedJob(elanL2GatewayUtils,
elanL2GatewayMulticastUtils, logicalSwitchName, physicalDevice, elanDevice,
defaultVlanId);
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, logicalSwitchAddedWorker.getJobKey() ,
- "create vlan mappings and mcast configurations",
- logicalSwitchAddedWorker);
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, logicalSwitchAddedWorker.getJobKey(),
+ "create vlan mappings and mcast configurations", logicalSwitchAddedWorker);
} catch (RuntimeException e) {
LOG.error("Failed to handle HwVTEPLogicalSwitch - add for: {}", identifier, e);
} finally {
import java.util.concurrent.ExecutionException;
import java.util.function.BiPredicate;
import java.util.function.Predicate;
-
import org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.hwvtep.HwvtepAbstractDataTreeChangeListener;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepHACache;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
/** The itm rpc service. */
private final ItmRpcService itmRpcService;
- /** The entity ownership service. */
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
private final L2GatewayConnectionUtils l2GatewayConnectionUtils;
* @param dataBroker
* the data broker
* @param itmRpcService itm rpc
- * @param entityOwnershipService entity ownership service
+ * @param entityOwnershipUtils entity ownership utils
* @param l2GatewayConnectionUtils l2gw connection utils
* @param l2gwServiceProvider l2gw service Provider
* @param l2GatewayUtils utils
* @param haListener HA Op node listners
*/
public HwvtepPhysicalSwitchListener(final DataBroker dataBroker, ItmRpcService itmRpcService,
- EntityOwnershipService entityOwnershipService,
+ EntityOwnershipUtils entityOwnershipUtils,
L2GatewayConnectionUtils l2GatewayConnectionUtils,
L2gwServiceProvider l2gwServiceProvider,
L2GatewayUtils l2GatewayUtils, HAOpClusteredListener haListener) {
super(PhysicalSwitchAugmentation.class, HwvtepPhysicalSwitchListener.class);
this.dataBroker = dataBroker;
this.itmRpcService = itmRpcService;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.l2GatewayConnectionUtils = l2GatewayConnectionUtils;
this.l2gwServiceProvider = l2gwServiceProvider;
this.l2GatewayUtils = l2GatewayUtils;
this.haOpClusteredListener = haListener;
}
+ @Override
public void init() {
registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
}
&& TUNNEL_IP_CHANGED.test(phySwitchAfter, existingDevice)) {
final String hwvtepId = existingDevice.getHwvtepNodeId();
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService,
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, existingDevice.getDeviceName(),
"handling Physical Switch add create itm tunnels ", () -> {
LOG.info("Deleting itm tunnels for device {}", existingDevice.getDeviceName());
L2GatewayUtils.deleteItmTunnels(itmRpcService, hwvtepId,
import java.util.concurrent.ConcurrentHashMap;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.genius.datastoreutils.hwvtep.HwvtepClusteredDataTreeChangeListener;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepUtils;
private final DataBroker broker;
private final ElanL2GatewayUtils elanL2GatewayUtils;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
public HwvtepTerminationPointListener(DataBroker broker, ElanL2GatewayUtils elanL2GatewayUtils,
- EntityOwnershipService entityOwnershipService) {
+ EntityOwnershipUtils entityOwnershipUtils) {
super(TerminationPoint.class, HwvtepTerminationPointListener.class);
this.broker = broker;
this.elanL2GatewayUtils = elanL2GatewayUtils;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
//No longer needed as port reconciliation is added in plugin
//registerListener(LogicalDatastoreType.OPERATIONAL, broker);
LOG.debug("created HwvtepTerminationPointListener");
del.getAugmentation(HwvtepPhysicalPortAugmentation.class);
if (portAugmentation != null) {
final NodeId nodeId = identifier.firstIdentifierOf(Node.class).firstKeyOf(Node.class).getNodeId();
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, HwvtepSouthboundConstants.ELAN_ENTITY_NAME,
- "Handling Physical port delete", () ->
- handlePortDeleted(identifier, portAugmentation, del, nodeId));
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, HwvtepSouthboundConstants.ELAN_ENTITY_NAME,
+ "Handling Physical port delete", () -> handlePortDeleted(identifier, portAugmentation, del, nodeId));
return;
}
}
add.getAugmentation(HwvtepPhysicalPortAugmentation.class);
if (portAugmentation != null) {
final NodeId nodeId = identifier.firstIdentifierOf(Node.class).firstKeyOf(Node.class).getNodeId();
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, HwvtepSouthboundConstants.ELAN_ENTITY_NAME,
- "handling Physical Switch add", () -> handlePortAdded(portAugmentation, add, nodeId));
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, HwvtepSouthboundConstants.ELAN_ENTITY_NAME,
+ () -> handlePortAdded(portAugmentation, add, nodeId));
return;
}
import org.apache.commons.lang3.tuple.Pair;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
import org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
import org.opendaylight.genius.utils.SystemPropertyReader;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepUtils;
private final DataBroker broker;
private final ElanDmacUtils elanDmacUtils;
private final ElanItmUtils elanItmUtils;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
private final OdlInterfaceRpcService interfaceManagerRpcService;
private final DataStoreJobCoordinator dataStoreJobCoordinator = DataStoreJobCoordinator.getInstance();
@Inject
public ElanL2GatewayUtils(DataBroker broker, ElanDmacUtils elanDmacUtils, ElanItmUtils elanItmUtils,
- EntityOwnershipService entityOwnershipService,
+ EntityOwnershipUtils entityOwnershipUtils,
OdlInterfaceRpcService interfaceManagerRpcService) {
this.broker = broker;
this.elanDmacUtils = elanDmacUtils;
this.elanItmUtils = elanItmUtils;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.interfaceManagerRpcService = interfaceManagerRpcService;
}
// DMAC table
if (elanDpns != null && elanDpns.size() > 0) {
String jobKey = elan.getElanInstanceName() + ":" + macToBeAdded;
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, jobKey, "install l2gw macs in dmac table",
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, jobKey, "install l2gw macs in dmac table",
() -> {
if (doesLocalUcastMacExistsInCache(extL2GwDevice, localUcastMacs)) {
for (DpnInterfaces elanDpn : elanDpns) {
macList.add(new PhysAddress(macToBeAdded));
String jobKey = "hwvtep:" + elan.getElanInstanceName() + ":" + macToBeAdded;
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, jobKey, "install remote ucast macs in l2gw device",
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, jobKey, "install remote ucast macs in l2gw device",
() -> {
if (!doesLocalUcastMacExistsInCache(extL2GwDevice, localUcastMacs)) {
LOG.trace(
for (final MacAddress mac : macAddresses) {
if (elanDpns != null && !elanDpns.isEmpty()) {
String jobKey = elanName + ":" + mac.getValue();
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, jobKey, "delete l2gw macs from dmac table",
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, jobKey, "delete l2gw macs from dmac table",
() -> {
List<ListenableFuture<Void>> futures = new ArrayList<>();
for (DpnInterfaces elanDpn : elanDpns) {
//Batched job
DeleteL2GwDeviceMacsFromElanJob job = new DeleteL2GwDeviceMacsFromElanJob(elanName, l2GwDevice,
macAddresses);
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, job.getJobKey(),
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, job.getJobKey(),
"delete remote ucast macs in l2gw devices", job);
}
if (localMacs != null && !localMacs.isEmpty()) {
for (final MacAddress mac : localMacs) {
String jobKey = elanName + ":" + mac.getValue();
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, jobKey,
- "delete l2gw macs from dmac table",
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, jobKey,
() -> elanDmacUtils.deleteDmacFlowsToExternalMac(elanTag, dpnId,
l2GwDevice.getHwvtepNodeId(), mac.getValue()));
}
import java.util.Set;
import javax.annotation.Nonnull;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
import org.opendaylight.genius.mdsalutil.MDSALUtil;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepUtils;
import org.opendaylight.netvirt.elan.internal.ElanInstanceManager;
private final DataBroker broker;
private final ElanInstanceManager elanInstanceManager;
private final ElanL2GatewayUtils elanL2GatewayUtils;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
private final ElanUtils elanUtils;
private final ElanL2GatewayMulticastUtils elanL2GatewayMulticastUtils;
public L2GatewayConnectionUtils(DataBroker dataBroker, ElanInstanceManager elanInstanceManager,
- EntityOwnershipService entityOwnershipService, ElanUtils elanUtils,
+ EntityOwnershipUtils entityOwnershipUtils, ElanUtils elanUtils,
ElanL2GatewayUtils elanL2GatewayUtils) {
this.broker = dataBroker;
this.elanInstanceManager = elanInstanceManager;
this.elanL2GatewayUtils = elanL2GatewayUtils;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.elanUtils = elanUtils;
this.elanL2GatewayMulticastUtils = elanUtils.getElanL2GatewayMulticastUtils();
}
new DisAssociateHwvtepFromElanJob(broker, elanL2GatewayUtils, elanL2GatewayMulticastUtils,
elanL2GwDevice, elanName,
l2Device, defaultVlan, hwvtepNodeId, isLastL2GwConnDeleted);
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, disAssociateHwvtepToElanJob.getJobKey(),
- "remove l2gw connection job ", disAssociateHwvtepToElanJob);
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, disAssociateHwvtepToElanJob.getJobKey(),
+ "remove l2gw connection job", disAssociateHwvtepToElanJob);
}
}
hwvtepNodeId, elanName);
if (logicalSwitch == null) {
HwvtepLogicalSwitchListener hwVTEPLogicalSwitchListener = new HwvtepLogicalSwitchListener(broker,
- elanL2GatewayUtils, entityOwnershipService, elanUtils, elanL2GatewayMulticastUtils,
+ elanL2GatewayUtils, entityOwnershipUtils, elanUtils, elanL2GatewayMulticastUtils,
l2GatewayDevice, elanName, l2Device, defaultVlan, l2GwConnId);
hwVTEPLogicalSwitchListener.registerListener(LogicalDatastoreType.OPERATIONAL, broker);
createLogicalSwitch = true;
elanL2GatewayUtils, elanL2GatewayMulticastUtils, l2GatewayDevice, elanInstance,
l2Device, defaultVlan, createLogicalSwitch);
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService, associateHwvtepToElanJob.getJobKey() ,
- "create logical switch in hwvtep topo",
- associateHwvtepToElanJob);
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, associateHwvtepToElanJob.getJobKey() ,
+ "create logical switch in hwvtep topo", associateHwvtepToElanJob);
} else {
LOG.info("L2GwConn create is not handled for device with id {} as it's not connected", l2DeviceName);
HwvtepLocalUcastMacListener localUcastMacListener =
new HwvtepLocalUcastMacListener(broker, elanL2GatewayUtils);
settableFuture.set(resultNode);
- Optional<Node> nodeOptional = (Optional<Node>) resultNode;
+ Optional<Node> nodeOptional = resultNode;
if (nodeOptional.isPresent()) {
Node node = nodeOptional.get();
if (node.getAugmentation(HwvtepGlobalAugmentation.class) != null) {
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
-
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundUtils;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
private final ItmRpcService itmRpcService;
- private final EntityOwnershipService entityOwnershipService;
-
private final L2GatewayConnectionUtils l2GatewayConnectionUtils;
public L2GatewayUtils(DataBroker dataBroker, ItmRpcService itmRpcService,
- EntityOwnershipService entityOwnershipService,
L2GatewayConnectionUtils l2GatewayConnectionUtils) {
this.dataBroker = dataBroker;
this.itmRpcService = itmRpcService;
- this.entityOwnershipService = entityOwnershipService;
this.l2GatewayConnectionUtils = l2GatewayConnectionUtils;
}
import java.util.Collections;
import java.util.List;
import java.util.Set;
-
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.infrautils.inject.AbstractLifecycle;
import org.opendaylight.netvirt.elan.utils.ElanClusterUtils;
import org.opendaylight.netvirt.elanmanager.api.IL2gwService;
private final DataBroker dataBroker;
private final ItmRpcService itmRpcService;
private final L2GatewayConnectionUtils l2GatewayConnectionUtils;
- private final EntityOwnershipService entityOwnershipService;
+ private final EntityOwnershipUtils entityOwnershipUtils;
- public L2gwServiceProvider(final DataBroker dataBroker, final EntityOwnershipService entityOwnershipService,
+ public L2gwServiceProvider(final DataBroker dataBroker, final EntityOwnershipUtils entityOwnershipUtils,
ItmRpcService itmRpcService, L2GatewayConnectionUtils l2GatewayConnectionUtils) {
this.dataBroker = dataBroker;
- this.entityOwnershipService = entityOwnershipService;
+ this.entityOwnershipUtils = entityOwnershipUtils;
this.itmRpcService = itmRpcService;
this.l2GatewayConnectionUtils = l2GatewayConnectionUtils;
}
@Override
public void provisionItmAndL2gwConnection(L2GatewayDevice l2GwDevice, String psName,
String hwvtepNodeId, IpAddress tunnelIpAddr) {
- ElanClusterUtils.runOnlyInLeaderNode(entityOwnershipService,
+ ElanClusterUtils.runOnlyInOwnerNode(entityOwnershipUtils, hwvtepNodeId,
"Handling Physical Switch add create itm tunnels ", () -> {
ElanL2GatewayUtils.createItmTunnels(itmRpcService, hwvtepNodeId, psName, tunnelIpAddr);
return Collections.emptyList();
package org.opendaylight.netvirt.elan.utils;
import com.google.common.base.Optional;
-import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.function.Function;
-
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.DataStoreJobCoordinator;
-import org.opendaylight.genius.utils.SystemPropertyReader;
-import org.opendaylight.genius.utils.clustering.ClusteringUtils;
+import org.opendaylight.genius.utils.clustering.EntityOwnershipUtils;
import org.opendaylight.genius.utils.hwvtep.HwvtepSouthboundConstants;
import org.opendaylight.netvirt.elan.l2gw.utils.SettableFutureCallback;
import org.opendaylight.yangtools.yang.binding.DataObject;
private ElanClusterUtils() {
}
- public static void runOnlyInLeaderNode(EntityOwnershipService entityOwnershipService, Runnable job) {
- runOnlyInLeaderNode(entityOwnershipService, job, "");
- }
-
- public static void runOnlyInLeaderNode(EntityOwnershipService entityOwnershipService, final Runnable job,
- final String jobDescription) {
- ListenableFuture<Boolean> checkEntityOwnerFuture = ClusteringUtils.checkNodeEntityOwner(
- entityOwnershipService, HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
- HwvtepSouthboundConstants.ELAN_ENTITY_NAME);
- Futures.addCallback(checkEntityOwnerFuture, new FutureCallback<Boolean>() {
- @Override
- public void onSuccess(Boolean isOwner) {
- if (isOwner) {
- job.run();
- } else {
- LOG.trace("job is not run as i m not cluster owner desc :{} ", jobDescription);
- }
- }
-
- @Override
- public void onFailure(Throwable error) {
- LOG.error("Failed to identity cluster owner ", error);
- }
- }, MoreExecutors.directExecutor());
+ public static void runOnlyInOwnerNode(EntityOwnershipUtils entityOwnershipUtils, String jobDesc, Runnable job) {
+ entityOwnershipUtils.runOnlyInOwnerNode(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
+ HwvtepSouthboundConstants.ELAN_ENTITY_NAME, DataStoreJobCoordinator.getInstance(), jobDesc, job);
}
- public static void runOnlyInLeaderNode(EntityOwnershipService entityOwnershipService, String jobKey,
- Callable<List<ListenableFuture<Void>>> dataStoreJob) {
- runOnlyInLeaderNode(entityOwnershipService, jobKey, "", dataStoreJob);
- }
-
- public static void runOnlyInLeaderNode(EntityOwnershipService entityOwnershipService, final String jobKey,
- final String jobDescription,
- final Callable<List<ListenableFuture<Void>>> dataStoreJob) {
- ListenableFuture<Boolean> checkEntityOwnerFuture = ClusteringUtils.checkNodeEntityOwner(
- entityOwnershipService, HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
- HwvtepSouthboundConstants.ELAN_ENTITY_NAME);
- Futures.addCallback(checkEntityOwnerFuture, new FutureCallback<Boolean>() {
- @Override
- public void onSuccess(Boolean isOwner) {
- if (isOwner) {
- LOG.trace("scheduling job {} ", jobDescription);
- DataStoreJobCoordinator.getInstance().enqueueJob(jobKey, dataStoreJob,
- SystemPropertyReader.getDataStoreJobCoordinatorMaxRetries());
- } else {
- LOG.trace("job is not run as i m not cluster owner desc :{} ", jobDescription);
- }
- }
-
- @Override
- public void onFailure(Throwable error) {
- LOG.error("Failed to identity cluster owner for job " + jobDescription, error);
- }
- }, MoreExecutors.directExecutor());
+ public static void runOnlyInOwnerNode(EntityOwnershipUtils entityOwnershipUtils, String jobKey, String jobDesc,
+ Callable<List<ListenableFuture<Void>>> job) {
+ entityOwnershipUtils.runOnlyInOwnerNode(HwvtepSouthboundConstants.ELAN_ENTITY_TYPE,
+ HwvtepSouthboundConstants.ELAN_ENTITY_NAME, DataStoreJobCoordinator.getInstance(), jobKey, jobDesc, job);
}
public static <T extends DataObject> void asyncReadAndExecute(final DataBroker broker,
Futures.addCallback(tx.read(datastoreType, iid),
new SettableFutureCallback<Optional<T>>(settableFuture) {
+ @Override
public void onSuccess(Optional<T> data) {
function.apply(data);
super.onSuccess(data);
<reference id="notificationService"
interface="org.opendaylight.controller.md.sal.binding.api.NotificationService" />
<reference id="entityOwnershipService"
- interface="org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService" />
+ interface="org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService" />
<reference id="mdsalUtils"
interface="org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager" />
<reference id="interfaceManager"
update-strategy="none">
</odl:clustered-app-config>
+ <bean id="entityOwnershipUtils" class="org.opendaylight.genius.utils.clustering.EntityOwnershipUtils">
+ <argument ref="entityOwnershipService" />
+ </bean>
+
<bean id="elanBridgeManager"
class="org.opendaylight.netvirt.elan.internal.ElanBridgeManager">
<argument ref="dataBroker" />
<argument ref="dataBroker" />
<argument ref="elanInterfaceManager" />
<argument ref="elanUtils" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
</bean>
<bean id="elanDpnInterfaceClusteredListener"
class="org.opendaylight.netvirt.elan.internal.ElanDpnInterfaceClusteredListener"
init-method="init" destroy-method="close">
<argument ref="dataBroker" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
<argument ref="elanUtils" />
<argument ref="elanL2GatewayUtils" />
</bean>
<bean id="l2GatewayConnectionUtils" class="org.opendaylight.netvirt.elan.l2gw.utils.L2GatewayConnectionUtils">
<argument ref="dataBroker" />
<argument ref="elanInstanceManager" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
<argument ref="elanUtils" />
<argument ref="elanL2GatewayUtils" />
</bean>
<argument ref="dataBroker" />
<argument ref="elanDmacUtils" />
<argument ref="elanItmUtils" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
<argument ref="odlInterfaceRpcService" />
</bean>
init-method="init" destroy-method="close">
<argument ref="dataBroker" />
<argument ref="itmRpcService" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
<argument ref="l2GatewayConnectionUtils" />
<argument ref="l2gwService" />
<argument ref="l2gatewayUtils" />
destroy-method="close">
<argument ref="dataBroker" />
<argument ref="elanL2GatewayUtils" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
</bean>
<bean id="haEventHandler"
class="org.opendaylight.netvirt.elan.l2gw.listeners.ElanGroupListener">
<argument ref="elanInterfaceManager" />
<argument ref="dataBroker" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
<argument ref="elanInstanceManager" />
</bean>
class="org.opendaylight.netvirt.elan.l2gw.utils.L2gwServiceProvider"
init-method="init">
<argument ref="dataBroker" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
<argument ref="itmRpcService" />
<argument ref="l2GatewayConnectionUtils" />
</bean>
class="org.opendaylight.netvirt.elan.l2gw.listeners.ElanInstanceListener"
init-method="init" destroy-method="close">
<argument ref="dataBroker" />
- <argument ref="entityOwnershipService" />
+ <argument ref="entityOwnershipUtils" />
</bean>
<bean id="evpnUtils" class="org.opendaylight.netvirt.elan.evpn.utils.EvpnUtils"
init-method="init" destroy-method="close">
<argument ref="dataBroker" />
<argument ref="itmRpcService" />
- <argument ref="entityOwnershipService" />
<argument ref="l2GatewayConnectionUtils" />
</bean>
import org.mockito.Mockito;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.test.DataBrokerTestModule;
-import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
import org.opendaylight.daexim.DataImportBootReady;
import org.opendaylight.genius.idmanager.IdManager;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.genius.mdsalutil.interfaces.testutils.TestIMdsalApiManager;
import org.opendaylight.genius.testutils.TestInterfaceManager;
import org.opendaylight.infrautils.inject.guice.testutils.AbstractGuiceJsr250Module;
+import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.netvirt.elan.evpn.utils.EvpnUtils;
import org.opendaylight.netvirt.elan.internal.ElanServiceProvider;
import org.opendaylight.netvirt.elan.statusanddiag.ElanStatusMonitor;