Removing commented out @Property annotations from the drivers, protocols, pipelines and providers.
Change-Id: I4cabc5a53c93b778824c72cebbce0ec49700eade
diff --git a/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/ctl/GrpcControllerImpl.java b/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/ctl/GrpcControllerImpl.java
index 232885c..7d038ce 100644
--- a/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/ctl/GrpcControllerImpl.java
+++ b/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/ctl/GrpcControllerImpl.java
@@ -60,11 +60,16 @@
import java.util.concurrent.locks.Lock;
import static com.google.common.base.Preconditions.checkNotNull;
+import static org.onosproject.grpc.ctl.OsgiPropertyConstants.ENABLE_MESSAGE_LOG;
+import static org.onosproject.grpc.ctl.OsgiPropertyConstants.ENABLE_MESSAGE_LOG_DEFAULT;
/**
* Default implementation of the GrpcController.
*/
-@Component(immediate = true, service = GrpcController.class)
+@Component(immediate = true, service = GrpcController.class,
+ property = {
+ ENABLE_MESSAGE_LOG + ":Boolean=" + ENABLE_MESSAGE_LOG_DEFAULT,
+ })
public class GrpcControllerImpl implements GrpcController {
private static final String SET_FORWARDING_PIPELINE_CONFIG_METHOD = "p4.P4Runtime/SetForwardingPipelineConfig";
@@ -75,8 +80,8 @@
// Hint: set to true to log all gRPC messages received/sent on all channels
// Does not enable log on existing channels
private static final boolean DEFAULT_LOG_LEVEL = false;
- //@Property(name = "enableMessageLog", boolValue = DEFAULT_LOG_LEVEL,
- // label = "Indicates whether to log all gRPC messages sent and received on all channels")
+
+ /** Indicates whether to log all gRPC messages sent and received on all channels. */
public static boolean enableMessageLog = DEFAULT_LOG_LEVEL;
private final Logger log = LoggerFactory.getLogger(getClass());
@@ -95,7 +100,7 @@
public void modified(ComponentContext context) {
if (context != null) {
Dictionary<?, ?> properties = context.getProperties();
- enableMessageLog = Tools.isPropertyEnabled(properties, "enableMessageLog",
+ enableMessageLog = Tools.isPropertyEnabled(properties, ENABLE_MESSAGE_LOG,
DEFAULT_LOG_LEVEL);
log.info("Configured. Log of gRPC messages is {}", enableMessageLog ? "enabled" : "disabled");
}
diff --git a/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/ctl/OsgiPropertyConstants.java b/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/ctl/OsgiPropertyConstants.java
new file mode 100644
index 0000000..576d1da
--- /dev/null
+++ b/protocols/grpc/ctl/src/main/java/org/onosproject/grpc/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.grpc.ctl;
+
+/**
+ * Constants for default values of configurable properties.
+ */
+public final class OsgiPropertyConstants {
+
+ private OsgiPropertyConstants() {}
+
+ public static final String ENABLE_MESSAGE_LOG = "enableMessageLog";
+ public static final boolean ENABLE_MESSAGE_LOG_DEFAULT = false;
+
+}