Introduces Virtual Circuit functionality for SDX-L2
Changes:
- Implements commands: sdxl2vc, sdxl2vc-add, sdxl2vc-list, sdxl2vc-remove
- Custom exceptions handled at the VC manager
- Updated README
- Updated unit tests
- Grouped some documentation and code
- Reduced checkstyle warnings
Change-Id: I4cb211dcfd1f3517f4e594c1cc1c816f9c3cdbe3
diff --git a/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2AddCPCommand.java b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2AddCPCommand.java
index eb000b8..ea13441 100644
--- a/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2AddCPCommand.java
+++ b/sdx-l2/src/main/java/org/onosproject/sdxl2/cli/SdxL2AddCPCommand.java
@@ -27,38 +27,33 @@
/**
* CLI to create a named SDX-L2 connection point.
*/
-@Command(scope = "sdxl2", name = "sdxl2cp-add", description = "Create a named sdx-l2 connection point")
+@Command(scope = "sdxl2", name = "sdxl2cp-add", description = "Creates a named SDX-L2 Connection Point")
public class SdxL2AddCPCommand extends AbstractShellCommand {
- @Argument(index = 0, name = "sdxl2name", description = "Sdxl2name",
+ @Argument(index = 0, name = "sdxl2name", description = "Name of SDX-L2",
required = true, multiValued = false)
- String sdxl2name = null;
+ private String sdxl2name = null;
- @Argument(index = 1, name = "connectionpoint", description = "Connection point",
+ @Argument(index = 1, name = "connectionpoint", description = "Identifier of SDX-L2 Connection point",
required = true, multiValued = false)
- String cp = null;
+ private String cp = null;
- @Argument(index = 2, name = "vlans", description = "Customer edge vlans separated by comma",
+ @Argument(index = 2, name = "sdxl2cpname", description = "Name of SDX-L2 Connection Point",
required = true, multiValued = false)
- String vlans = null;
+ private String sdxl2cpname = null;
- @Argument(index = 3, name = "sdxl2cpname", description = "Sdxl2 connection point name",
- required = true, multiValued = false)
- String sdxl2cpname = null;
+ @Argument(index = 3, name = "vlans", description = "Customer edge VLANs, separated by dash " +
+ "and comma", required = false, multiValued = false)
+ private String vlans = null;
- @Option(name = "-ce_mac", description = "Customer edge mac address",
+ @Option(name = "-ce_mac", description = "Customer edge MAC address",
required = false, multiValued = false)
- String mac = null;
+ private String mac = null;
@Override
protected void execute() {
SdxL2Service sdxl2Service = get(SdxL2Service.class);
- SdxL2ConnectionPoint sdxl2cp;
- if (mac != null) {
- sdxl2cp = SdxL2ConnectionPoint.sdxl2ConnectionPoint(sdxl2cpname, cp, vlans, mac);
- } else {
- sdxl2cp = SdxL2ConnectionPoint.sdxl2ConnectionPoint(sdxl2cpname, cp, vlans);
- }
+ SdxL2ConnectionPoint sdxl2cp = SdxL2ConnectionPoint.sdxl2ConnectionPoint(sdxl2cpname, cp, vlans, mac);
sdxl2Service.addSdxL2ConnectionPoint(sdxl2name, sdxl2cp);
}