Search in sources :

Example 11 with OpticalConnectivityIntent

use of org.onosproject.net.intent.OpticalConnectivityIntent in project onos by opennetworkinglab.

the class TopoIntentFilter method getIntents.

// Produces a list of intents that target all selected hosts, devices, links or connect points.
private List<Intent> getIntents(Set<Host> hosts, Set<Device> devices, Set<Link> links, Set<ConnectPoint> edgePoints, Iterable<Intent> sourceIntents) {
    List<Intent> intents = new ArrayList<>();
    if (hosts.isEmpty() && devices.isEmpty() && links.isEmpty()) {
        return intents;
    }
    Set<OpticalConnectivityIntent> opticalIntents = new HashSet<>();
    // Search through all intents and see if they are relevant to our search.
    for (Intent intent : sourceIntents) {
        if (intentService.getIntentState(intent.key()) == INSTALLED) {
            boolean isRelevant = false;
            if (intent instanceof HostToHostIntent) {
                isRelevant = isIntentRelevantToHosts((HostToHostIntent) intent, hosts) && isIntentRelevantToDevices(intent, devices) && isIntentRelevantToLinks(intent, links);
            } else if (intent instanceof PointToPointIntent) {
                isRelevant = isIntentRelevant((PointToPointIntent) intent, edgePoints) && isIntentRelevantToDevices(intent, devices) && isIntentRelevantToLinks(intent, links);
            } else if (intent instanceof MultiPointToSinglePointIntent) {
                isRelevant = isIntentRelevant((MultiPointToSinglePointIntent) intent, edgePoints) && isIntentRelevantToDevices(intent, devices) && isIntentRelevantToLinks(intent, links);
            } else if (intent instanceof OpticalConnectivityIntent) {
                opticalIntents.add((OpticalConnectivityIntent) intent);
            }
            if (isRelevant) {
                intents.add(intent);
            }
        }
    }
    // packet-level ones.
    for (OpticalConnectivityIntent intent : opticalIntents) {
        if (isIntentRelevant(intent, intents) && isIntentRelevantToDevices(intent, devices)) {
            intents.add(intent);
        }
    }
    return intents;
}
Also used : HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) ArrayList(java.util.ArrayList) PointToPointIntent(org.onosproject.net.intent.PointToPointIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) FlowObjectiveIntent(org.onosproject.net.intent.FlowObjectiveIntent) MultiPointToSinglePointIntent(org.onosproject.net.intent.MultiPointToSinglePointIntent) Intent(org.onosproject.net.intent.Intent) PathIntent(org.onosproject.net.intent.PathIntent) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent) HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) PointToPointIntent(org.onosproject.net.intent.PointToPointIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) MultiPointToSinglePointIntent(org.onosproject.net.intent.MultiPointToSinglePointIntent) HashSet(java.util.HashSet)

Example 12 with OpticalConnectivityIntent

