Fixing component properties for various providers.

Change-Id: I909c84958109f61e10a542774a2d4b82c428c0f5
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/OsgiPropertyConstants.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..41e65ba
--- /dev/null
+++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/OsgiPropertyConstants.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.provider.rest.device.impl;
+
+/**
+ * Constants for default values of configurable properties.
+ */
+public final class OsgiPropertyConstants {
+
+    private OsgiPropertyConstants() {}
+
+    public static final String POLL_FREQUENCY = "pollFrequency";
+    public static final int POLL_FREQUENCY_DEFAULT = 30;
+
+}
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
index e63e6e0..c6a0ae9 100644
--- a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
+++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
@@ -92,12 +92,17 @@
 import static org.onosproject.net.config.NetworkConfigEvent.Type.CONFIG_ADDED;
 import static org.onosproject.net.config.NetworkConfigEvent.Type.CONFIG_REMOVED;
 import static org.onosproject.net.config.NetworkConfigEvent.Type.CONFIG_UPDATED;
+import static org.onosproject.provider.rest.device.impl.OsgiPropertyConstants.POLL_FREQUENCY;
+import static org.onosproject.provider.rest.device.impl.OsgiPropertyConstants.POLL_FREQUENCY_DEFAULT;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * Provider for devices that use REST as means of configuration communication.
  */
-@Component(immediate = true, service = DeviceProvider.class)
+@Component(immediate = true, service = DeviceProvider.class,
+        property = {
+                POLL_FREQUENCY + ":Integer=" + POLL_FREQUENCY_DEFAULT,
+        })
 public class RestDeviceProvider extends AbstractProvider
         implements DeviceProvider {
     private static final String APP_NAME = "org.onosproject.restsb";
@@ -106,7 +111,6 @@
     private static final String IPADDRESS = "ipaddress";
     private static final String ISNOTNULL = "Rest device is not null";
     private static final String UNKNOWN = "unknown";
-    private static final String POLL_FREQUENCY = "pollFrequency";
     private static final int REST_TIMEOUT_SEC = 5;
     private static final int EXECUTOR_THREAD_POOL_SIZE = 8;
     private final Logger log = getLogger(getClass());
@@ -132,11 +136,10 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected DriverService driverService;
 
-    private static final int DEFAULT_POLL_FREQUENCY_SECONDS = 30;
     //@Property(name = POLL_FREQUENCY, intValue = DEFAULT_POLL_FREQUENCY_SECONDS,
     //        label = "Configure poll frequency for port status and statistics; " +
     //                "default is 30 seconds")
-    private int pollFrequency = DEFAULT_POLL_FREQUENCY_SECONDS;
+    private int pollFrequency = POLL_FREQUENCY_DEFAULT;
 
     private DeviceProviderService providerService;
     private ApplicationId appId;
@@ -182,7 +185,7 @@
         if (context != null) {
             Dictionary<?, ?> properties = context.getProperties();
             pollFrequency = Tools.getIntegerProperty(properties, POLL_FREQUENCY,
-                                                     DEFAULT_POLL_FREQUENCY_SECONDS);
+                                                     POLL_FREQUENCY_DEFAULT);
             log.info("Configured. Poll frequency is configured to {} seconds", pollFrequency);
         }