Search in sources :

Example 16 with Highlights

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);
    }
}
Also used : Highlights(org.onosproject.ui.topo.Highlights) Device(org.onosproject.net.Device) DeviceId(org.onosproject.net.DeviceId) Link(org.onosproject.net.Link)

Example 17 with 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);
    }
}
Also used : DefaultEdgeLink.createEdgeLink(org.onosproject.net.DefaultEdgeLink.createEdgeLink) InstancePort(org.onosproject.openstacknetworking.api.InstancePort) DeviceService(org.onosproject.net.device.DeviceService) LoggerFactory(org.slf4j.LoggerFactory) Tools.groupedThreads(org.onlab.util.Tools.groupedThreads) Highlights(org.onosproject.ui.topo.Highlights) ServiceDirectory(org.onlab.osgi.ServiceDirectory) ByteArrayInputStream(java.io.ByteArrayInputStream) VLAN(org.onosproject.openstacknetworking.api.OpenstackNetwork.Type.VLAN) Type(org.onosproject.openstacknetworking.api.OpenstackNetwork.Type) NodeBadge(org.onosproject.ui.topo.NodeBadge) GRE(org.onosproject.openstacknetworking.api.OpenstackNetwork.Type.GRE) OpenstackNodeService(org.onosproject.openstacknode.api.OpenstackNodeService) ImmutableSet(com.google.common.collect.ImmutableSet) Device(org.onosproject.net.Device) PathService(org.onosproject.net.topology.PathService) Collection(java.util.Collection) Set(java.util.Set) ClientChannelEvent(org.apache.sshd.client.channel.ClientChannelEvent) Executors.newSingleThreadExecutor(java.util.concurrent.Executors.newSingleThreadExecutor) Streams(com.google.common.collect.Streams) Sets(com.google.common.collect.Sets) OpenstackSshAuth(org.onosproject.openstacknode.api.OpenstackSshAuth) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) List(java.util.List) ClientChannel(org.apache.sshd.client.channel.ClientChannel) Optional(java.util.Optional) Path(org.onosproject.net.Path) DeviceId(org.onosproject.net.DeviceId) Status(org.onosproject.ui.topo.NodeBadge.Status) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Host(org.onosproject.net.Host) OpenstackNode(org.onosproject.openstacknode.api.OpenstackNode) HostService(org.onosproject.net.host.HostService) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) UiConnection(org.onosproject.ui.UiConnection) TopoJson(org.onosproject.ui.topo.TopoJson) OpenFuture(org.apache.sshd.client.future.OpenFuture) Strings(com.google.common.base.Strings) OpenstackNetworkService(org.onosproject.openstacknetworking.api.OpenstackNetworkService) Lists(com.google.common.collect.Lists) HostHighlight(org.onosproject.ui.topo.HostHighlight) HostId(org.onosproject.net.HostId) ExecutorService(java.util.concurrent.ExecutorService) IpAddress(org.onlab.packet.IpAddress) RequestHandler(org.onosproject.ui.RequestHandler) OutputStream(java.io.OutputStream) Charsets(com.google.common.base.Charsets) ClientSession(org.apache.sshd.client.session.ClientSession) DEFAULT_GATEWAY_MAC_STR(org.onosproject.openstacknetworking.api.Constants.DEFAULT_GATEWAY_MAC_STR) Logger(org.slf4j.Logger) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) GENEVE(org.onosproject.openstacknetworking.api.OpenstackNetwork.Type.GENEVE) Element(org.onosproject.net.Element) TimeUnit(java.util.concurrent.TimeUnit) SshClient(org.apache.sshd.client.SshClient) NoCloseInputStream(org.apache.sshd.common.util.io.NoCloseInputStream) JsonUtils(org.onosproject.ui.JsonUtils) UiMessageHandler(org.onosproject.ui.UiMessageHandler) VXLAN(org.onosproject.openstacknetworking.api.OpenstackNetwork.Type.VXLAN) InstancePortService(org.onosproject.openstacknetworking.api.InstancePortService) InputStream(java.io.InputStream) Highlights(org.onosproject.ui.topo.Highlights) Device(org.onosproject.net.Device) DeviceId(org.onosproject.net.DeviceId) HostHighlight(org.onosproject.ui.topo.HostHighlight) Host(org.onosproject.net.Host) List(java.util.List) HostId(org.onosproject.net.HostId)

Example 18 with 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));
}
Also used : Highlights(org.onosproject.ui.topo.Highlights) Link(org.onosproject.net.Link) DisjointPath(org.onosproject.net.DisjointPath)

Example 19 with 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);
}
Also used : Highlights(org.onosproject.ui.topo.Highlights)

Aggregations

Highlights (org.onosproject.ui.topo.Highlights)19 Link (org.onosproject.net.Link)7 Device (org.onosproject.net.Device)6 DeviceId (org.onosproject.net.DeviceId)5 FlowRuleIntent (org.onosproject.net.intent.FlowRuleIntent)4 Intent (org.onosproject.net.intent.Intent)4 OpticalConnectivityIntent (org.onosproject.net.intent.OpticalConnectivityIntent)4 HashSet (java.util.HashSet)3 List (java.util.List)3 FlowObjectiveIntent (org.onosproject.net.intent.FlowObjectiveIntent)3 HostToHostIntent (org.onosproject.net.intent.HostToHostIntent)3 LinkCollectionIntent (org.onosproject.net.intent.LinkCollectionIntent)3 OpticalPathIntent (org.onosproject.net.intent.OpticalPathIntent)3 PathIntent (org.onosproject.net.intent.PathIntent)3 TrafficLink (org.onosproject.ui.impl.topo.util.TrafficLink)3 ImmutableList (com.google.common.collect.ImmutableList)2 Lists (com.google.common.collect.Lists)2 Collection (java.util.Collection)2 Set (java.util.Set)2 TrafficLinkMap (org.onosproject.ui.impl.topo.util.TrafficLinkMap)2