Thomas Vachuska

GUI -- Fixed a defect where showTraffic was sending redundant link classes.

Change-Id: I7fd1385cc6e200f1b61930e218cc82041084e0a7
......@@ -656,7 +656,7 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler {
Map<String, ObjectNode> pathNodes = new HashMap<>();
for (BiLink biLink : biLinks.values()) {
boolean hasTraffic = biLink.hasTraffic;
String tc = (biLink.classes + (hasTraffic ? " animated" : "")).trim();
String tc = (biLink.classes() + (hasTraffic ? " animated" : "")).trim();
ObjectNode pathNode = pathNodes.get(tc);
if (pathNode == null) {
pathNode = mapper.createObjectNode()
......@@ -830,7 +830,8 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler {
public Link two;
public boolean hasTraffic = false;
public long bytes = 0;
public String classes = "";
private Set<String> classes = new HashSet<>();
BiLink(LinkKey key, Link link) {
this.key = key;
......@@ -849,7 +850,13 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler {
}
void addClass(String trafficClass) {
classes = classes + " " + trafficClass;
classes.add(trafficClass);
}
String classes() {
StringBuilder sb = new StringBuilder();
classes.forEach(c -> sb.append(c).append(" "));
return sb.toString().trim();
}
}
......