Minor modification to OpticalPortConfig
- Consolidate JSON object key constants on Config class
Change-Id: I7f3b74dd171d1589e259f4b6d3371509359c757d
diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/config/OpticalPortConfig.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/config/OpticalPortConfig.java
index 0278fba..46e182f 100644
--- a/apps/optical-model/src/main/java/org/onosproject/net/optical/config/OpticalPortConfig.java
+++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/config/OpticalPortConfig.java
@@ -28,9 +28,29 @@
/**
* Configurations for an optical port on a device.
+ *
+ * <p>
+ * Example:
+ * <pre>
+ * "ports": {
+ * "(device Id)/(port number)": {
+ * {@value #CONFIG_KEY}: {
+ * {@value #TYPE}: "OCH",
+ * {@value #SPEED}: 0,
+ * {@value #PORT}: 10
+ * ...
+ * }
+ * }
+ * }
+ * </pre>
*/
public final class OpticalPortConfig extends Config<ConnectPoint> {
+ /**
+ * Configuration key for {@link OpticalPortConfig}.
+ */
+ public static final String CONFIG_KEY = "optical";
+
// optical type {OMS, OCH, ODUClt, fiber}
public static final String TYPE = "type";
diff --git a/apps/optical-model/src/main/java/org/onosproject/net/optical/internal/OpticalModelLoader.java b/apps/optical-model/src/main/java/org/onosproject/net/optical/internal/OpticalModelLoader.java
index 494fc24..0d69d2b 100644
--- a/apps/optical-model/src/main/java/org/onosproject/net/optical/internal/OpticalModelLoader.java
+++ b/apps/optical-model/src/main/java/org/onosproject/net/optical/internal/OpticalModelLoader.java
@@ -51,7 +51,7 @@
private ConfigFactory<ConnectPoint, OpticalPortConfig>
opticalPortConfigFactory = new ConfigFactory<ConnectPoint, OpticalPortConfig>(CONNECT_POINT_SUBJECT_FACTORY,
OpticalPortConfig.class,
- "optical") {
+ OpticalPortConfig.CONFIG_KEY) {
@Override
public OpticalPortConfig createConfig() {
return new OpticalPortConfig();