Merge "BUG-6890: Enabling statistics rpc config through openflowplugin.cfg"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / OpenFlowPluginProviderImpl.java
index b253c1019d07bdce5fc6ba50bab9aef60b42abfa..0b15c1b8d289d9f3973758cf41db22a6186ac409 100644 (file)
@@ -67,7 +67,8 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
     private static final Logger LOG = LoggerFactory.getLogger(OpenFlowPluginProviderImpl.class);
     private static final MessageIntelligenceAgency messageIntelligenceAgency = new MessageIntelligenceAgencyImpl();
     private static final int TICKS_PER_WHEEL = 500;
-    private static final long TICK_DURATION = 10; // 0.5 sec.
+    // 0.5 sec.
+    private static final long TICK_DURATION = 10;
 
     private final HashedWheelTimer hashedWheelTimer = new HashedWheelTimer(TICK_DURATION, TimeUnit.MILLISECONDS, TICKS_PER_WHEEL);
 
@@ -92,6 +93,8 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
     private boolean isStatisticsPollingOff = false;
     private boolean isStatisticsRpcEnabled;
     private boolean isNotificationFlowRemovedOff = false;
+    private boolean skipTableFeatures = true;
+
     private final ThreadPoolExecutor threadPool;
     private ClusterSingletonServiceProvider singletonServicesProvider;
 
@@ -173,10 +176,16 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
         this.isNotificationFlowRemovedOff = isNotificationFlowRemovedOff;
     }
 
+    @Override
     public void setClusteringSingletonServicesProvider(ClusterSingletonServiceProvider singletonServicesProvider) {
         this.singletonServicesProvider = singletonServicesProvider;
     }
 
+    @Override
+    public void setSkipTableFeatures(final boolean skipTableFeatures){
+            this.skipTableFeatures = skipTableFeatures;
+    }
+
     @Override
     public void setSwitchFeaturesMandatory(final boolean switchFeaturesMandatory) {
         this.switchFeaturesMandatory = switchFeaturesMandatory;
@@ -224,11 +233,11 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
                 barrierCountLimit,
                 getMessageIntelligenceAgency(),
                 isNotificationFlowRemovedOff,
-
                 singletonServicesProvider,
                 notificationPublishService,
                 hashedWheelTimer,
-               convertorManager);
+                convertorManager,
+                skipTableFeatures);
 
         ((ExtensionConverterProviderKeeper) deviceManager).setExtensionConverterProvider(extensionConverterManager);
 
@@ -264,6 +273,12 @@ public class OpenFlowPluginProviderImpl implements OpenFlowPluginProvider, OpenF
         if(deviceManager != null && props.containsKey("notification-flow-removed-off")) {
             deviceManager.setIsNotificationFlowRemovedOff(Boolean.valueOf(props.get("notification-flow-removed-off").toString()));
         }
+        if(deviceManager != null && props.containsKey("skip-table-features")) {
+            deviceManager.setSkipTableFeatures(Boolean.valueOf(props.get("skip-table-features").toString()));
+        }
+        if(rpcManager != null && props.containsKey("is-statistics-rpc-enabled")){
+            rpcManager.setStatisticsRpcEnabled(Boolean.valueOf((props.get("is-statistics-rpc-enabled").toString())));
+        }
     }
 
     private static void registerMXBean(final MessageIntelligenceAgency messageIntelligenceAgency) {