use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class LinkPropsTopovMessageHandler method sendBandwidth.
private void sendBandwidth() {
if (elementOfNote != null && elementOfNote instanceof Device) {
DeviceId devId = (DeviceId) elementOfNote.id();
Set<Link> links = linkService.getDeviceEgressLinks(devId);
Highlights highlights = getBandwidth(links, devId);
sendHighlights(highlights);
}
}
use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class OpenstackNetworkingUiMessageHandler method sendMouseData.
private void sendMouseData() {
Highlights highlights = new Highlights();
if (elementOfNote instanceof Device) {
DeviceId deviceId = (DeviceId) elementOfNote.id();
List<OpenstackLink> edgeLinks = edgeLinks(deviceId);
edgeLinks.forEach(edgeLink -> highlights.add(edgeLink.highlight(OpenstackLink.RequestType.DEVICE_SELECTED)));
hostService.getConnectedHosts(deviceId).forEach(host -> {
HostHighlight hostHighlight = new HostHighlight(host.id().toString());
hostHighlight.setBadge(createBadge(getVni(host)));
highlights.add(hostHighlight);
});
sendHighlights(highlights);
} else if (elementOfNote instanceof Host) {
HostId hostId = HostId.hostId(elementOfNote.id().toString());
if (!hostMadeFromOpenstack(hostId)) {
return;
}
List<OpenstackLink> openstackLinks = linksInSameNetwork(hostId);
openstackLinks.forEach(openstackLink -> highlights.add(openstackLink.highlight(OpenstackLink.RequestType.HOST_SELECTED)));
hostHighlightsInSameNetwork(hostId).forEach(highlights::add);
sendHighlights(highlights);
}
}
use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class PathPainterTopovMessageHandler method hilightAndSendPaths.
private void hilightAndSendPaths() {
PathLinkMap linkMap = new PathLinkMap();
allPathLinks.forEach(linkMap::add);
Set<Link> selectedPathLinks;
// the other containing all paths links.
if (currentMode.equals(Mode.DISJOINT)) {
DisjointPath dp = (DisjointPath) paths.get(pathIndex);
selectedPathLinks = paths.isEmpty() ? ImmutableSet.of() : Sets.newHashSet(dp.primary().links());
selectedPathLinks.addAll(dp.backup().links());
} else {
selectedPathLinks = paths.isEmpty() ? ImmutableSet.of() : ImmutableSet.copyOf(paths.get(pathIndex).links());
}
Highlights highlights = new Highlights();
if (highlightDelay > 0) {
highlights.delay(highlightDelay);
}
for (PathLink plink : linkMap.biLinks()) {
plink.computeHilight(selectedPathLinks, allPathLinks);
highlights.add(plink.highlight(null));
}
if (src != null) {
highlights = addBadge(highlights, srcType, src.toString(), SRC);
}
if (dst != null) {
highlights = addBadge(highlights, dstType, dst.toString(), DST);
}
sendMessage(highlightsMessage(highlights));
}
use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class AlarmTopovMessageHandler method createAndSendHighlights.
private void createAndSendHighlights(boolean toDelay) {
Highlights highlights = new Highlights();
createBadges(highlights);
if (toDelay) {
highlights.delay(DELAY_MS);
}
sendHighlights(highlights);
}
Aggregations