diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-03 14:08:10 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-11-03 14:08:10 -0800 |
commit | 643ee33289bd2cb9e6afbfb09b4ed72d467ba1c2 (patch) | |
tree | c2c376a44a359544fe3d4c45eb0cc0e2ec4a7080 /framework/src/onos/apps/optical | |
parent | 46eeb79b54345bdafb6055b8ee4bad4ce8b01274 (diff) |
This updates ONOS src tree to commit id
03fa5e571cabbd001ddb1598847e1150b11c7333
Change-Id: I13b554026d6f902933e35887d29bd5fdb669c0bd
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/apps/optical')
-rw-r--r-- | framework/src/onos/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java | 18 |
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)); } } } |