Andrea Campanella
Committed by Gerrit Code Review

Changing Ciena Lineside ports names

Change-Id: I9fb762acc7a54b6ad2e53736a7e807987514a244
...@@ -52,8 +52,6 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour ...@@ -52,8 +52,6 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour
52 private static final String EMPTY_STRING = ""; 52 private static final String EMPTY_STRING = "";
53 private static final String NAME = "name"; 53 private static final String NAME = "name";
54 private static final String ADMIN_STATE = "admin-state"; 54 private static final String ADMIN_STATE = "admin-state";
55 - private static final String LINESIDE_NAME = "lineside";
56 - private static final String CLIENTSIDE_NAME = "clientside";
57 55
58 private static final ArrayList<String> LINESIDE_PORT_ID = Lists.newArrayList( 56 private static final ArrayList<String> LINESIDE_PORT_ID = Lists.newArrayList(
59 "4", "48"); 57 "4", "48");
...@@ -86,10 +84,10 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour ...@@ -86,10 +84,10 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour
86 portsConfig.stream().forEach(sub -> { 84 portsConfig.stream().forEach(sub -> {
87 String portId = sub.getString(PORT_ID); 85 String portId = sub.getString(PORT_ID);
88 String name = sub.getString(NAME); 86 String name = sub.getString(NAME);
89 - DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
90 - .set(AnnotationKeys.NAME, name);
91 if (LINESIDE_PORT_ID.contains(portId)) { 87 if (LINESIDE_PORT_ID.contains(portId)) {
92 - annotations.set(AnnotationKeys.PORT_NAME, LINESIDE_NAME); 88 + String txName = name + " Tx";
89 + DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
90 + .set(AnnotationKeys.PORT_NAME, txName);
93 String wsportInfoRequest = SPECIFIC_PORT_PATH + portId + 91 String wsportInfoRequest = SPECIFIC_PORT_PATH + portId +
94 SPECIFIC_PORT_CONFIG; 92 SPECIFIC_PORT_CONFIG;
95 ports.add(XmlConfigParser.parseWaveServerCienaOchPorts( 93 ports.add(XmlConfigParser.parseWaveServerCienaOchPorts(
...@@ -99,15 +97,17 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour ...@@ -99,15 +97,17 @@ public class PortDiscoveryCienaWaveserverImpl extends AbstractHandlerBehaviour
99 XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)), 97 XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)),
100 annotations.build())); 98 annotations.build()));
101 //adding corresponding opposite side port 99 //adding corresponding opposite side port
100 + String rxName = name.replace(".1", ".2") + " Rx";
102 ports.add(XmlConfigParser.parseWaveServerCienaOchPorts( 101 ports.add(XmlConfigParser.parseWaveServerCienaOchPorts(
103 sub.getLong(PORT_ID) + 1, 102 sub.getLong(PORT_ID) + 1,
104 toGbps(Long.parseLong(sub.getString(SPEED).replace(GBPS, EMPTY_STRING) 103 toGbps(Long.parseLong(sub.getString(SPEED).replace(GBPS, EMPTY_STRING)
105 .replace(" ", EMPTY_STRING))), 104 .replace(" ", EMPTY_STRING))),
106 XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)), 105 XmlConfigParser.loadXml(controller.get(deviceId, wsportInfoRequest, XML)),
107 - annotations.set(AnnotationKeys.NAME, name.replace(".1", ".2")) 106 + annotations.set(AnnotationKeys.PORT_NAME, rxName)
108 .build())); 107 .build()));
109 } else if (!portId.equals("5") && !portId.equals("49")) { 108 } else if (!portId.equals("5") && !portId.equals("49")) {
110 - annotations.set(AnnotationKeys.PORT_NAME, CLIENTSIDE_NAME); 109 + DefaultAnnotations.Builder annotations = DefaultAnnotations.builder()
110 + .set(AnnotationKeys.PORT_NAME, name);
111 //FIXME change when all optical types have two way information methods, see jira tickets 111 //FIXME change when all optical types have two way information methods, see jira tickets
112 final int speed100GbpsinMbps = 100000; 112 final int speed100GbpsinMbps = 100000;
113 CltSignalType cltType = toGbps(Long.parseLong( 113 CltSignalType cltType = toGbps(Long.parseLong(
......