Removing commented out @Property annotations from the drivers, protocols, pipelines and providers.
Change-Id: I4cabc5a53c93b778824c72cebbce0ec49700eade
diff --git a/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OsgiPropertyConstants.java b/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..44630c9
--- /dev/null
+++ b/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OsgiPropertyConstants.java
@@ -0,0 +1,44 @@
+/*
+ * 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.ovsdb.controller.impl;
+
+/**
+ * Constants for default values of configurable properties.
+ */
+public final class OsgiPropertyConstants {
+
+ private OsgiPropertyConstants() {}
+
+ public static final String SERVER_MODE = "";
+ public static final boolean SERVER_MODE_DEFAULT = false;
+
+ public static final String OVSDB_TLS_FLAG = "enableOvsdbTls";
+ public static final boolean OVSDB_TLS_FLAG_DEFAULT = false;
+
+ public static final String KS_FILE = "keyStoreLocation";
+ public static final String KS_FILE_DEFAULT = "../config/onos.jks";
+
+ public static final String TS_FILE = "trustStoreLocation";
+ public static final String TS_FILE_DEFAULT = "../config/onos.jks";
+
+ public static final String KS_PASSWORD = "keyStorePassword";
+ public static final String KS_PASSWORD_DEFAULT = "222222";
+
+ public static final String TS_PASSWORD = "trustStorePassword";
+ public static final String TS_PASSWORD_DEFAULT = "222222";
+
+}
diff --git a/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OvsdbControllerImpl.java b/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OvsdbControllerImpl.java
index dde2416..428a411 100644
--- a/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OvsdbControllerImpl.java
+++ b/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/OvsdbControllerImpl.java
@@ -81,16 +81,21 @@
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onlab.util.Tools.get;
-import static org.onosproject.ovsdb.controller.OvsdbConstant.DEFAULT_KS_FILE;
-import static org.onosproject.ovsdb.controller.OvsdbConstant.DEFAULT_KS_PASSWORD;
-import static org.onosproject.ovsdb.controller.OvsdbConstant.OVSDB_TLS_FLAG;
-import static org.onosproject.ovsdb.controller.OvsdbConstant.SERVER_MODE;
import static org.onosproject.ovsdb.controller.impl.Controller.MIN_KS_LENGTH;
+import static org.onosproject.ovsdb.controller.impl.OsgiPropertyConstants.*;
/**
* The implementation of OvsdbController.
*/
-@Component(immediate = true, service = OvsdbController.class)
+@Component(immediate = true, service = OvsdbController.class,
+ property = {
+ "serverMode" + ":Boolean=" + SERVER_MODE_DEFAULT,
+ "enableOvsdbTls" + ":Boolean=" + OVSDB_TLS_FLAG_DEFAULT,
+ "keyStoreLocation" + "=" + KS_FILE_DEFAULT,
+ "keyStorePassword" + "=" + KS_PASSWORD_DEFAULT,
+ "trustStoreLocation" + "=" + TS_FILE_DEFAULT,
+ "trustStorePassword" + "=" + TS_PASSWORD_DEFAULT,
+ })
public class OvsdbControllerImpl implements OvsdbController {
public static final Logger log = LoggerFactory
@@ -110,29 +115,23 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY)
protected ComponentConfigService configService;
- //@Property(name = "serverMode", boolValue = SERVER_MODE,
- // label = "Run as server mode, listen on 6640 port")
- private boolean serverMode = SERVER_MODE;
+ /** Run as server mode, listen on 6640 port. */
+ private boolean serverMode = SERVER_MODE_DEFAULT;
- //@Property(name = "enableOvsdbTls", boolValue = OVSDB_TLS_FLAG,
- // label = "TLS mode for OVSDB channel; options are: true false")
- private boolean enableOvsdbTls = OVSDB_TLS_FLAG;
+ /** TLS mode for OVSDB channel; options are: true false. */
+ private boolean enableOvsdbTls = OVSDB_TLS_FLAG_DEFAULT;
- //@Property(name = "keyStoreLocation", value = DEFAULT_KS_FILE,
- // label = "File path to KeyStore for Ovsdb TLS Connections")
- protected String keyStoreLocation = DEFAULT_KS_FILE;
+ /** File path to KeyStore for Ovsdb TLS Connections. */
+ protected String keyStoreLocation = KS_FILE_DEFAULT;
- //@Property(name = "trustStoreLocation", value = DEFAULT_KS_FILE,
- // label = "File path to TrustStore for Ovsdb TLS Connections")
- protected String trustStoreLocation = DEFAULT_KS_FILE;
+ /** File path to TrustStore for Ovsdb TLS Connections. */
+ protected String trustStoreLocation = TS_FILE_DEFAULT;
- //@Property(name = "keyStorePassword", value = DEFAULT_KS_PASSWORD,
- // label = "KeyStore Password")
- protected String keyStorePassword = DEFAULT_KS_PASSWORD;
+ /** KeyStore Password. */
+ protected String keyStorePassword = KS_PASSWORD_DEFAULT;
- //@Property(name = "trustStorePassword", value = DEFAULT_KS_PASSWORD,
- // label = "TrustStore Password")
- protected String trustStorePassword = DEFAULT_KS_PASSWORD;
+ /** TrustStore Password. */
+ protected String trustStorePassword = TS_PASSWORD_DEFAULT;
@Activate
public void activate(ComponentContext context) {
@@ -180,7 +179,7 @@
private TlsParams getTlsParams(Dictionary<?, ?> properties) {
TlsMode mode = null;
- boolean flag = Tools.isPropertyEnabled(properties, "enableOvsdbTls");
+ boolean flag = Tools.isPropertyEnabled(properties, OVSDB_TLS_FLAG);
if (Objects.isNull(flag) || !flag) {
log.warn("OvsdbTLS Disabled");
mode = TlsMode.DISABLED;
@@ -191,25 +190,25 @@
String ksLocation = null, tsLocation = null, ksPwd = null, tsPwd = null;
- ksLocation = get(properties, "keyStoreLocation");
+ ksLocation = get(properties, KS_FILE);
if (Strings.isNullOrEmpty(ksLocation)) {
log.warn("trustStoreLocation is not configured");
mode = TlsMode.DISABLED;
}
- tsLocation = get(properties, "trustStoreLocation");
+ tsLocation = get(properties, TS_FILE);
if (Strings.isNullOrEmpty(tsLocation)) {
log.warn("trustStoreLocation is not configured");
mode = TlsMode.DISABLED;
}
- ksPwd = get(properties, "keyStorePassword");
+ ksPwd = get(properties, KS_PASSWORD);
if (Strings.isNullOrEmpty(ksPwd) || MIN_KS_LENGTH > ksPwd.length()) {
log.warn("keyStorePassword is not configured or Password length too small");
mode = TlsMode.DISABLED;
}
- tsPwd = get(properties, "trustStorePassword");
+ tsPwd = get(properties, TS_PASSWORD);
if (Strings.isNullOrEmpty(tsPwd) || MIN_KS_LENGTH > tsPwd.length()) {
log.warn("trustStorePassword is not configured or Password length too small");
mode = TlsMode.DISABLED;
diff --git a/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/TlsParams.java b/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/TlsParams.java
index dfe7fa9..f71f8fa 100644
--- a/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/TlsParams.java
+++ b/protocols/ovsdb/ctl/src/main/java/org/onosproject/ovsdb/controller/impl/TlsParams.java
@@ -29,8 +29,7 @@
import java.util.EnumSet;
import java.util.Objects;
-import static org.onosproject.ovsdb.controller.OvsdbConstant.DEFAULT_KS_FILE;
-import static org.onosproject.ovsdb.controller.OvsdbConstant.DEFAULT_KS_PASSWORD;
+import static org.onosproject.ovsdb.controller.impl.OsgiPropertyConstants.*;
/**
* TlsParams Class for properties required for configuring OVSDB TLS Connection.
@@ -69,10 +68,10 @@
*/
TlsParams() {
this.mode = TlsMode.DISABLED;
- this.ksLocation = DEFAULT_KS_FILE;
- this.tsLocation = DEFAULT_KS_FILE;
- this.ksPwd = DEFAULT_KS_PASSWORD;
- this.tsPwd = DEFAULT_KS_PASSWORD;
+ this.ksLocation = KS_FILE_DEFAULT;
+ this.tsLocation = TS_FILE_DEFAULT;
+ this.ksPwd = KS_PASSWORD_DEFAULT;
+ this.tsPwd = TS_PASSWORD_DEFAULT;
this.ksSignature = getSha1Checksum(ksLocation);
this.tsSignature = getSha1Checksum(tsLocation);
}