BUG-5464,5954: making table features configurable for the Li plugin.
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / device / DeviceManagerImpl.java
index 35c372b332fab7a85a1136d1e140016f19265d57..aae6b2f15b3d0ee79f1e837feab4247c84b53fe4 100644 (file)
@@ -67,7 +67,7 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
     private final long globalNotificationQuota;
     private final boolean switchFeaturesMandatory;
     private boolean isNotificationFlowRemovedOff;
-
+    private boolean skipTableFeatures;
     private static final int SPY_RATE = 10;
 
     private final DataBroker dataBroker;
@@ -81,6 +81,7 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
 
     private final long barrierIntervalNanos;
     private final int barrierCountLimit;
+
     private ExtensionConverterProvider extensionConverterProvider;
     private ScheduledThreadPoolExecutor spyPool;
     private final ClusterSingletonServiceProvider singletonServiceProvider;
@@ -93,16 +94,18 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
                              final boolean switchFeaturesMandatory,
                              final long barrierInterval,
                              final int barrierCountLimit,
-                            
                              final MessageSpy messageSpy,
                              final boolean isNotificationFlowRemovedOff,
                              final ClusterSingletonServiceProvider singletonServiceProvider,
                              final NotificationPublishService notificationPublishService,
                              final HashedWheelTimer hashedWheelTimer,
-                             final ConvertorExecutor convertorExecutor) {
+                             final ConvertorExecutor convertorExecutor,
+                             final boolean skipTableFeatures) {
+
         this.switchFeaturesMandatory = switchFeaturesMandatory;
         this.globalNotificationQuota = globalNotificationQuota;
         this.isNotificationFlowRemovedOff = isNotificationFlowRemovedOff;
+        this.skipTableFeatures = skipTableFeatures;
         this.dataBroker = Preconditions.checkNotNull(dataBroker);
         this.convertorExecutor = convertorExecutor;
         this.hashedWheelTimer = hashedWheelTimer;
@@ -191,7 +194,8 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
                 messageSpy,
                 translatorLibrary,
                 this,
-                convertorExecutor);
+                convertorExecutor,
+                skipTableFeatures);
 
         deviceContexts.putIfAbsent(deviceInfo, deviceContext);
 
@@ -260,11 +264,6 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
     @Override
     public void onDeviceContextLevelDown(final DeviceInfo deviceInfo) {
 
-        deviceContexts.remove(deviceInfo);
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Device context removed for node {}", deviceInfo.getLOGValue());
-        }
-
         LifecycleService lifecycleService = lifecycleServices.remove(deviceInfo);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Lifecycle service removed for node {}", deviceInfo.getLOGValue());
@@ -279,6 +278,12 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
                 LOG.warn("Closing lifecycle service for node {} was unsuccessful ", deviceInfo.getLOGValue(), e);
             }
         }
+
+        deviceContexts.remove(deviceInfo);
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Device context removed for node {}", deviceInfo.getLOGValue());
+        }
+
     }
 
     @Override
@@ -374,4 +379,10 @@ public class DeviceManagerImpl implements DeviceManager, ExtensionConverterProvi
         return this.isNotificationFlowRemovedOff;
     }
 
+
+    @Override
+    public void setSkipTableFeatures(boolean skipTableFeaturesValue) {
+        skipTableFeatures = skipTableFeaturesValue;
+    }
+
 }