use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class LinkPropsTopovMessageHandler method sendByteData.
private void sendByteData() {
if (elementOfNote != null && elementOfNote instanceof Device) {
DeviceId devId = (DeviceId) elementOfNote.id();
Set<Link> links = linkService.getDeviceEgressLinks(devId);
Highlights highlights = getTotalBytes(links, devId);
sendHighlights(highlights);
}
}
use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class TrafficMonitor method sendClearHighlights.
@Override
protected void sendClearHighlights() {
log.debug("sendClearHighlights");
msgHandler.sendHighlights(new Highlights());
}
use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class TrafficMonitorBase method createTrafficLinks.
protected void createTrafficLinks(Highlights highlights, TrafficLinkMap linkMap, Set<Intent> intents, LinkHighlight.Flavor flavor, boolean showTraffic) {
for (Intent intent : intents) {
List<Intent> installables = services.intent().getInstallableIntents(intent.key());
Iterable<Link> links = null;
if (installables != null) {
for (Intent installable : installables) {
if (installable instanceof PathIntent) {
links = ((PathIntent) installable).path().links();
} else if (installable instanceof FlowRuleIntent) {
Collection<Link> l = new ArrayList<>();
l.addAll(linkResources(installable));
// Add cross connect links
if (intent instanceof OpticalConnectivityIntent) {
OpticalConnectivityIntent ocIntent = (OpticalConnectivityIntent) intent;
LinkService linkService = services.link();
DeviceService deviceService = services.device();
l.addAll(linkService.getDeviceIngressLinks(ocIntent.getSrc().deviceId()).stream().filter(i -> deviceService.getDevice(i.src().deviceId()).type() == Device.Type.SWITCH).collect(Collectors.toList()));
l.addAll(linkService.getDeviceEgressLinks(ocIntent.getDst().deviceId()).stream().filter(e -> deviceService.getDevice(e.dst().deviceId()).type() == Device.Type.SWITCH).collect(Collectors.toList()));
}
links = l;
} else if (installable instanceof FlowObjectiveIntent) {
links = linkResources(installable);
} else if (installable instanceof LinkCollectionIntent) {
links = ((LinkCollectionIntent) installable).links();
} else if (installable instanceof OpticalPathIntent) {
links = ((OpticalPathIntent) installable).path().links();
}
if (links == null) {
links = Lists.newArrayList();
}
links = addEdgeLinksIfNeeded(intent, Lists.newArrayList(links));
boolean isOptical = intent instanceof OpticalConnectivityIntent;
processLinks(linkMap, links, flavor, isOptical, showTraffic);
updateHighlights(highlights, links);
}
}
}
}
use of org.onosproject.ui.topo.Highlights in project onos by opennetworkinglab.
the class Traffic2Monitor method sendClearHighlights.
@Override
protected void sendClearHighlights() {
log.debug("TOPO-2-TRAFFIC: sendClearHighlights");
msgHandler.sendHighlights(new 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