use of org.onosproject.net.intent.OpticalConnectivityIntent 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);
            }
        }
    }
}
Also used : Mode(org.onosproject.ui.impl.TrafficMonitorBase.Mode) DefaultEdgeLink.createEdgeLink(org.onosproject.net.DefaultEdgeLink.createEdgeLink) DeviceService(org.onosproject.net.device.DeviceService) LoggerFactory(org.slf4j.LoggerFactory) ElementId(org.onosproject.net.ElementId) Highlights(org.onosproject.ui.topo.Highlights) Timer(java.util.Timer) Link(org.onosproject.net.Link) DefaultEdgeLink(org.onosproject.net.DefaultEdgeLink) PACKETS(org.onosproject.net.statistic.PortStatisticsService.MetricType.PACKETS) ServicesBundle(org.onosproject.ui.impl.topo.util.ServicesBundle) TimerTask(java.util.TimerTask) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent) Device(org.onosproject.net.Device) HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) TrafficLink(org.onosproject.ui.impl.topo.util.TrafficLink) OpticalPathIntent(org.onosproject.net.intent.OpticalPathIntent) LinkHighlight(org.onosproject.ui.topo.LinkHighlight) Collection(java.util.Collection) Set(java.util.Set) BYTES(org.onosproject.net.statistic.PortStatisticsService.MetricType.BYTES) IntentSelection(org.onosproject.ui.impl.topo.util.IntentSelection) Collectors(java.util.stream.Collectors) List(java.util.List) LinkService(org.onosproject.net.link.LinkService) DeviceId(org.onosproject.net.DeviceId) TopoologyTrafficMessageHandlerAbstract(org.onosproject.ui.impl.topo.TopoologyTrafficMessageHandlerAbstract) AbstractTopoMonitor(org.onosproject.ui.topo.AbstractTopoMonitor) DeviceHighlight(org.onosproject.ui.topo.DeviceHighlight) FlowObjectiveIntent(org.onosproject.net.intent.FlowObjectiveIntent) Host(org.onosproject.net.Host) TrafficLinkMap(org.onosproject.ui.impl.topo.util.TrafficLinkMap) UiExtensionService(org.onosproject.ui.UiExtensionService) MetricType(org.onosproject.net.statistic.PortStatisticsService.MetricType) Load(org.onosproject.net.statistic.Load) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Lists(com.google.common.collect.Lists) ImmutableList(com.google.common.collect.ImmutableList) UiTopoHighlighterFactory(org.onosproject.ui.UiTopoHighlighterFactory) HostHighlight(org.onosproject.ui.topo.HostHighlight) NodeHighlight(org.onosproject.ui.topo.NodeHighlight) Intent(org.onosproject.net.intent.Intent) UiTopoHighlighter(org.onosproject.ui.UiTopoHighlighter) HostId(org.onosproject.net.HostId) PathIntent(org.onosproject.net.intent.PathIntent) Logger(org.slf4j.Logger) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) DefaultEdgeLink.createEdgeLinks(org.onosproject.net.DefaultEdgeLink.createEdgeLinks) TopoIntentFilter(org.onosproject.ui.impl.topo.util.TopoIntentFilter) NodeSelection(org.onosproject.ui.topo.NodeSelection) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) Collections(java.util.Collections) TopoUtils(org.onosproject.ui.topo.TopoUtils) OpticalPathIntent(org.onosproject.net.intent.OpticalPathIntent) PathIntent(org.onosproject.net.intent.PathIntent) OpticalPathIntent(org.onosproject.net.intent.OpticalPathIntent) DeviceService(org.onosproject.net.device.DeviceService) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent) HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) OpticalPathIntent(org.onosproject.net.intent.OpticalPathIntent) FlowObjectiveIntent(org.onosproject.net.intent.FlowObjectiveIntent) Intent(org.onosproject.net.intent.Intent) PathIntent(org.onosproject.net.intent.PathIntent) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) FlowObjectiveIntent(org.onosproject.net.intent.FlowObjectiveIntent) Collection(java.util.Collection) LinkService(org.onosproject.net.link.LinkService) DefaultEdgeLink.createEdgeLink(org.onosproject.net.DefaultEdgeLink.createEdgeLink) Link(org.onosproject.net.Link) DefaultEdgeLink(org.onosproject.net.DefaultEdgeLink) TrafficLink(org.onosproject.ui.impl.topo.util.TrafficLink) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent)

Example 13 with OpticalConnectivityIntent

use of org.onosproject.net.intent.OpticalConnectivityIntent in project onos by opennetworkinglab.

the class ProtectedIntentMonitor method protectedIntentMultiLayer.

/**
 * Returns the packet to optical mapping given a head and tail of a protection path.
 *
 * @param head head of path
 * @param tail tail of path
 */
