Committed by
Gerrit Code Review
Minor modification to OpticalPortConfig
- Consolidate JSON object key constants on Config class Change-Id: I7f3b74dd171d1589e259f4b6d3371509359c757d
Showing
2 changed files
with
21 additions
and
1 deletions
| ... | @@ -28,9 +28,29 @@ import static org.onosproject.net.config.Config.FieldPresence.OPTIONAL; | ... | @@ -28,9 +28,29 @@ import static org.onosproject.net.config.Config.FieldPresence.OPTIONAL; |
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * Configurations for an optical port on a device. | 30 | * Configurations for an optical port on a device. |
| 31 | + * | ||
| 32 | + * <p> | ||
| 33 | + * Example: | ||
| 34 | + * <pre> | ||
| 35 | + * "ports": { | ||
| 36 | + * "(device Id)/(port number)": { | ||
| 37 | + * {@value #CONFIG_KEY}: { | ||
| 38 | + * {@value #TYPE}: "OCH", | ||
| 39 | + * {@value #SPEED}: 0, | ||
| 40 | + * {@value #PORT}: 10 | ||
| 41 | + * ... | ||
| 42 | + * } | ||
| 43 | + * } | ||
| 44 | + * } | ||
| 45 | + * </pre> | ||
| 31 | */ | 46 | */ |
| 32 | public final class OpticalPortConfig extends Config<ConnectPoint> { | 47 | public final class OpticalPortConfig extends Config<ConnectPoint> { |
| 33 | 48 | ||
| 49 | + /** | ||
| 50 | + * Configuration key for {@link OpticalPortConfig}. | ||
| 51 | + */ | ||
| 52 | + public static final String CONFIG_KEY = "optical"; | ||
| 53 | + | ||
| 34 | // optical type {OMS, OCH, ODUClt, fiber} | 54 | // optical type {OMS, OCH, ODUClt, fiber} |
| 35 | public static final String TYPE = "type"; | 55 | public static final String TYPE = "type"; |
| 36 | 56 | ... | ... |
| ... | @@ -51,7 +51,7 @@ public class OpticalModelLoader { | ... | @@ -51,7 +51,7 @@ public class OpticalModelLoader { |
| 51 | private ConfigFactory<ConnectPoint, OpticalPortConfig> | 51 | private ConfigFactory<ConnectPoint, OpticalPortConfig> |
| 52 | opticalPortConfigFactory = new ConfigFactory<ConnectPoint, OpticalPortConfig>(CONNECT_POINT_SUBJECT_FACTORY, | 52 | opticalPortConfigFactory = new ConfigFactory<ConnectPoint, OpticalPortConfig>(CONNECT_POINT_SUBJECT_FACTORY, |
| 53 | OpticalPortConfig.class, | 53 | OpticalPortConfig.class, |
| 54 | - "optical") { | 54 | + OpticalPortConfig.CONFIG_KEY) { |
| 55 | @Override | 55 | @Override |
| 56 | public OpticalPortConfig createConfig() { | 56 | public OpticalPortConfig createConfig() { |
| 57 | return new OpticalPortConfig(); | 57 | return new OpticalPortConfig(); | ... | ... |
-
Please register or login to post a comment