Removing commented out @Property annotations from the drivers, protocols, pipelines and providers.
Change-Id: I4cabc5a53c93b778824c72cebbce0ec49700eade
diff --git a/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/OsgiPropertyConstants.java b/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..24a3b7c
--- /dev/null
+++ b/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/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.xmpp.core.ctl;
+
+/**
+ * Constants for default values of configurable properties.
+ */
+public final class OsgiPropertyConstants {
+
+ private OsgiPropertyConstants() {}
+
+ public static final String XMPP_PORT = "xmppPort";
+ public static final String XMPP_PORT_DEFAULT = "5269";
+
+}
diff --git a/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppControllerImpl.java b/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppControllerImpl.java
index 178018a..da42c1c 100644
--- a/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppControllerImpl.java
+++ b/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppControllerImpl.java
@@ -49,6 +49,9 @@
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArraySet;
+import static org.onosproject.xmpp.core.ctl.OsgiPropertyConstants.XMPP_PORT;
+import static org.onosproject.xmpp.core.ctl.OsgiPropertyConstants.XMPP_PORT_DEFAULT;
+
/**
* The main class (bundle) of XMPP protocol.
@@ -58,11 +61,13 @@
* 3. Configuration parameters initialization.
* 4. Notifing listeners about XMPP events/packets.
*/
-@Component(immediate = true, service = XmppController.class)
+@Component(immediate = true, service = XmppController.class,
+ property = {
+ XMPP_PORT + "=" + XMPP_PORT_DEFAULT,
+ })
public class XmppControllerImpl implements XmppController {
private static final String APP_ID = "org.onosproject.xmpp";
- private static final String XMPP_PORT = "5269";
private static final Logger log =
LoggerFactory.getLogger(XmppControllerImpl.class);
@@ -75,10 +80,8 @@
protected ComponentConfigService cfgService;
// configuration properties definition
- //@Property(name = "xmppPort", value = XMPP_PORT,
- // label = "Port number used by XMPP protocol; default is 5269")
- private String xmppPort = XMPP_PORT;
-
+ /** Port number used by XMPP protocol; default is 5269. */
+ private String xmppPort = XMPP_PORT_DEFAULT;
// listener declaration
protected Set<XmppDeviceListener> xmppDeviceListeners = new CopyOnWriteArraySet<XmppDeviceListener>();
diff --git a/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppServer.java b/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppServer.java
index 2bc96fd..0970d82 100644
--- a/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppServer.java
+++ b/protocols/xmpp/core/ctl/src/main/java/org/onosproject/xmpp/core/ctl/XmppServer.java
@@ -35,6 +35,7 @@
import java.util.Dictionary;
import static org.onlab.util.Tools.get;
+import static org.onosproject.xmpp.core.ctl.OsgiPropertyConstants.XMPP_PORT;
/**
* The XMPP server class. Starts XMPP server and listens to new XMPP device TCP connections.
@@ -124,7 +125,7 @@
* @param properties properties to be set
*/
public void setConfiguration(Dictionary<?, ?> properties) {
- String port = get(properties, "xmppPort");
+ String port = get(properties, XMPP_PORT);
if (!Strings.isNullOrEmpty(port)) {
this.port = Integer.parseInt(port);
}