Removing commented out @Property annotations from the drivers, protocols, pipelines and providers.
Change-Id: I4cabc5a53c93b778824c72cebbce0ec49700eade
diff --git a/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java b/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java
index b804c6d..2e4b412 100644
--- a/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java
+++ b/providers/host/src/main/java/org/onosproject/provider/host/impl/HostLocationProvider.java
@@ -103,6 +103,7 @@
import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
import static org.onlab.util.Tools.groupedThreads;
+import static org.onosproject.provider.host.impl.OsgiPropertyConstants.*;
import static org.slf4j.LoggerFactory.getLogger;
/**
@@ -111,13 +112,13 @@
*/
@Component(immediate = true, service = HostProvider.class,
property = {
- "hostRemovalEnabled:Boolean=true",
- "requestArp:Boolean=true",
- "requestIpv6ND:Boolean=false",
- "useDhcp:Boolean=false",
- "useDhcp6:Boolean=false",
- "requestInterceptsEnabled:Boolean=true",
- "multihomingEnabled:Boolean=false",
+ HOST_REMOVAL_ENABLED + ":Boolean=" + HOST_REMOVAL_ENABLED_DEFAULT,
+ REQUEST_ARP + ":Boolean=" + REQUEST_ARP_DEFAULT,
+ REQUEST_NDP + ":Boolean=" + REQUEST_NDP_DEFAULT,
+ USE_DHCP + ":Boolean=" + USE_DHCP_DEFAULT,
+ USE_DHCP6 + ":Boolean=" + USE_DHCP6_DEFAULT,
+ REQUEST_INTERCEPTS_ENABLED + ":Boolean=" + REQUEST_INTERCEPTS_ENABLED_DEFAULT,
+ MULTIHOMING_ENABLED + ":Boolean=" + MULTIHOMING_ENABLED_DEFAULT,
})
public class HostLocationProvider extends AbstractProvider implements HostProvider {
private final Logger log = getLogger(getClass());
@@ -155,34 +156,25 @@
private ApplicationId appId;
- //@Property(name = "hostRemovalEnabled", boolValue = true,
- // label = "Enable host removal on port/device down events")
+ /** Enable host removal on port/device down events. */
private boolean hostRemovalEnabled = true;
- //@Property(name = "requestArp", boolValue = true,
- // label = "Request ARP packets for neighbor discovery by the " +
- // "Host Location Provider; default is true")
+ /** Request ARP packets for neighbor discovery by the Host Location Provider; default is true. */
private boolean requestArp = true;
- //@Property(name = "requestIpv6ND", boolValue = false,
- // label = "Requests IPv6 Neighbor Discovery by the " +
- // "Host Location Provider; default is false")
+ /** Requests IPv6 Neighbor Discovery by the Host Location Provider; default is false. */
private boolean requestIpv6ND = false;
- //@Property(name = "useDhcp", boolValue = false,
- // label = "Use DHCP to update IP address of the host; default is false")
+ /** Use DHCP to update IP address of the host; default is false. */
private boolean useDhcp = false;
- //@Property(name = "useDhcp6", boolValue = false,
- // label = "Use DHCPv6 to update IP address of the host; default is false")
+ /** Use DHCPv6 to update IP address of the host; default is false. */
private boolean useDhcp6 = false;
- //@Property(name = "requestInterceptsEnabled", boolValue = true,
- // label = "Enable requesting packet intercepts")
+ /** Enable requesting packet intercepts. */
private boolean requestInterceptsEnabled = true;
- //@Property(name = "multihomingEnabled", boolValue = false,
- // label = "Allow hosts to be multihomed")
+ /** Allow hosts to be multihomed. */
private boolean multihomingEnabled = false;
private HostProviderService providerService;
@@ -322,7 +314,7 @@
Dictionary<?, ?> properties = context.getProperties();
Boolean flag;
- flag = Tools.isPropertyEnabled(properties, "hostRemovalEnabled");
+ flag = Tools.isPropertyEnabled(properties, HOST_REMOVAL_ENABLED);
if (flag == null) {
log.info("Host removal on port/device down events is not configured, " +
"using current value of {}", hostRemovalEnabled);
@@ -332,7 +324,7 @@
hostRemovalEnabled ? "enabled" : "disabled");
}
- flag = Tools.isPropertyEnabled(properties, "requestArp");
+ flag = Tools.isPropertyEnabled(properties, REQUEST_ARP);
if (flag == null) {
log.info("Using ARP is not configured, " +
"using current value of {}", requestArp);
@@ -342,7 +334,7 @@
requestArp ? "enabled" : "disabled");
}
- flag = Tools.isPropertyEnabled(properties, "requestIpv6ND");
+ flag = Tools.isPropertyEnabled(properties, REQUEST_NDP);
if (flag == null) {
log.info("Using IPv6 Neighbor Discovery is not configured, " +
"using current value of {}", requestIpv6ND);
@@ -352,7 +344,7 @@
requestIpv6ND ? "enabled" : "disabled");
}
- flag = Tools.isPropertyEnabled(properties, "useDhcp");
+ flag = Tools.isPropertyEnabled(properties, USE_DHCP);
if (flag == null) {
log.info("Using DHCP is not configured, " +
"using current value of {}", useDhcp);
@@ -362,7 +354,17 @@
useDhcp ? "enabled" : "disabled");
}
- flag = Tools.isPropertyEnabled(properties, "requestInterceptsEnabled");
+ flag = Tools.isPropertyEnabled(properties, USE_DHCP6);
+ if (flag == null) {
+ log.info("Using DHCP6 is not configured, " +
+ "using current value of {}", useDhcp6);
+ } else {
+ useDhcp6 = flag;
+ log.info("Configured. Using DHCP6 is {}",
+ useDhcp6 ? "enabled" : "disabled");
+ }
+
+ flag = Tools.isPropertyEnabled(properties, REQUEST_INTERCEPTS_ENABLED);
if (flag == null) {
log.info("Request intercepts is not configured, " +
"using current value of {}", requestInterceptsEnabled);
@@ -372,7 +374,7 @@
requestInterceptsEnabled ? "enabled" : "disabled");
}
- flag = Tools.isPropertyEnabled(properties, "multihomingEnabled");
+ flag = Tools.isPropertyEnabled(properties, MULTIHOMING_ENABLED);
if (flag == null) {
log.info("Multihoming is not configured, " +
"using current value of {}", multihomingEnabled);
diff --git a/providers/host/src/main/java/org/onosproject/provider/host/impl/OsgiPropertyConstants.java b/providers/host/src/main/java/org/onosproject/provider/host/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..eb8dafe
--- /dev/null
+++ b/providers/host/src/main/java/org/onosproject/provider/host/impl/OsgiPropertyConstants.java
@@ -0,0 +1,48 @@
+/*
+ * 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.host.impl;
+
+/**
+ * Name/Value constants for properties.
+ */
+
+public final class OsgiPropertyConstants {
+
+ private OsgiPropertyConstants() {
+ }
+
+ public static final String HOST_REMOVAL_ENABLED = "hostRemovalEnabled:Boolean=true";
+ public static final boolean HOST_REMOVAL_ENABLED_DEFAULT = true;
+
+ public static final String REQUEST_ARP = "requestArp";
+ public static final boolean REQUEST_ARP_DEFAULT = true;
+
+ public static final String REQUEST_NDP = "requestIpv6ND";
+ public static final boolean REQUEST_NDP_DEFAULT = false;
+
+ public static final String USE_DHCP = "useDhcp";
+ public static final boolean USE_DHCP_DEFAULT = false;
+
+ public static final String USE_DHCP6 = "useDhcp6";
+ public static final boolean USE_DHCP6_DEFAULT = false;
+
+ public static final String REQUEST_INTERCEPTS_ENABLED = "requestInterceptsEnabled";
+ public static final boolean REQUEST_INTERCEPTS_ENABLED_DEFAULT = true;
+
+ public static final String MULTIHOMING_ENABLED = "multihomingEnabled";
+ public static final boolean MULTIHOMING_ENABLED_DEFAULT = false;
+}