Decompose RPC implementation classes
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / configuration / OpenFlowProviderConfigImpl.java
index 2766851808aad9ccbf16da26858c1c11912d51ef..2c676c60cdfcf03a5bce8cb58a48dd5ccc18146c 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.impl.configuration;
 
 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationProperty;
@@ -13,10 +12,14 @@ import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationS
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint16Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.NonZeroUint32Type;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflow.provider.config.rev160510.OpenflowProviderConfig;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
-
-public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
+import org.opendaylight.yangtools.yang.binding.AbstractAugmentable;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
+
+// FIXME: Rename this to "ConfigurationOpenflowProviderConfig" or some such. OpenFlowProviderConfigImpl is taken as
+//        Builder-based (guaranteed to work).
+public class OpenFlowProviderConfigImpl extends AbstractAugmentable<OpenflowProviderConfig>
+        implements OpenflowProviderConfig {
     private final ConfigurationService service;
 
     public OpenFlowProviderConfigImpl(final ConfigurationService service) {
@@ -25,127 +28,141 @@ public class OpenFlowProviderConfigImpl implements OpenflowProviderConfig {
 
     @Override
     public NonZeroUint16Type getRpcRequestsQuota() {
-        final Integer property = service.getProperty(
-                ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(),
-                Integer::valueOf);
-
-        return new NonZeroUint16Type(property);
+        return new NonZeroUint16Type(service.<Uint16>getProperty(
+            ConfigurationProperty.RPC_REQUESTS_QUOTA.toString(), Uint16::valueOf));
     }
 
     @Override
-    public Boolean isSwitchFeaturesMandatory() {
+    public Boolean getSwitchFeaturesMandatory() {
         return service.getProperty(ConfigurationProperty.SWITCH_FEATURES_MANDATORY.toString(), Boolean::valueOf);
     }
 
     @Override
-    public Long getGlobalNotificationQuota() {
-        return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Long::valueOf);
+    public Uint32 getGlobalNotificationQuota() {
+        return service.getProperty(ConfigurationProperty.GLOBAL_NOTIFICATION_QUOTA.toString(), Uint32::valueOf);
     }
 
     @Override
-    public Boolean isIsStatisticsPollingOn() {
+    public Boolean getIsStatisticsPollingOn() {
         return service.getProperty(ConfigurationProperty.IS_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
     }
 
     @Override
-    public Boolean isIsStatisticsRpcEnabled() {
+    public Boolean getIsTableStatisticsPollingOn() {
+        return service.getProperty(ConfigurationProperty.IS_TABLE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
+    }
+
+    @Override
+    public Boolean getIsFlowStatisticsPollingOn() {
+        return service.getProperty(ConfigurationProperty.IS_FLOW_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
+    }
+
+    @Override
+    public Boolean getIsGroupStatisticsPollingOn() {
+        return service.getProperty(ConfigurationProperty.IS_GROUP_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
+    }
+
+    @Override
+    public Boolean getIsMeterStatisticsPollingOn() {
+        return service.getProperty(ConfigurationProperty.IS_METER_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
+    }
+
+    @Override
+    public Boolean getIsQueueStatisticsPollingOn() {
+        return service.getProperty(ConfigurationProperty.IS_QUEUE_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
+    }
+
+    @Override
+    public Boolean getIsPortStatisticsPollingOn() {
+        return service.getProperty(ConfigurationProperty.IS_PORT_STATISTICS_POLLING_ON.toString(), Boolean::valueOf);
+    }
+
+    @Override
+    public Boolean getIsStatisticsRpcEnabled() {
         return service.getProperty(ConfigurationProperty.IS_STATISTICS_RPC_ENABLED.toString(), Boolean::valueOf);
     }
 
     @Override
     public NonZeroUint32Type getBarrierIntervalTimeoutLimit() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.BARRIER_INTERVAL_TIMEOUT_LIMIT.toString(), Uint32::valueOf));
     }
 
     @Override
     public NonZeroUint16Type getBarrierCountLimit() {
-        final Integer property = service.getProperty(
-                ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(),
-                Integer::valueOf);
-
-        return new NonZeroUint16Type(property);
+        return new NonZeroUint16Type(service.<Uint16>getProperty(
+            ConfigurationProperty.BARRIER_COUNT_LIMIT.toString(), Uint16::valueOf));
     }
 
     @Override
     public NonZeroUint32Type getEchoReplyTimeout() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.ECHO_REPLY_TIMEOUT.toString(), Uint32::valueOf));
     }
 
     @Override
-    public Integer getThreadPoolMinThreads() {
-        return service.getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Integer::valueOf);
+    public Uint16 getThreadPoolMinThreads() {
+        return service.<Uint16>getProperty(ConfigurationProperty.THREAD_POOL_MIN_THREADS.toString(), Uint16::valueOf);
     }
 
     @Override
     public NonZeroUint16Type getThreadPoolMaxThreads() {
-        final Integer property = service.getProperty(
-                ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(),
-                Integer::valueOf);
-
-        return new NonZeroUint16Type(property);
+        return new NonZeroUint16Type(service.<Uint16>getProperty(
+            ConfigurationProperty.THREAD_POOL_MAX_THREADS.toString(), Uint16::valueOf));
     }
 
     @Override
-    public Long getThreadPoolTimeout() {
-        return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Long::valueOf);
+    public Uint32 getThreadPoolTimeout() {
+        return service.getProperty(ConfigurationProperty.THREAD_POOL_TIMEOUT.toString(), Uint32::valueOf);
     }
 
     @Override
-    public Boolean isEnableFlowRemovedNotification() {
+    public Boolean getEnableFlowRemovedNotification() {
         return service.getProperty(ConfigurationProperty.ENABLE_FLOW_REMOVED_NOTIFICATION.toString(), Boolean::valueOf);
     }
 
     @Override
-    public Boolean isSkipTableFeatures() {
+    public Boolean getSkipTableFeatures() {
         return service.getProperty(ConfigurationProperty.SKIP_TABLE_FEATURES.toString(), Boolean::valueOf);
     }
 
     @Override
-    public Boolean isEnableEqualRole() {
+    public Boolean getEnableEqualRole() {
         return service.getProperty(ConfigurationProperty.ENABLE_EQUAL_ROLE.toString(), Boolean::valueOf);
     }
 
     @Override
     public NonZeroUint32Type getBasicTimerDelay() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.BASIC_TIMER_DELAY.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.BASIC_TIMER_DELAY.toString(), Uint32::valueOf));
     }
 
     @Override
     public NonZeroUint32Type getMaximumTimerDelay() {
-        final Long property = service.getProperty(
-                ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(),
-                Long::valueOf);
-
-        return new NonZeroUint32Type(property);
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.MAXIMUM_TIMER_DELAY.toString(), Uint32::valueOf));
     }
 
     @Override
-    public Boolean isUseSingleLayerSerialization() {
+    public Boolean getUseSingleLayerSerialization() {
         return service.getProperty(ConfigurationProperty.USE_SINGLE_LAYER_SERIALIZATION.toString(), Boolean::valueOf);
     }
 
     @Override
-    public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-            .openflow.provider.config.rev160510.OpenflowProviderConfig>> E getAugmentation(
-                    java.lang.Class<E> augmentationType) {
-        return null;
+    public Uint16 getDeviceConnectionRateLimitPerMin() {
+        return service.getProperty(
+            ConfigurationProperty.DEVICE_CONNECTION_RATE_LIMIT_PER_MIN.toString(), Uint16::valueOf);
     }
 
     @Override
-    public Class<? extends DataContainer> getImplementedInterface() {
-        return OpenflowProviderConfig.class;
+    public Uint16 getDeviceConnectionHoldTimeInSeconds() {
+        return service.getProperty(
+            ConfigurationProperty.DEVICE_CONNECTION_HOLD_TIME_IN_SECONDS.toString(), Uint16::valueOf);
     }
 
+    @Override
+    public NonZeroUint32Type getDeviceDatastoreRemovalDelay() {
+        return new NonZeroUint32Type(service.<Uint32>getProperty(
+            ConfigurationProperty.DEVICE_DATASTORE_REMOVAL_DELAY.toString(), Uint32::valueOf));
+    }
 }