Yuta HIGUCHI
Committed by Gerrit Code Review

Minor modification to OpticalPortConfig

- Consolidate JSON object key constants on Config class

Change-Id: I7f3b74dd171d1589e259f4b6d3371509359c757d
......@@ -28,9 +28,29 @@ import static org.onosproject.net.config.Config.FieldPresence.OPTIONAL;
/**
* 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";
......
......@@ -51,7 +51,7 @@ public class OpticalModelLoader {
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();
......