X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=renderer%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Frenderer%2Frpcs%2FDeviceRendererRPCImpl.java;h=338bea968454fef98f40746dd1af7cad8a6f4ae7;hb=b5ee86a522ce3cf5c6216f10647edb08b31c72e9;hp=5a709d6ab7387551b0fcc2cb04ba00e082880089;hpb=8bedfde5204149babc3ce3ccabf0f1db0bf5ae3a;p=transportpce.git diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/DeviceRendererRPCImpl.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/DeviceRendererRPCImpl.java index 5a709d6ab..338bea968 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/DeviceRendererRPCImpl.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/rpcs/DeviceRendererRPCImpl.java @@ -10,19 +10,20 @@ package org.opendaylight.transportpce.renderer.rpcs; import com.google.common.util.concurrent.ListenableFuture; import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException; +import org.opendaylight.transportpce.common.service.ServiceTypes; import org.opendaylight.transportpce.renderer.provisiondevice.DeviceRendererService; import org.opendaylight.transportpce.renderer.provisiondevice.OtnDeviceRendererService; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsInput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.CreateOtsOmsOutput; -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.rev210618.OtnServicePathOutputBuilder; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackInput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.RendererRollbackOutput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathInput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.ServicePathOutputBuilder; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev210618.TransportpceDeviceRendererService; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.CreateOtsOmsInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.CreateOtsOmsOutput; +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.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.OtnServicePathOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.RendererRollbackInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.RendererRollbackOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.ServicePathInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.ServicePathOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.ServicePathOutputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.TransportpceDeviceRendererService; import org.opendaylight.yangtools.yang.common.RpcResult; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; @@ -84,15 +85,16 @@ public class DeviceRendererRPCImpl implements TransportpceDeviceRendererService @Override public ListenableFuture> otnServicePath(OtnServicePathInput input) { - if (input.getOperation() != null) { + if (input.getOperation() != null && input.getServiceFormat() != null && input.getServiceRate() != null) { + String serviceType = ServiceTypes.getOtnServiceType(input.getServiceFormat(), input.getServiceRate()); if (input.getOperation().getIntValue() == 1) { LOG.info("Create operation request received"); return RpcResultBuilder.success(this.otnDeviceRendererService - .setupOtnServicePath(input)).buildFuture(); + .setupOtnServicePath(input, serviceType)).buildFuture(); } else if (input.getOperation().getIntValue() == 2) { LOG.info("Delete operation request received"); return RpcResultBuilder.success(this.otnDeviceRendererService - .deleteOtnServicePath(input)).buildFuture(); + .deleteOtnServicePath(input, serviceType)).buildFuture(); } } return RpcResultBuilder.success(new OtnServicePathOutputBuilder().setResult("Invalid operation")).buildFuture();