use of org.onosproject.ui.topo.HostHighlight in project onos by opennetworkinglab.
the class PathPainterTopovMessageHandler method addHostBadge.
private Highlights addHostBadge(Highlights h, String elemId, String type) {
HostHighlight hh = new HostHighlight(elemId);
hh.setBadge(createBadge(type));
h.add(hh);
return h;
}
use of org.onosproject.ui.topo.HostHighlight in project onos by opennetworkinglab.
the class OpenstackNetworkingUiMessageHandler method hostHighlightsInSameNetwork.
private Set<HostHighlight> hostHighlightsInSameNetwork(HostId hostId) {
Set<HostHighlight> hostHighlights = Sets.newHashSet();
Streams.stream(hostService.getHosts()).filter(host -> isHostInSameNetwork(host, networkId(hostId))).forEach(host -> {
HostHighlight hostHighlight = new HostHighlight(host.id().toString());
hostHighlight.setBadge(createBadge(getVni(host)));
hostHighlights.add(hostHighlight);
});
return hostHighlights;
}
use of org.onosproject.ui.topo.HostHighlight 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.HostHighlight in project onos by opennetworkinglab.
the class ProtectedIntentMonitor method ensureNodePresent.
// TODO duplicate and can be brought in abstract upper class.
private void ensureNodePresent(Highlights highlights, ElementId eid) {
String id = eid.toString();
NodeHighlight nh = highlights.getNode(id);
if (nh == null) {
if (eid instanceof DeviceId) {
nh = new DeviceHighlight(id);
highlights.add((DeviceHighlight) nh);
} else if (eid instanceof HostId) {
nh = new HostHighlight(id);
highlights.add((HostHighlight) nh);
}
}
}
use of org.onosproject.ui.topo.HostHighlight in project onos by opennetworkinglab.
the class TrafficMonitorBase method ensureNodePresent.
protected void ensureNodePresent(Highlights highlights, ElementId eid) {
String id = eid.toString();
NodeHighlight nh = highlights.getNode(id);
if (nh == null) {
if (eid instanceof DeviceId) {
nh = new DeviceHighlight(id);
highlights.add((DeviceHighlight) nh);
} else if (eid instanceof HostId) {
nh = new HostHighlight(id);
highlights.add((HostHighlight) nh);
}
}
}
Aggregations