private Set<Link> protectedIntentMultiLayer(ConnectPoint head, ConnectPoint tail) {
    List<Link> links = new LinkedList<>();
    LinkService linkService = services.link();
    IntentService intentService = services.intent();
    // Ingress cross connect link
    links.addAll(linkService.getEgressLinks(head).stream().filter(l -> l.type() == Link.Type.OPTICAL).collect(Collectors.toList()));
    // Egress cross connect link
    links.addAll(linkService.getIngressLinks(tail).stream().filter(l -> l.type() == Link.Type.OPTICAL).collect(Collectors.toList()));
    // The protected intent does not rely on a multi-layer mapping
    if (links.size() != 2) {
        return Collections.emptySet();
    }
    // Expected head and tail of optical circuit (not connectivity!) intent
    ConnectPoint ocHead = links.get(0).dst();
    ConnectPoint ocTail = links.get(1).src();
    // Optical connectivity
    // FIXME: assumes that transponder (OTN device) is a one-to-one mapping
    // We need to track the multi-layer aspects better
    intentService.getIntents().forEach(intent -> {
        if (intent instanceof OpticalConnectivityIntent) {
            OpticalConnectivityIntent ocIntent = (OpticalConnectivityIntent) intent;
            if (ocHead.deviceId().equals(ocIntent.getSrc().deviceId()) && ocTail.deviceId().equals(ocIntent.getDst().deviceId())) {
                intentService.getInstallableIntents(ocIntent.key()).forEach(i -> {
                    if (i instanceof FlowRuleIntent) {
                        FlowRuleIntent fr = (FlowRuleIntent) i;
                        links.addAll(linkResources(fr));
                    }
                });
            }
        }
    });
    return new LinkedHashSet<>(links);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) IntentService(org.onosproject.net.intent.IntentService) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) LinkService(org.onosproject.net.link.LinkService) ConnectPoint(org.onosproject.net.ConnectPoint) Link(org.onosproject.net.Link) TrafficLink(org.onosproject.ui.impl.topo.util.TrafficLink) LinkedList(java.util.LinkedList) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent)

Example 14 with OpticalConnectivityIntent

use of org.onosproject.net.intent.OpticalConnectivityIntent in project onos by opennetworkinglab.

the class IntentsListCommand method detailsFormat.

/**
 * Returns detailed information text about a specific intent.
 *
 * @param intent to print
 * @param state of intent
 * @return detailed information or "" if {@code state} was null
 */
