Manage ODU4 services over multiple OTU4
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / provisiondevice / tasks / OtnDeviceRenderingTask.java
index 221f8a3606a7d87097e8703fb5f8af37f645c368..ade66d62a5729451f26153aeafa449efb29d0a93 100644 (file)
@@ -12,8 +12,8 @@ import java.util.ArrayList;
 import java.util.concurrent.Callable;
 import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService;
 import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRenderingResult;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathInput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.OtnServicePathOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.OtnServicePathInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.OtnServicePathOutput;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -22,11 +22,13 @@ public class OtnDeviceRenderingTask implements Callable<OtnDeviceRenderingResult
 
     private final OtnDeviceRendererService otnDeviceRenderer;
     private final OtnServicePathInput otnServicePathInput;
+    private final String serviceType;
 
     public OtnDeviceRenderingTask(OtnDeviceRendererService otnDeviceRendererService,
-            OtnServicePathInput otnServicePathInput) {
+            OtnServicePathInput otnServicePathInput, String serviceType) {
         this.otnDeviceRenderer = otnDeviceRendererService;
         this.otnServicePathInput = otnServicePathInput;
+        this.serviceType = serviceType;
     }
 
     @Override
@@ -36,11 +38,11 @@ public class OtnDeviceRenderingTask implements Callable<OtnDeviceRenderingResult
         switch (this.otnServicePathInput.getOperation()) {
             case Create:
                 operation = "setup";
-                output = this.otnDeviceRenderer.setupOtnServicePath(this.otnServicePathInput);
+                output = this.otnDeviceRenderer.setupOtnServicePath(this.otnServicePathInput, this.serviceType);
                 break;
             case Delete:
                 operation = "delete";
-                output = this.otnDeviceRenderer.deleteOtnServicePath(this.otnServicePathInput);
+                output = this.otnDeviceRenderer.deleteOtnServicePath(this.otnServicePathInput, this.serviceType);
                 break;
             default:
                 return OtnDeviceRenderingResult.failed("Device rendering failed - unknown operation");