OSGi property annotations for remaining apps

Change-Id: I5f87ebeb65eb85ee7161e35a838d9275fde22787
diff --git a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java
index a0f9548..6480e2b 100644
--- a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java
+++ b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java
@@ -88,17 +88,23 @@
 import static org.onlab.packet.MacAddress.valueOf;
 import static org.onosproject.dhcp.IpAssignment.AssignmentStatus.Option_RangeNotEnforced;
 import static org.onosproject.dhcp.IpAssignment.AssignmentStatus.Option_Requested;
+import static org.onosproject.dhcp.impl.OsgiPropertyConstants.ALLOW_HOST_DISCOVERY;
+import static org.onosproject.dhcp.impl.OsgiPropertyConstants.ALLOW_HOST_DISCOVERY_DEFAULT;
 import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY;
 
 /**
  * Skeletal ONOS DHCP Server application.
  */
-@Component(immediate = true, service = DhcpService.class)
+@Component(
+    immediate = true,
+    service = DhcpService.class,
+    property = {
+        ALLOW_HOST_DISCOVERY + "=" + ALLOW_HOST_DISCOVERY_DEFAULT
+    }
+)
 public class DhcpManager implements DhcpService {
 
     private static final ProviderId PID = new ProviderId("of", "org.onosproject.dhcp", true);
-    private static final String ALLOW_HOST_DISCOVERY = "allowHostDiscovery";
-    private static final boolean DEFAULT_ALLOW_HOST_DISCOVERY = false;
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -134,9 +140,8 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected ComponentConfigService componentConfigService;
 
-    //@Property(name = ALLOW_HOST_DISCOVERY, boolValue = DEFAULT_ALLOW_HOST_DISCOVERY,
-    //        label = "Allow host discovery from DHCP request")
-    private boolean allowHostDiscovery = DEFAULT_ALLOW_HOST_DISCOVERY;
+    /** Allow host discovery from DHCP request. */
+    private boolean allowHostDiscovery = ALLOW_HOST_DISCOVERY_DEFAULT;
 
     protected HostProviderService hostProviderService;
     private final HostProvider hostProvider = new InternalHostProvider();
diff --git a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/OsgiPropertyConstants.java b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..d7909a9
--- /dev/null
+++ b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.dhcp.impl;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String ALLOW_HOST_DISCOVERY = "allowHostDiscovery";
+    static final boolean ALLOW_HOST_DISCOVERY_DEFAULT = false;
+}
diff --git a/apps/events/src/main/java/org/onosproject/events/EventHistoryManager.java b/apps/events/src/main/java/org/onosproject/events/EventHistoryManager.java
index 490e585..f99dd15 100644
--- a/apps/events/src/main/java/org/onosproject/events/EventHistoryManager.java
+++ b/apps/events/src/main/java/org/onosproject/events/EventHistoryManager.java
@@ -47,11 +47,22 @@
 import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
 import static org.onlab.util.Tools.groupedThreads;
 import static org.onlab.util.Tools.minPriority;
+import static org.onosproject.events.OsgiPropertyConstants.EXCLUDE_STATS_EVENT;
+import static org.onosproject.events.OsgiPropertyConstants.EXCLUDE_STATS_EVENT_DEFAULT;
+import static org.onosproject.events.OsgiPropertyConstants.SIZE_LIMIT;
+import static org.onosproject.events.OsgiPropertyConstants.SIZE_LIMIT_DEFAULT;
 
 /**
  * Application to store history of instance local ONOS Events.
  */
