aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java')
-rw-r--r--framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java b/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
index 8466b95e..e0545023 100644
--- a/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
+++ b/framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.optical;
+import com.google.common.collect.ImmutableList;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
@@ -45,16 +46,16 @@ import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.OpticalCircuitIntent;
import org.onosproject.net.intent.OpticalConnectivityIntent;
import org.onosproject.net.intent.PointToPointIntent;
+import org.onosproject.net.newresource.ResourceAllocation;
import org.onosproject.net.newresource.ResourceService;
import org.onosproject.net.resource.device.IntentSetMultimap;
-import org.onosproject.net.resource.link.LinkResourceAllocations;
-import org.onosproject.net.resource.link.LinkResourceService;
import org.onosproject.net.topology.LinkWeight;
import org.onosproject.net.topology.PathService;
import org.onosproject.net.topology.TopologyEdge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
@@ -101,9 +102,6 @@ public class OpticalPathProvisioner {
protected IntentSetMultimap intentSetMultimap;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected LinkResourceService linkResourceService;
-
- @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ResourceService resourceService;
private ApplicationId appId;
@@ -377,17 +375,17 @@ public class OpticalPathProvisioner {
* @param intent the intent
*/
private void releaseResources(Intent intent) {
- LinkResourceAllocations lra = linkResourceService.getAllocations(intent.id());
+ Collection<ResourceAllocation> allocations = resourceService.getResourceAllocations(intent.id());
if (intent instanceof OpticalConnectivityIntent) {
resourceService.release(intent.id());
- if (lra != null) {
- linkResourceService.releaseResources(lra);
+ if (!allocations.isEmpty()) {
+ resourceService.release(ImmutableList.copyOf(allocations));
}
} else if (intent instanceof OpticalCircuitIntent) {
resourceService.release(intent.id());
intentSetMultimap.releaseMapping(intent.id());
- if (lra != null) {
- linkResourceService.releaseResources(lra);
+ if (!allocations.isEmpty()) {
+ resourceService.release(ImmutableList.copyOf(allocations));
}
}
}