Replace method call of DeviceResourceService with that of ResourceService

Change-Id: I7a0400652cd43831a3fff4c0dc73fbe79d4eb633
diff --git a/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java b/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
index 5981e08..d72dab9 100644
--- a/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
+++ b/apps/optical/src/main/java/org/onosproject/optical/OpticalPathProvisioner.java
@@ -45,6 +45,7 @@
 import org.onosproject.net.intent.OpticalCircuitIntent;
 import org.onosproject.net.intent.OpticalConnectivityIntent;
 import org.onosproject.net.intent.PointToPointIntent;
+import org.onosproject.net.newresource.ResourceService;
 import org.onosproject.net.resource.device.DeviceResourceService;
 import org.onosproject.net.resource.link.LinkResourceAllocations;
 import org.onosproject.net.resource.link.LinkResourceService;
@@ -102,6 +103,9 @@
     @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();
@@ -375,12 +379,12 @@
         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());
+                resourceService.release(intent.id());
                 deviceResourceService.releaseMapping(intent.id());
                 if (lra != null) {
                     linkResourceService.releaseResources(lra);