Thomas Vachuska
Committed by Gerrit Code Review

Fixing port stats topo view rendering.

Change-Id: I6209268fc6dbdbf8914739305c35c5352a57a842
......@@ -78,4 +78,19 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink {
location, isIngress);
}
/**
* Creates a an edge link, to the specified end-station.
*
* @param host host
* @param isIngress true to indicate host-to-network direction; false
* for network-to-host direction
* @return new phantom edge link
*/
public static DefaultEdgeLink createEdgeLink(Host host, boolean isIngress) {
checkNotNull(host, "Host cannot be null");
return new DefaultEdgeLink(ProviderId.NONE,
new ConnectPoint(host.id(), PortNumber.P0),
host.location(), isIngress);
}
}
......
......@@ -601,7 +601,8 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler {
private void addEdgeLinks(Map<LinkKey, BiLink> biLinks) {
hostService.getHosts().forEach(host -> {
addLink(biLinks, createEdgeLink(host.location(), false));
addLink(biLinks, createEdgeLink(host, true));
addLink(biLinks, createEdgeLink(host, false));
});
}
......@@ -722,7 +723,7 @@ public abstract class TopologyViewMessageHandlerBase extends UiMessageHandler {
for (Link link : links) {
BiLink biLink = addLink(biLinks, link);
if (showTraffic) {
biLink.addLoad(flowStatsService.load(link));
biLink.addLoad(getLinkLoad(link));
}
biLink.addClass(type);
}
......