-@Component(immediate = true, service = EventHistoryService.class)
+@Component(
+    immediate = true,
+    service = EventHistoryService.class,
+    property = {
+        EXCLUDE_STATS_EVENT + "=" + EXCLUDE_STATS_EVENT_DEFAULT,
+        SIZE_LIMIT + "=" + SIZE_LIMIT_DEFAULT
+    }
+)
 public class EventHistoryManager
     implements EventHistoryService {
 
@@ -87,13 +98,11 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected NetworkConfigService netcfgService;
 
-    //@Property(name = "excludeStatsEvent", boolValue = true,
-    //          label = "Exclude stats related events")
-    private boolean excludeStatsEvent = true;
+    /** Exclude stats related events. */
+    private boolean excludeStatsEvent = EXCLUDE_STATS_EVENT_DEFAULT;
 
-    //@Property(name = "sizeLimit", intValue = 10_000,
-    //          label = "Number of event history to store")
-    private int sizeLimit = 10_000;
+    /** Number of event history to store. */
+    private int sizeLimit = SIZE_LIMIT_DEFAULT;
 
     private ApplicationId appId;
 
diff --git a/apps/events/src/main/java/org/onosproject/events/OsgiPropertyConstants.java b/apps/events/src/main/java/org/onosproject/events/OsgiPropertyConstants.java
new file mode 100644
index 0000000..bc5110f
--- /dev/null
+++ b/apps/events/src/main/java/org/onosproject/events/OsgiPropertyConstants.java
@@ -0,0 +1,28 @@
+/*
+ * 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.events;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String EXCLUDE_STATS_EVENT = "excludeStatsEvent";
+    static final boolean EXCLUDE_STATS_EVENT_DEFAULT = true;
+
+    static final String SIZE_LIMIT = "sizeLimit";
+    static final int SIZE_LIMIT_DEFAULT = 10000;
+}
diff --git a/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/OsgiPropertyConstants.java b/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..e552a49
--- /dev/null
+++ b/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/OsgiPropertyConstants.java
@@ -0,0 +1,28 @@
+/*
+ * 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.faultmanagement.impl;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String POLL_FREQUENCY_SECONDS = "alarmPollFrequencySeconds";
+    static final int POLL_FREQUENCY_SECONDS_DEFAULT = 60;
+
+    static final String CLEAR_FREQUENCY_SECONDS = "clearedAlarmPurgeFrequencySeconds";
+    static final int CLEAR_FREQUENCY_SECONDS_DEFAULT = 500;
+}
diff --git a/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/PollingAlarmProvider.java b/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/PollingAlarmProvider.java
index eeee627..bceaf3f 100644
--- a/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/PollingAlarmProvider.java
+++ b/apps/faultmanagement/fmmgr/src/main/java/org/onosproject/faultmanagement/impl/PollingAlarmProvider.java
@@ -50,13 +50,23 @@
 import static java.util.concurrent.Executors.newScheduledThreadPool;
 import static org.onlab.util.Tools.get;
 import static org.onlab.util.Tools.groupedThreads;
+import static org.onosproject.faultmanagement.impl.OsgiPropertyConstants.CLEAR_FREQUENCY_SECONDS;
+import static org.onosproject.faultmanagement.impl.OsgiPropertyConstants.CLEAR_FREQUENCY_SECONDS_DEFAULT;
+import static org.onosproject.faultmanagement.impl.OsgiPropertyConstants.POLL_FREQUENCY_SECONDS;
+import static org.onosproject.faultmanagement.impl.OsgiPropertyConstants.POLL_FREQUENCY_SECONDS_DEFAULT;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * Alarm provider capable of polling the environment using the device driver
  * {@link AlarmConsumer} behaviour.
  */
-@Component(immediate = true)
+@Component(
+    immediate = true,
+    property = {
+        POLL_FREQUENCY_SECONDS + "=" + POLL_FREQUENCY_SECONDS_DEFAULT,
+        CLEAR_FREQUENCY_SECONDS + "=" + CLEAR_FREQUENCY_SECONDS_DEFAULT
+    }
+)
 public class PollingAlarmProvider extends AbstractProvider implements AlarmProvider {
 
     private final Logger log = getLogger(getClass());
@@ -87,16 +97,11 @@
 
     private static final int CORE_POOL_SIZE = 10;
 
-    private static final int DEFAULT_POLL_FREQUENCY_SECONDS = 60;
-    //@Property(name = "alarmPollFrequencySeconds", intValue = DEFAULT_POLL_FREQUENCY_SECONDS,
-    //        label = "Frequency (in seconds) for polling alarm from devices")
-    protected int alarmPollFrequencySeconds = DEFAULT_POLL_FREQUENCY_SECONDS;
+    /** Frequency (in seconds) for polling alarm from devices. */
+    protected int alarmPollFrequencySeconds = POLL_FREQUENCY_SECONDS_DEFAULT;
 
-    // TODO implement purging of old alarms.
-    private static final int DEFAULT_CLEAR_FREQUENCY_SECONDS = 500;
-    //@Property(name = "clearedAlarmPurgeSeconds", intValue = DEFAULT_CLEAR_FREQUENCY_SECONDS,
-    //        label = "Frequency (in seconds) for deleting cleared alarms")
-    private int clearedAlarmPurgeFrequencySeconds = DEFAULT_CLEAR_FREQUENCY_SECONDS;
+    /** Frequency (in seconds) for deleting cleared alarms. */
+    private int clearedAlarmPurgeFrequencySeconds = CLEAR_FREQUENCY_SECONDS_DEFAULT;
 
     public PollingAlarmProvider() {
         super(new ProviderId("default", "org.onosproject.core"));
@@ -119,7 +124,7 @@
         mastershipService.addListener(mastershipListener);
 
         if (context == null) {
-            alarmPollFrequencySeconds = DEFAULT_POLL_FREQUENCY_SECONDS;
+            alarmPollFrequencySeconds = POLL_FREQUENCY_SECONDS_DEFAULT;
             log.info("No component configuration");
         } else {
             Dictionary<?, ?> properties = context.getProperties();
@@ -167,10 +172,10 @@
     private int getNewPollFrequency(Dictionary<?, ?> properties, int pollFrequency) {
         int newPollFrequency;
         try {
-            String s = get(properties, "pollFrequency");
+            String s = get(properties, POLL_FREQUENCY_SECONDS);
             newPollFrequency = isNullOrEmpty(s) ? pollFrequency : Integer.parseInt(s.trim());
         } catch (NumberFormatException | ClassCastException e) {
-            newPollFrequency = DEFAULT_POLL_FREQUENCY_SECONDS;
+            newPollFrequency = POLL_FREQUENCY_SECONDS_DEFAULT;
         }
         return newPollFrequency;
     }
diff --git a/apps/faultmanagement/fmmgr/src/test/java/org/onosproject/faultmanagement/impl/PollingAlarmProviderTest.java b/apps/faultmanagement/fmmgr/src/test/java/org/onosproject/faultmanagement/impl/PollingAlarmProviderTest.java
index 0ebd4cc..d6c14ce 100644
--- a/apps/faultmanagement/fmmgr/src/test/java/org/onosproject/faultmanagement/impl/PollingAlarmProviderTest.java
+++ b/apps/faultmanagement/fmmgr/src/test/java/org/onosproject/faultmanagement/impl/PollingAlarmProviderTest.java
@@ -307,7 +307,7 @@
 
         @Override
         public Object get(Object key) {
-            if ("pollFrequency".equals(key)) {
+            if (OsgiPropertyConstants.POLL_FREQUENCY_SECONDS.equals(key)) {
                 return "1";
             }
             return null;
diff --git a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java
index a3bb6ef..cce6102 100644
--- a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java
+++ b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxDbMetricsReporter.java
@@ -37,12 +37,23 @@
 import java.util.Dictionary;
 import java.util.concurrent.TimeUnit;
 
+import static org.onosproject.influxdbmetrics.OsgiPropertyConstants.METRIC_NAMES;
+import static org.onosproject.influxdbmetrics.OsgiPropertyConstants.METRIC_NAMES_DEFAULT;
+import static org.onosproject.influxdbmetrics.OsgiPropertyConstants.MONITOR_ALL;
+import static org.onosproject.influxdbmetrics.OsgiPropertyConstants.MONITOR_ALL_DEFAULT;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * A Metric reporter that reports all metrics value to influxDB server.
  */
-@Component(immediate = true, service = InfluxDbMetricsReporter.class)
+@Component(
+    immediate = true,
+    service = InfluxDbMetricsReporter.class,
+    property = {
+        MONITOR_ALL + ":Boolean=" + MONITOR_ALL_DEFAULT,
+        METRIC_NAMES + "=" + METRIC_NAMES_DEFAULT
+    }
+)
 public class DefaultInfluxDbMetricsReporter implements InfluxDbMetricsReporter {
     private final Logger log = getLogger(getClass());
 
@@ -50,7 +61,7 @@
     private static final TimeUnit REPORT_TIME_UNIT = TimeUnit.MINUTES;
 
     private static final String DEFAULT_PROTOCOL = "http";
-    private static final String DEFAULT_METRIC_NAMES = "default";
+
     private static final String SEPARATOR = ":";
     private static final int DEFAULT_CONN_TIMEOUT = 1000;
     private static final int DEFAULT_READ_TIMEOUT = 1000;
@@ -67,15 +78,11 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected ClusterService clusterService;
 
-    //@Property(name = "monitorAll", boolValue = true,
-    //        label = "Enable to monitor all of metrics stored in metric registry " +
-    //                "default is true")
-    protected boolean monitorAll = true;
+    /** Enable to monitor all of metrics stored in metric registry default is true. */
+    protected boolean monitorAll = MONITOR_ALL_DEFAULT;
 
-    //@Property(name = "metricNames", value = DEFAULT_METRIC_NAMES,
-    //        label = "Names of metric to be monitored in third party monitoring " +
-    //                "server; default metric names are 'default'")
-    protected String metricNames = DEFAULT_METRIC_NAMES;
+    /** Names of metric to be monitored in third party monitoring server; default metric names are 'default'. */
+    protected String metricNames = METRIC_NAMES_DEFAULT;
 
     protected String address;
     protected int port;
@@ -224,11 +231,11 @@
     private void readComponentConfiguration(ComponentContext context) {
         Dictionary<?, ?> properties = context.getProperties();
 
-        String metricNameStr = Tools.get(properties, "metricNames");
-        metricNames = metricNameStr != null ? metricNameStr : DEFAULT_METRIC_NAMES;
+        String metricNameStr = Tools.get(properties, METRIC_NAMES);
+        metricNames = metricNameStr != null ? metricNameStr : METRIC_NAMES_DEFAULT;
         log.info("Configured. Metric name is {}", metricNames);
 
-        Boolean monitorAllEnabled = Tools.isPropertyEnabled(properties, "monitorAll");
+        Boolean monitorAllEnabled = Tools.isPropertyEnabled(properties, MONITOR_ALL);
         if (monitorAllEnabled == null) {
             log.info("Monitor all metrics is not configured, " +
                     "using current value of {}", monitorAll);
diff --git a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/OsgiPropertyConstants.java b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/OsgiPropertyConstants.java
index b42badc..46428ff 100644
--- a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/OsgiPropertyConstants.java
+++ b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/OsgiPropertyConstants.java
@@ -34,4 +34,10 @@
 
     static final String PASSWORD = "password";
     static final String PASSWORD_DEFAULT = "onos.password";
+
+    static final String MONITOR_ALL = "monitorAll";
+    static final boolean MONITOR_ALL_DEFAULT = true;
+
+    static final String METRIC_NAMES = "metricNames";
+    static final String METRIC_NAMES_DEFAULT = "default";
 }
diff --git a/apps/mlb/src/main/java/org/onosproject/mlb/MastershipLoadBalancer.java b/apps/mlb/src/main/java/org/onosproject/mlb/MastershipLoadBalancer.java
index ca6cd59..f9ed0da 100644
--- a/apps/mlb/src/main/java/org/onosproject/mlb/MastershipLoadBalancer.java
+++ b/apps/mlb/src/main/java/org/onosproject/mlb/MastershipLoadBalancer.java
@@ -48,6 +48,8 @@
 import java.util.concurrent.atomic.AtomicReference;
 
 import static org.onlab.util.Tools.groupedThreads;
+import static org.onosproject.mlb.OsgiPropertyConstants.SCHEDULE_PERIOD;
+import static org.onosproject.mlb.OsgiPropertyConstants.SCHEDULE_PERIOD_DEFAULT;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
@@ -56,15 +58,18 @@
  * thread executor that must only have one thread due to issues that can occur is multiple balancing events occur in
  * parallel.
  */
-@Component(immediate = true)
+@Component(
+    immediate = true,
+    property = {
+        SCHEDULE_PERIOD + ":Integer=" + SCHEDULE_PERIOD_DEFAULT
+    }
+)
 public class MastershipLoadBalancer {
 
     private final Logger log = getLogger(getClass());
 
-    private static final int DEFAULT_SCHEDULE_PERIOD = 30;
-    //@Property(name = "schedulePeriod", intValue = DEFAULT_SCHEDULE_PERIOD,
-    //        label = "Period to schedule balancing the mastership to be shared as evenly as by all online instances.")
-    private int schedulePeriod = DEFAULT_SCHEDULE_PERIOD;
+    /** Period to schedule balancing the mastership to be shared as evenly as by all online instances. */
+    private int schedulePeriod = SCHEDULE_PERIOD_DEFAULT;
 
     private static final String REBALANCE_MASTERSHIP = "rebalance/mastership";
 
@@ -200,11 +205,11 @@
         Dictionary<?, ?> properties = context.getProperties();
 
         Integer newSchedulePeriod = Tools.getIntegerProperty(properties,
-                                                             "schedulePeriod");
+                                                             SCHEDULE_PERIOD);
         if (newSchedulePeriod == null) {
-            schedulePeriod = DEFAULT_SCHEDULE_PERIOD;
+            schedulePeriod = SCHEDULE_PERIOD_DEFAULT;
             log.info("Schedule period is not configured, default value is {}",
-                     DEFAULT_SCHEDULE_PERIOD);
+                     SCHEDULE_PERIOD_DEFAULT);
         } else {
             schedulePeriod = newSchedulePeriod;
             log.info("Configured. Schedule period is configured to {}", schedulePeriod);
diff --git a/apps/mlb/src/main/java/org/onosproject/mlb/OsgiPropertyConstants.java b/apps/mlb/src/main/java/org/onosproject/mlb/OsgiPropertyConstants.java
new file mode 100644
index 0000000..9c7aa12
--- /dev/null
+++ b/apps/mlb/src/main/java/org/onosproject/mlb/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.mlb;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String SCHEDULE_PERIOD = "schedulePeriod";
+    static final int SCHEDULE_PERIOD_DEFAULT = 30;
+}
diff --git a/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/NetworkDiagnosticManager.java b/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/NetworkDiagnosticManager.java
index 3a9635c..b787447 100644
--- a/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/NetworkDiagnosticManager.java
+++ b/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/NetworkDiagnosticManager.java
@@ -44,13 +44,21 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onosproject.fnl.impl.OsgiPropertyConstants.AUTO_REGISTER_DEFAULT_DIAGNOSTICS;
+import static org.onosproject.fnl.impl.OsgiPropertyConstants.AUTO_REGISTER_DEFAULT_DIAGNOSTICS_DEFAULT;
 
 /**
  * Default implementation of the Network Troubleshooting Core Service.
  *
  * It is simply modularized at present.
  */
-@Component(immediate = true, service = NetworkDiagnosticService.class)
+@Component(
+    immediate = true,
+    service = NetworkDiagnosticService.class,
+    property = {
+        AUTO_REGISTER_DEFAULT_DIAGNOSTICS + ":Boolean=" + AUTO_REGISTER_DEFAULT_DIAGNOSTICS_DEFAULT
+    }
+)
 public class NetworkDiagnosticManager implements NetworkDiagnosticService {
 
     /**
@@ -59,9 +67,6 @@
     public static final String NTS_APP_NAME =
             "org.onosproject.FNL.Network-Troubleshoot";
 
-    private static final String PROPERTY_AUTO_REGISTER_DIAG =
-            "autoRegisterDefaultDiagnostics";
-
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
@@ -86,9 +91,8 @@
     protected LinkService ls;
 
 
-    //@Property(name = PROPERTY_AUTO_REGISTER_DIAG, boolValue = true,
-    //        label = "Automatically register all of default diagnostic modules.")
-    private boolean autoRegister = true;
+    /** Automatically register all of default diagnostic modules. */
+    private boolean autoRegisterDefaultDiagnostics = AUTO_REGISTER_DEFAULT_DIAGNOSTICS_DEFAULT;
 
 
     private ApplicationId appId;
@@ -132,19 +136,19 @@
         Dictionary<?, ?> properties =  context.getProperties();
 
         Boolean autoRegisterEnabled =
-                Tools.isPropertyEnabled(properties, PROPERTY_AUTO_REGISTER_DIAG);
+                Tools.isPropertyEnabled(properties, AUTO_REGISTER_DEFAULT_DIAGNOSTICS);
         if (autoRegisterEnabled == null) {
             log.warn("Auto Register is not configured, " +
-                    "using current value of {}", autoRegister);
+                    "using current value of {}", autoRegisterDefaultDiagnostics);
         } else {
-            autoRegister = autoRegisterEnabled;
+            autoRegisterDefaultDiagnostics = autoRegisterEnabled;
             log.info("Configured. Auto Register is {}",
-                    autoRegister ? "enabled" : "disabled");
+                    autoRegisterDefaultDiagnostics ? "enabled" : "disabled");
         }
     }
 
     private void autoRegisterDiagnostics() {
-        if (!autoRegister) {
+        if (!autoRegisterDefaultDiagnostics) {
             return;
         }
 
diff --git a/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/OsgiPropertyConstants.java b/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..9921413
--- /dev/null
+++ b/apps/network-troubleshoot/core/src/main/java/org/onosproject/fnl/impl/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.fnl.impl;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String AUTO_REGISTER_DEFAULT_DIAGNOSTICS = "autoRegisterDefaultDiagnostics";
+    static final boolean AUTO_REGISTER_DEFAULT_DIAGNOSTICS_DEFAULT = true;
+}
diff --git a/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java b/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java
index 19edcbc..59ee3d9 100644
--- a/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java
+++ b/apps/newoptical/src/main/java/org/onosproject/newoptical/OpticalPathProvisioner.java
@@ -107,12 +107,20 @@
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.onosproject.net.LinkKey.linkKey;
 import static org.onosproject.net.optical.device.OpticalDeviceServiceView.opticalView;
+import static org.onosproject.newoptical.OsgiPropertyConstants.MAX_PATHS;
+import static org.onosproject.newoptical.OsgiPropertyConstants.MAX_PATHS_DEFAULT;
 
 /**
  * Main component to configure optical connectivity.
  */
 @Beta
-@Component(immediate = true, service = OpticalPathService.class)
+@Component(
+    immediate = true,
+    service = OpticalPathService.class,
+    property = {
+        MAX_PATHS + ":Integer=" + MAX_PATHS_DEFAULT
+    }
+)
 public class OpticalPathProvisioner
         extends AbstractListenerManager<OpticalPathEvent, OpticalPathListener>
         implements OpticalPathService {
@@ -159,11 +167,8 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected ResourceService resourceService;
 
-    private static final String MAX_PATHS = "maxPaths";
-    private static final int DEFAULT_MAX_PATHS = 10;
-    //@Property(name = MAX_PATHS, intValue = DEFAULT_MAX_PATHS,
-    //        label = "Maximum number of paths to consider for path provisioning")
-    private int maxPaths = DEFAULT_MAX_PATHS;
+    /** Maximum number of paths to consider for path provisioning. */
+    private int maxPaths = MAX_PATHS_DEFAULT;
 
     private ApplicationId appId;
 
@@ -262,7 +267,7 @@
      */
     private void readComponentConfiguration(ComponentContext context) {
         Dictionary<?, ?> properties = context.getProperties();
-        maxPaths = Tools.getIntegerProperty(properties, MAX_PATHS, DEFAULT_MAX_PATHS);
+        maxPaths = Tools.getIntegerProperty(properties, MAX_PATHS, MAX_PATHS_DEFAULT);
         log.info("Configured. Maximum paths to consider is configured to {}", maxPaths);
     }
 
diff --git a/apps/newoptical/src/main/java/org/onosproject/newoptical/OsgiPropertyConstants.java b/apps/newoptical/src/main/java/org/onosproject/newoptical/OsgiPropertyConstants.java
new file mode 100644
index 0000000..bf56d6f
--- /dev/null
+++ b/apps/newoptical/src/main/java/org/onosproject/newoptical/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.newoptical;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String MAX_PATHS = "maxPaths";
+    static final int MAX_PATHS_DEFAULT = 10;
+}
diff --git a/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/NodeMetricsManager.java b/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/NodeMetricsManager.java
index 7ae4cec..eec2c65 100644
--- a/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/NodeMetricsManager.java
+++ b/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/NodeMetricsManager.java
@@ -56,11 +56,19 @@
 import java.util.stream.Collectors;
 
 import static org.onlab.util.Tools.getIntegerProperty;
+import static org.onosproject.nodemetrics.impl.OsgiPropertyConstants.METRIC_POLL_FREQUENCY_SECONDS;
+import static org.onosproject.nodemetrics.impl.OsgiPropertyConstants.METRIC_POLL_FREQUENCY_SECONDS_DEFAULT;
 
 
-@Component(immediate = true, service = NodeMetricsService.class)
+@Component(
+    immediate = true,
+    service = NodeMetricsService.class,
+    property = {
+        METRIC_POLL_FREQUENCY_SECONDS + ":Integer=" + METRIC_POLL_FREQUENCY_SECONDS_DEFAULT
+    }
+)
 public class NodeMetricsManager implements NodeMetricsService {
-    private static final int DEFAULT_POLL_FREQUENCY_SECONDS = 15;
+
     private static final String SLASH = "/";
     private static final Double PERCENTAGE_MULTIPLIER = 100.0;
     private final Logger log = LoggerFactory
@@ -93,9 +101,8 @@
 
     private Sigar sigar;
 
-    //@Property(name = "metricPollFrequencySeconds", intValue = DEFAULT_POLL_FREQUENCY_SECONDS,
-    //        label = "Frequency (in seconds) for polling controller metrics")
-    protected int metricPollFrequencySeconds = DEFAULT_POLL_FREQUENCY_SECONDS;
+    /** Frequency (in seconds) for polling controller metrics. */
+    protected int metricPollFrequencySeconds = METRIC_POLL_FREQUENCY_SECONDS_DEFAULT;
 
     @Activate
     public void activate(ComponentContext context) {
@@ -206,11 +213,11 @@
     private int getNewPollFrequency(Dictionary<?, ?> properties) {
         int newPollFrequency;
         try {
-            newPollFrequency = getIntegerProperty(properties, "metricPollFrequencySeconds");
+            newPollFrequency = getIntegerProperty(properties, METRIC_POLL_FREQUENCY_SECONDS);
             //String s = getIntegerProperty(properties, "metricPollFrequencySeconds");
             //newPollFrequency = isNullOrEmpty(s) ? pollFrequency : Integer.parseInt(s.trim());
         } catch (NumberFormatException | ClassCastException e) {
-            newPollFrequency = DEFAULT_POLL_FREQUENCY_SECONDS;
+            newPollFrequency = METRIC_POLL_FREQUENCY_SECONDS_DEFAULT;
         }
         return newPollFrequency;
     }
diff --git a/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/OsgiPropertyConstants.java b/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..0eb0d71
--- /dev/null
+++ b/apps/nodemetrics/mgr/src/main/java/org/onosproject/nodemetrics/impl/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.nodemetrics.impl;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final int METRIC_POLL_FREQUENCY_SECONDS_DEFAULT = 15;
+    static final String METRIC_POLL_FREQUENCY_SECONDS = "metricPollFrequencySeconds";
+}
diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalCircuitIntentCompiler.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalCircuitIntentCompiler.java
index bb74d77..a484d66 100644
--- a/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalCircuitIntentCompiler.java
+++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OpticalCircuitIntentCompiler.java
@@ -82,21 +82,24 @@
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static org.onosproject.net.optical.device.OpticalDeviceServiceView.opticalView;
+import static org.onosproject.net.optical.intent.impl.compiler.OsgiPropertyConstants.MAX_CAPACITY;
+import static org.onosproject.net.optical.intent.impl.compiler.OsgiPropertyConstants.MAX_CAPACITY_DEFAULT;
 
 /**
  * An intent compiler for {@link org.onosproject.net.intent.OpticalCircuitIntent}.
  */
-@Component(immediate = true)
+@Component(
+    immediate = true,
+    property = {
+        MAX_CAPACITY + ":Integer=" + MAX_CAPACITY_DEFAULT
+    }
+)
 public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircuitIntent> {
 
     private static final Logger log = LoggerFactory.getLogger(OpticalCircuitIntentCompiler.class);
 
-    private static final int DEFAULT_MAX_CAPACITY = 10;
-
-    //@Property(name = "maxCapacity", intValue = DEFAULT_MAX_CAPACITY,
-    //        label = "Maximum utilization of an optical connection.")
-
-    private int maxCapacity = DEFAULT_MAX_CAPACITY;
+    /** Maximum utilization of an optical connection. */
+    private int maxCapacity = MAX_CAPACITY_DEFAULT;
 
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected ComponentConfigService cfgService;
@@ -133,7 +136,7 @@
         Dictionary properties = context.getProperties();
 
         //TODO for reduction check if the new capacity is smaller than the size of the current mapping
-        String propertyString = Tools.get(properties, "maxCapacity");
+        String propertyString = Tools.get(properties, MAX_CAPACITY);
 
         //Ignore if propertyString is empty or null
         if (!Strings.isNullOrEmpty(propertyString)) {
diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OsgiPropertyConstants.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OsgiPropertyConstants.java
new file mode 100644
index 0000000..5eb77e7
--- /dev/null
+++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/intent/impl/compiler/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.net.optical.intent.impl.compiler;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String MAX_CAPACITY = "maxCapacity";
+    static final int MAX_CAPACITY_DEFAULT = 10;
+}
diff --git a/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/OsgiPropertyConstants.java b/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/OsgiPropertyConstants.java
new file mode 100644
index 0000000..e21155b
--- /dev/null
+++ b/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/OsgiPropertyConstants.java
@@ -0,0 +1,25 @@
+/*
+ * 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.routeservice.store;
+
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String DISTRIBUTED = "distributed";
+    static final boolean DISTRIBUTED_DEFAULT = false;
+}
diff --git a/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/RouteStoreImpl.java b/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/RouteStoreImpl.java
index f174801..edd22c3 100644
--- a/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/RouteStoreImpl.java
+++ b/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/RouteStoreImpl.java
@@ -42,11 +42,19 @@
 import java.util.Dictionary;
 import java.util.Set;
 
+import static org.onosproject.routeservice.store.OsgiPropertyConstants.DISTRIBUTED;
+import static org.onosproject.routeservice.store.OsgiPropertyConstants.DISTRIBUTED_DEFAULT;
+
 /**
  * An implementation of RouteStore that is backed by either LocalRouteStore or
  * DistributedRouteStore according to configuration.
  */
-@Component(service = RouteStore.class)
+@Component(
+    service = RouteStore.class,
+    property = {
+        DISTRIBUTED + ":Boolean=" + DISTRIBUTED_DEFAULT
+    }
+)
 public class RouteStoreImpl extends AbstractStore<InternalRouteEvent, RouteStoreDelegate>
         implements RouteStore {
 
@@ -56,8 +64,7 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     public StorageService storageService;
 
-    //@Property(name = "distributed", boolValue = false,
-    //        label = "Enable distributed route store")
+    /** Enable distributed route store. */
     private boolean distributed;
 
     private final Logger log = LoggerFactory.getLogger(getClass());
@@ -92,7 +99,7 @@
             return;
         }
 
-        String strDistributed = Tools.get(properties, "distributed");
+        String strDistributed = Tools.get(properties, DISTRIBUTED);
         boolean expectDistributed = Boolean.parseBoolean(strDistributed);
 
         // Start route store during first start or config change
diff --git a/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
index da62a5b..9348665 100644
--- a/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/DirectHostManager.java
@@ -64,12 +64,20 @@
 
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.onlab.packet.IpAddress.Version.INET6;
+import static org.onosproject.routing.impl.OsgiPropertyConstants.ENABLED;
+import static org.onosproject.routing.impl.OsgiPropertyConstants.ENABLED_DEFAULT;
 
 /**
  * Reactively handles sending packets to hosts that are directly connected to
  * router interfaces.
  */
-@Component(immediate = true, enabled = false)
+@Component(
+    immediate = true,
+    enabled = false,
+    property = {
+        ENABLED + ":Boolean=" + ENABLED_DEFAULT
+    }
+)
 public class DirectHostManager {
 
     private Logger log = LoggerFactory.getLogger(getClass());
@@ -89,11 +97,8 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected ComponentConfigService componentConfigService;
 
-    private static final boolean DEFAULT_ENABLED = false;
-
-    //@Property(name = "enabled", boolValue = DEFAULT_ENABLED,
-    //        label = "Enable reactive directly-connected host processing")
-    private volatile boolean enabled = DEFAULT_ENABLED;
+    /** Enable reactive directly-connected host processing. */
+    private volatile boolean enabled = ENABLED_DEFAULT;
 
     private static final String APP_NAME = "org.onosproject.directhost";
 
@@ -120,7 +125,7 @@
 
     @Modified
     private void modified(ComponentContext context) {
-        Boolean boolEnabled = Tools.isPropertyEnabled(context.getProperties(), "enabled");
+        Boolean boolEnabled = Tools.isPropertyEnabled(context.getProperties(), ENABLED);
         if (boolEnabled != null) {
             if (enabled && !boolEnabled) {
                 enabled = false;
diff --git a/apps/routing/common/src/main/java/org/onosproject/routing/impl/OsgiPropertyConstants.java b/apps/routing/common/src/main/java/org/onosproject/routing/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..ca4643f
--- /dev/null
+++ b/apps/routing/common/src/main/java/org/onosproject/routing/impl/OsgiPropertyConstants.java
@@ -0,0 +1,28 @@
+/*
+ * 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.routing.impl;
+
+/**
+ * Name/Value constants for properties.
+ */
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String ENABLED = "enabled";
+    static final boolean ENABLED_DEFAULT = false;
+}
diff --git a/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java
index 679d33e..0d7adf5 100644
--- a/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java
+++ b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/ControlPlaneRedirectManager.java
@@ -79,13 +79,20 @@
 import static org.onlab.packet.IPv6.PROTOCOL_ICMP6;
 import static org.onlab.packet.IPv6.getLinkLocalAddress;
 import static org.onlab.packet.IPv6.getSolicitNodeAddress;
+import static org.onosproject.routing.cpr.OsgiPropertyConstants.FORCE_UNPROVISION;
+import static org.onosproject.routing.cpr.OsgiPropertyConstants.FORCE_UNPROVISION_DEFAULT;
 import static org.slf4j.LoggerFactory.getLogger;
 
 /**
  * Manages connectivity between peers redirecting control traffic to a routing
  * control plane available on the dataplane.
  */
-@Component(immediate = true)
+@Component(
+    immediate = true,
+    property = {
+        FORCE_UNPROVISION + ":Boolean=" + FORCE_UNPROVISION_DEFAULT
+    }
+)
 public class ControlPlaneRedirectManager {
 
     private final Logger log = getLogger(getClass());
@@ -125,9 +132,8 @@
     @Reference(cardinality = ReferenceCardinality.MANDATORY)
     protected ComponentConfigService cfgService;
 
-    //@Property(name = "forceUnprovision", boolValue = false,
-    //        label = "Force unprovision when the device goes offline")
-    private boolean forceUnprovision = false;
+    /** Force unprovision when the device goes offline. */
+    private boolean forceUnprovision = FORCE_UNPROVISION_DEFAULT;
 
     private static final String APP_NAME = "org.onosproject.cpr";
     private ApplicationId appId;
@@ -175,7 +181,7 @@
         Dictionary<?, ?> properties = context.getProperties();
         Boolean flag;
 
-        flag = Tools.isPropertyEnabled(properties, "forceUnprovision");
+        flag = Tools.isPropertyEnabled(properties, FORCE_UNPROVISION);
         if (flag == null) {
             log.info("ForceUnprovision is not configured, " +
                     "using current value of {}", forceUnprovision);
diff --git a/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/OsgiPropertyConstants.java b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/OsgiPropertyConstants.java
new file mode 100644
index 0000000..86e2f35
--- /dev/null
+++ b/apps/routing/cpr/src/main/java/org/onosproject/routing/cpr/OsgiPropertyConstants.java
@@ -0,0 +1,28 @@
+/*
+ * 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.routing.cpr;
+
+/**
+ * Name/Value constants for properties.
+ */
+public final class OsgiPropertyConstants {
+    private OsgiPropertyConstants() {
+    }
+
+    static final String FORCE_UNPROVISION = "forceUnprovision";
+    static final boolean FORCE_UNPROVISION_DEFAULT = false;
+}