private StringBuilder detailsFormat(Intent intent, IntentState state) {
    StringBuilder builder = new StringBuilder();
    if (state == null) {
        return builder;
    }
    if (!intent.resources().isEmpty()) {
        builder.append('\n').append(format(RESOURCES, intent.resources()));
    }
    if (intent instanceof ConnectivityIntent) {
        ConnectivityIntent ci = (ConnectivityIntent) intent;
        if (!ci.selector().criteria().isEmpty()) {
            builder.append('\n').append(format(COMMON_SELECTOR, formatSelector(ci.selector())));
        }
        if (!ci.treatment().allInstructions().isEmpty()) {
            builder.append('\n').append(format(TREATMENT, ci.treatment().allInstructions()));
        }
        if (ci.constraints() != null && !ci.constraints().isEmpty()) {
            builder.append('\n').append(format(CONSTRAINTS, ci.constraints()));
        }
    }
    if (intent instanceof HostToHostIntent) {
        HostToHostIntent pi = (HostToHostIntent) intent;
        builder.append('\n').append(format(SRC + HOST, pi.one()));
        builder.append('\n').append(format(DST + HOST, pi.two()));
    } else if (intent instanceof PointToPointIntent) {
        PointToPointIntent pi = (PointToPointIntent) intent;
        builder.append('\n').append(formatFilteredCps(Sets.newHashSet(pi.filteredIngressPoint()), INGRESS));
        builder.append('\n').append(formatFilteredCps(Sets.newHashSet(pi.filteredEgressPoint()), EGRESS));
    } else if (intent instanceof MultiPointToSinglePointIntent) {
        MultiPointToSinglePointIntent pi = (MultiPointToSinglePointIntent) intent;
        builder.append('\n').append(formatFilteredCps(pi.filteredIngressPoints(), INGRESS));
        builder.append('\n').append(formatFilteredCps(Sets.newHashSet(pi.filteredEgressPoint()), EGRESS));
    } else if (intent instanceof SinglePointToMultiPointIntent) {
        SinglePointToMultiPointIntent pi = (SinglePointToMultiPointIntent) intent;
        builder.append('\n').append(formatFilteredCps(Sets.newHashSet(pi.filteredIngressPoint()), INGRESS));
        builder.append('\n').append(formatFilteredCps(pi.filteredEgressPoints(), EGRESS));
    } else if (intent instanceof PathIntent) {
        PathIntent pi = (PathIntent) intent;
        builder.append(format("path=%s, cost=%f", pi.path().links(), pi.path().cost()));
    } else if (intent instanceof LinkCollectionIntent) {
        LinkCollectionIntent li = (LinkCollectionIntent) intent;
        builder.append('\n').append(format("links=%s", li.links()));
        builder.append('\n').append(format(CP, li.egressPoints()));
    } else if (intent instanceof OpticalCircuitIntent) {
        OpticalCircuitIntent ci = (OpticalCircuitIntent) intent;
        builder.append('\n').append(format("src=%s, dst=%s", ci.getSrc(), ci.getDst()));
        builder.append('\n').append(format("signal type=%s", ci.getSignalType()));
        builder.append('\n').append(format("bidirectional=%s", ci.isBidirectional()));
    } else if (intent instanceof OpticalConnectivityIntent) {
        OpticalConnectivityIntent ci = (OpticalConnectivityIntent) intent;
        builder.append('\n').append(format("src=%s, dst=%s", ci.getSrc(), ci.getDst()));
        builder.append('\n').append(format("signal type=%s", ci.getSignalType()));
        builder.append('\n').append(format("bidirectional=%s", ci.isBidirectional()));
        builder.append('\n').append(format("ochSignal=%s", ci.ochSignal()));
    } else if (intent instanceof OpticalOduIntent) {
        OpticalOduIntent ci = (OpticalOduIntent) intent;
        builder.append('\n').append(format("src=%s, dst=%s", ci.getSrc(), ci.getDst()));
        builder.append('\n').append(format("signal type=%s", ci.getSignalType()));
        builder.append('\n').append(format("bidirectional=%s", ci.isBidirectional()));
    }
    List<Intent> installable = service.getInstallableIntents(intent.key()).stream().filter(i -> contentFilter.filter(i)).collect(Collectors.toList());
    if (showInstallable && installable != null && !installable.isEmpty()) {
        builder.append('\n').append(format(INSTALLABLE, installable));
    }
    return builder;
}
Also used : StringFilter(org.onlab.util.StringFilter) StringUtils(org.apache.commons.lang.StringUtils) Tools(org.onlab.util.Tools) IntentState(org.onosproject.net.intent.IntentState) HashMap(java.util.HashMap) SinglePointToMultiPointIntent(org.onosproject.net.intent.SinglePointToMultiPointIntent) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) Command(org.apache.karaf.shell.api.action.Command) ConnectPoint(org.onosproject.net.ConnectPoint) ArrayList(java.util.ArrayList) Strings(com.google.common.base.Strings) Lists(com.google.common.collect.Lists) TrafficSelector(org.onosproject.net.flow.TrafficSelector) OpticalCircuitIntent(org.onosproject.net.intent.OpticalCircuitIntent) MultiPointToSinglePointIntent(org.onosproject.net.intent.MultiPointToSinglePointIntent) IntentService(org.onosproject.net.intent.IntentService) Map(java.util.Map) Intent(org.onosproject.net.intent.Intent) JsonNode(com.fasterxml.jackson.databind.JsonNode) WorkPartitionService(org.onosproject.net.intent.WorkPartitionService) Criterion(org.onosproject.net.flow.criteria.Criterion) NodeId(org.onosproject.cluster.NodeId) PathIntent(org.onosproject.net.intent.PathIntent) HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) WordUtils.uncapitalize(org.apache.commons.lang3.text.WordUtils.uncapitalize) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Set(java.util.Set) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) String.format(java.lang.String.format) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) AbstractShellCommand(org.onosproject.cli.AbstractShellCommand) Key(org.onosproject.net.intent.Key) List(java.util.List) PointToPointIntent(org.onosproject.net.intent.PointToPointIntent) Service(org.apache.karaf.shell.api.action.lifecycle.Service) ConnectivityIntent(org.onosproject.net.intent.ConnectivityIntent) OpticalOduIntent(org.onosproject.net.intent.OpticalOduIntent) MoreObjects.firstNonNull(com.google.common.base.MoreObjects.firstNonNull) Option(org.apache.karaf.shell.api.action.Option) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) FilteredConnectPoint(org.onosproject.net.FilteredConnectPoint) HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) PathIntent(org.onosproject.net.intent.PathIntent) PointToPointIntent(org.onosproject.net.intent.PointToPointIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) SinglePointToMultiPointIntent(org.onosproject.net.intent.SinglePointToMultiPointIntent) OpticalCircuitIntent(org.onosproject.net.intent.OpticalCircuitIntent) MultiPointToSinglePointIntent(org.onosproject.net.intent.MultiPointToSinglePointIntent) Intent(org.onosproject.net.intent.Intent) PathIntent(org.onosproject.net.intent.PathIntent) HostToHostIntent(org.onosproject.net.intent.HostToHostIntent) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent) PointToPointIntent(org.onosproject.net.intent.PointToPointIntent) ConnectivityIntent(org.onosproject.net.intent.ConnectivityIntent) OpticalOduIntent(org.onosproject.net.intent.OpticalOduIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) ConnectivityIntent(org.onosproject.net.intent.ConnectivityIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) SinglePointToMultiPointIntent(org.onosproject.net.intent.SinglePointToMultiPointIntent) OpticalOduIntent(org.onosproject.net.intent.OpticalOduIntent) MultiPointToSinglePointIntent(org.onosproject.net.intent.MultiPointToSinglePointIntent) OpticalCircuitIntent(org.onosproject.net.intent.OpticalCircuitIntent) LinkCollectionIntent(org.onosproject.net.intent.LinkCollectionIntent)

