Changing Ciena Lineside ports names
Change-Id: I9fb762acc7a54b6ad2e53736a7e807987514a244
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/PortDiscoveryCienaWaveserverImpl.java b/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/PortDiscoveryCienaWaveserverImpl.java
index 856476b..28ea0bd 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/PortDiscoveryCienaWaveserverImpl.java
+++ b/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/PortDiscoveryCienaWaveserverImpl.java
@@ -52,8 +52,6 @@
private static final String EMPTY_STRING = "";
private static final String NAME = "name";
private static final String ADMIN_STATE = "admin-state";
- private static final String LINESIDE_NAME = "lineside";
- private static final String CLIENTSIDE_NAME = "clientside";
private static final ArrayList<String> LINESIDE_PORT_ID = Lists.newArrayList(
"4", "48");
@@ -86,10 +84,10 @@
portsConfig.stream().forEach(sub -> {
String portId = sub.getString(PORT_ID);
String name = sub.getString(NAME);
- DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
- .set(AnnotationKeys.NAME, name);
if (LINESIDE_PORT_ID.contains(portId)) {
- annotations.set(AnnotationKeys.PORT_NAME, LINESIDE_NAME);
+ String txName = name + " Tx";
+ DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
+ .set(AnnotationKeys.PORT_NAME, txName);
String wsportInfoRequest = SPECIFIC_PORT_PATH + portId +
SPECIFIC_PORT_CONFIG;
ports.add(XmlConfigParser.parseWaveServerCienaOchPorts(
@@ -99,15 +97,17 @@
XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)),
annotations.build()));
//adding corresponding opposite side port
+ String rxName = name.replace(".1", ".2") + " Rx";
ports.add(XmlConfigParser.parseWaveServerCienaOchPorts(
sub.getLong(PORT_ID) + 1,
toGbps(Long.parseLong(sub.getString(SPEED).replace(GBPS, EMPTY_STRING)
.replace(" ", EMPTY_STRING))),
XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)),
- annotations.set(AnnotationKeys.NAME, name.replace(".1", ".2"))
+ annotations.set(AnnotationKeys.PORT_NAME, rxName)
.build()));
} else if (!portId.equals("5") && !portId.equals("49")) {
- annotations.set(AnnotationKeys.PORT_NAME, CLIENTSIDE_NAME);
+ DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
+ .set(AnnotationKeys.PORT_NAME, name);
//FIXME change when all optical types have two way information methods, see jira tickets
final int speed100GbpsinMbps = 100000;
CltSignalType cltType = toGbps(Long.parseLong(