From 6a07d2d622eaa06953f3353e39c080984076e8de Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 9 Oct 2015 18:32:44 -0700 Subject: Updated master to commit id 6ee8aa3e67ce89908a8c93aa9445c6f71a18f986 Change-Id: I94b055ee2f298daf71e2ec794fd0f2495bd8081f --- .../org/onosproject/optical/OpticalPathProvisioner.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 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 85b5de27..8466b95e 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 @@ -45,7 +45,8 @@ 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.resource.device.DeviceResourceService; +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; @@ -97,11 +98,14 @@ public class OpticalPathProvisioner { protected DeviceService deviceService; @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) - protected DeviceResourceService deviceResourceService; + protected IntentSetMultimap intentSetMultimap; @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) protected LinkResourceService linkResourceService; + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) + protected ResourceService resourceService; + private ApplicationId appId; private final InternalOpticalPathProvisioner pathProvisioner = new InternalOpticalPathProvisioner(); @@ -292,7 +296,6 @@ public class OpticalPathProvisioner { .bidirectional(true) .build(); intents.add(circuitIntent); - continue; } else if (srcPort instanceof OchPort && dstPort instanceof OchPort) { // Create lightpath // FIXME: hardcoded ODU signal type @@ -304,7 +307,6 @@ public class OpticalPathProvisioner { .bidirectional(true) .build(); intents.add(opticalIntent); - continue; } else { log.warn("Unsupported cross connect point types {} {}", srcPort.type(), dstPort.type()); return Collections.emptyList(); @@ -377,13 +379,13 @@ public class OpticalPathProvisioner { private void releaseResources(Intent intent) { LinkResourceAllocations lra = linkResourceService.getAllocations(intent.id()); if (intent instanceof OpticalConnectivityIntent) { - deviceResourceService.releasePorts(intent.id()); + resourceService.release(intent.id()); if (lra != null) { linkResourceService.releaseResources(lra); } } else if (intent instanceof OpticalCircuitIntent) { - deviceResourceService.releasePorts(intent.id()); - deviceResourceService.releaseMapping(intent.id()); + resourceService.release(intent.id()); + intentSetMultimap.releaseMapping(intent.id()); if (lra != null) { linkResourceService.releaseResources(lra); } -- cgit 1.2.3-korg