Example 15 with OpticalConnectivityIntent

use of org.onosproject.net.intent.OpticalConnectivityIntent in project onos by opennetworkinglab.

the class ProtectedIntentMonitor method protectedIntentHighlights.

// =======================================================================
// === Generate messages in JSON object node format
private Highlights protectedIntentHighlights() {
    Highlights highlights = new Highlights();
    TrafficLinkMap linkMap = new TrafficLinkMap();
    IntentService intentService = services.intent();
    if (selectedIntent != null) {
        List<Intent> installables = intentService.getInstallableIntents(selectedIntent.key());
        if (installables != null) {
            ProtectionEndpointIntent ep1 = installables.stream().filter(ProtectionEndpointIntent.class::isInstance).map(ProtectionEndpointIntent.class::cast).findFirst().orElse(null);
            ProtectionEndpointIntent ep2 = installables.stream().filter(ii -> !ii.equals(ep1)).filter(ProtectionEndpointIntent.class::isInstance).map(ProtectionEndpointIntent.class::cast).findFirst().orElse(null);
            if (ep1 == null || ep2 == null) {
                log.warn("Selected Intent {} didn't have 2 protection endpoints", selectedIntent.key());
                stopMonitoring();
                return highlights;
            }
            Set<Link> primary = new LinkedHashSet<>();
            Set<Link> backup = new LinkedHashSet<>();
            Map<Boolean, List<FlowRuleIntent>> transits = installables.stream().filter(FlowRuleIntent.class::isInstance).map(FlowRuleIntent.class::cast).collect(Collectors.groupingBy(this::isPrimary));
            // walk primary
            ConnectPoint primHead = ep1.description().paths().get(0).output().connectPoint();
            ConnectPoint primTail = ep2.description().paths().get(0).output().connectPoint();
            List<FlowRuleIntent> primTransit = transits.getOrDefault(true, ImmutableList.of());
            populateLinks(primary, primHead, primTail, primTransit);
            // walk backup
            ConnectPoint backHead = ep1.description().paths().get(1).output().connectPoint();
            ConnectPoint backTail = ep2.description().paths().get(1).output().connectPoint();
            List<FlowRuleIntent> backTransit = transits.getOrDefault(false, ImmutableList.of());
            populateLinks(backup, backHead, backTail, backTransit);
            // Add packet to optical links
            if (!usingBackup(primary)) {
                primary.addAll(protectedIntentMultiLayer(primHead, primTail));
            }
            backup.addAll(protectedIntentMultiLayer(backHead, backTail));
            boolean isOptical = selectedIntent instanceof OpticalConnectivityIntent;
            // Flavor is swapped so green is primary path.
            if (usingBackup(primary)) {
                // the backup becomes in use so we have a dotted line
                processLinks(linkMap, backup, Flavor.PRIMARY_HIGHLIGHT, isOptical, true, PROTECTED_MOD_BACKUP_SET);
            } else {
                processLinks(linkMap, primary, Flavor.PRIMARY_HIGHLIGHT, isOptical, true, PROTECTED_MOD_PRIMARY_SET);
                processLinks(linkMap, backup, Flavor.SECONDARY_HIGHLIGHT, isOptical, false, PROTECTED_MOD_BACKUP_SET);
            }
            updateHighlights(highlights, primary);
            updateHighlights(highlights, backup);
            colorLinks(highlights, linkMap);
            highlights.subdueAllElse(Highlights.Amount.MINIMALLY);
        } else {
            log.debug("Selected Intent has no installable intents");
        }
    } else {
        log.debug("Selected Intent is null");
    }
    return highlights;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) IntentService(org.onosproject.net.intent.IntentService) Highlights(org.onosproject.ui.topo.Highlights) ProtectionEndpointIntent(org.onosproject.net.intent.ProtectionEndpointIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) Intent(org.onosproject.net.intent.Intent) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent) OpticalConnectivityIntent(org.onosproject.net.intent.OpticalConnectivityIntent) ProtectionEndpointIntent(org.onosproject.net.intent.ProtectionEndpointIntent) ConnectPoint(org.onosproject.net.ConnectPoint) TrafficLinkMap(org.onosproject.ui.impl.topo.util.TrafficLinkMap) ImmutableList(com.google.common.collect.ImmutableList) LinkedList(java.util.LinkedList) List(java.util.List) Link(org.onosproject.net.Link) TrafficLink(org.onosproject.ui.impl.topo.util.TrafficLink) FlowRuleIntent(org.onosproject.net.intent.FlowRuleIntent)

Aggregations

OpticalConnectivityIntent (org.onosproject.net.intent.OpticalConnectivityIntent)20 ConnectPoint (org.onosproject.net.ConnectPoint)13 Intent (org.onosproject.net.intent.Intent)12 Link (org.onosproject.net.Link)10 ArrayList (java.util.ArrayList)7 FlowRuleIntent (org.onosproject.net.intent.FlowRuleIntent)7 List (java.util.List)6 OpticalCircuitIntent (org.onosproject.net.intent.OpticalCircuitIntent)6 LinkedList (java.util.LinkedList)5 Collectors (java.util.stream.Collectors)5 Test (org.junit.Test)5 DefaultPath (org.onosproject.net.DefaultPath)5 IntentService (org.onosproject.net.intent.IntentService)5 OchPort (org.onosproject.net.optical.OchPort)5 ImmutableList (com.google.common.collect.ImmutableList)4 Duration (java.time.Duration)4 Set (java.util.Set)4 ScalarWeight (org.onlab.graph.ScalarWeight)4 Bandwidth (org.onlab.util.Bandwidth)4 DefaultLink (org.onosproject.net.DefaultLink)4