Deprecate IndexedLambda and remove from optical intent compiler.
Allow drivers to report any spectral grid. Bugfixes.
ONOS-3495
Change-Id: Ied946660d48e482c1746d1e87735498b1637bb4b
diff --git a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java
index 46aeeb0..a1e545f 100644
--- a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java
+++ b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java
@@ -19,6 +19,7 @@
import org.onlab.packet.MplsLabel;
import org.onlab.packet.VlanId;
import org.onlab.util.ItemNotFoundException;
+import org.onosproject.net.DefaultOchSignalComparator;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.Port;
@@ -44,7 +45,9 @@
import java.util.Collections;
import java.util.List;
import java.util.SortedSet;
+import java.util.TreeSet;
import java.util.concurrent.ExecutorService;
+import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -199,7 +202,10 @@
}
LambdaQuery query = handler.behaviour(LambdaQuery.class);
if (query != null) {
- return query.queryLambdas(port);
+ Supplier<SortedSet<OchSignal>> supplier = () -> new TreeSet<>(new DefaultOchSignalComparator());
+ return query.queryLambdas(port).stream()
+ .flatMap(x -> OchSignal.toFlexGrid(x).stream())
+ .collect(Collectors.toCollection(supplier));
} else {
return Collections.emptySortedSet();
}