Use ResourceId or DiscreteResourceId when specifying a resource
Change-Id: I4e29558ec649510c8d08bb5e5f8ed10c189252e5
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java
index c8c7e8f..94b178e 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java
@@ -157,7 +157,7 @@
}
private Set<MplsLabel> findMplsLabel(ConnectPoint cp) {
- return resourceService.getAvailableResources(Resources.discrete(cp.deviceId(), cp.port()).resource()).stream()
+ return resourceService.getAvailableResources(Resources.discrete(cp.deviceId(), cp.port()).id()).stream()
.filter(x -> x.last() instanceof MplsLabel)
.map(x -> (MplsLabel) x.last())
.collect(Collectors.toSet());
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
index d2f92d5..b76ece8 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
@@ -313,8 +313,7 @@
if (ochCP != null) {
OchPort ochPort = (OchPort) deviceService.getPort(ochCP.deviceId(), ochCP.port());
Optional<IntentId> intentId =
- resourceService.getResourceAllocations(
- Resources.discrete(ochCP.deviceId(), ochCP.port()).resource())
+ resourceService.getResourceAllocations(Resources.discrete(ochCP.deviceId(), ochCP.port()).id())
.stream()
.map(ResourceAllocation::consumer)
.filter(x -> x instanceof IntentId)
@@ -335,8 +334,7 @@
}
Optional<IntentId> intentId =
- resourceService.getResourceAllocations(
- Resources.discrete(oduPort.deviceId(), port.number()).resource())
+ resourceService.getResourceAllocations(Resources.discrete(oduPort.deviceId(), port.number()).id())
.stream()
.map(ResourceAllocation::consumer)
.filter(x -> x instanceof IntentId)
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
index 2f04cfd..5b741bc 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
@@ -214,8 +214,8 @@
private Set<OchSignal> findCommonLambdasOverLinks(List<Link> links) {
return links.stream()
.flatMap(x -> Stream.of(
- Resources.discrete(x.src().deviceId(), x.src().port()).resource(),
- Resources.discrete(x.dst().deviceId(), x.dst().port()).resource()
+ Resources.discrete(x.src().deviceId(), x.src().port()).id(),
+ Resources.discrete(x.dst().deviceId(), x.dst().port()).id()
))
.map(resourceService::getAvailableResources)
.map(x -> Iterables.filter(x, r -> r.last() instanceof OchSignal))
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 93e2d8c..7309a09 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
@@ -285,7 +285,7 @@
}
private Set<VlanId> findVlanId(ConnectPoint cp) {
- return resourceService.getAvailableResources(Resources.discrete(cp.deviceId(), cp.port()).resource()).stream()
+ return resourceService.getAvailableResources(Resources.discrete(cp.deviceId(), cp.port()).id()).stream()
.filter(x -> x.last() instanceof VlanId)
.map(x -> (VlanId) x.last())
.collect(Collectors.toSet());