Add method to get available resources filtered by its type
Change-Id: I034bdcf4e9a399af6c68c7ed7f53185bba9b2e27
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
index a86138a..7d6edcb 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/PathIntentCompiler.java
@@ -23,7 +23,6 @@
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onlab.packet.VlanId;
-import org.onlab.util.Tools;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.ConnectPoint;
@@ -299,9 +298,9 @@
}
private Set<VlanId> findVlanId(ConnectPoint cp) {
- return resourceService.getAvailableResources(Resources.discrete(cp.deviceId(), cp.port()).id()).stream()
- .flatMap(x -> Tools.stream(x.valueAs(VlanId.class)))
- .collect(Collectors.toSet());
+ return resourceService.getAvailableResourceValues(
+ Resources.discrete(cp.deviceId(), cp.port()).id(),
+ VlanId.class);
}
private boolean isLast(List<Link> links, int i) {