From 643ee33289bd2cb9e6afbfb09b4ed72d467ba1c2 Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Tue, 3 Nov 2015 14:08:10 -0800 Subject: This updates ONOS src tree to commit id 03fa5e571cabbd001ddb1598847e1150b11c7333 Change-Id: I13b554026d6f902933e35887d29bd5fdb669c0bd Signed-off-by: Ashlee Young --- .../onosproject/optical/OpticalPathProvisioner.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'framework/src/onos/apps/optical') 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; @@ -100,9 +101,6 @@ public class OpticalPathProvisioner { @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) protected IntentSetMultimap intentSetMultimap; - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) - protected LinkResourceService linkResourceService; - @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) protected ResourceService resourceService; @@ -377,17 +375,17 @@ public class OpticalPathProvisioner { * @param intent the intent */ private void releaseResources(Intent intent) { - LinkResourceAllocations lra = linkResourceService.getAllocations(intent.id()); + Collection 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)); } } } -- cgit 1.2.3-korg