Migrate ElanUtils to use NamedLocks
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / internal / ElanPacketInHandler.java
index 556a039b7cf7367f1d16e1af4419d3467d8a1afd..2f2934a8fb7cebd36cbd80f98495efc389a6b74f 100755 (executable)
@@ -201,11 +201,15 @@ public class ElanPacketInHandler implements PacketProcessingListener {
         return "MAC-" + macAddress + " ELAN_TAG-" + elanTag;
     }
 
+    private static String getElanMacDPNKey(long elanTag, String macAddress, BigInteger dpnId) {
+        return "MAC-" + macAddress + " ELAN_TAG-" + elanTag + "DPN_ID-" + dpnId;
+    }
+
     private void enqueueJobForDPNSpecificTasks(final String macAddress, final long elanTag, String interfaceName,
                                                PhysAddress physAddress, ElanInstance elanInstance,
                                                InterfaceInfo interfaceInfo, MacEntry oldMacEntry,
                                                MacEntry newMacEntry, boolean isVlanOrFlatProviderIface) {
-        jobCoordinator.enqueueJob(ElanUtils.getElanMacDPNKey(elanTag, macAddress, interfaceInfo.getDpId()), () -> {
+        jobCoordinator.enqueueJob(getElanMacDPNKey(elanTag, macAddress, interfaceInfo.getDpId()), () -> {
             macMigrationFlowsCleanup(interfaceName, elanInstance, oldMacEntry, isVlanOrFlatProviderIface);
             BigInteger dpId = interfaceManager.getDpnForInterface(interfaceName);
             elanL2GatewayUtils.scheduleAddDpnMacInExtDevices(elanInstance.getElanInstanceName(), dpId,