Fix bad imports
[transportpce.git] / servicehandler / src / main / java / org / opendaylight / transportpce / servicehandler / ModelMappingUtils.java
index b8d1668e6dd0e499ba1d9a0b8d8f85d3bbce5cb5..7ef1bab194177f298809ca0f4e12f9983232c7fc 100644 (file)
@@ -9,16 +9,16 @@ package org.opendaylight.transportpce.servicehandler;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.util.concurrent.ListenableFuture;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.PathComputationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.path.computation.request.input.ServiceAEnd;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.path.computation.request.input.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.path.computation.request.input.ServiceZEnd;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.path.computation.request.input.ServiceZEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220615.service.path.rpc.result.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.path.computation.request.input.ServiceAEnd;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.path.computation.request.input.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.path.computation.request.input.ServiceZEnd;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.path.computation.request.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.service.path.rpc.result.PathDescription;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceDeleteInputBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceImplementationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.ServiceImplementationRequestInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev181130.NodeIdType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev210528.NodeIdType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ServiceEndpoint;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.configuration.response.common.ConfigurationResponseCommonBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.response.parameters.ResponseParametersBuilder;
@@ -259,6 +259,19 @@ public final class ModelMappingUtils {
             .build();
     }
 
+    public static org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808
+            .path.computation.reroute.request.input.ServiceAEnd createServiceAEndReroute(ServiceEndpoint serviceAEnd) {
+        return new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808
+                .path.computation.reroute.request.input.ServiceAEndBuilder()
+                .setClli(serviceAEnd.getClli())
+                .setNodeId(serviceAEnd.getNodeId().getValue())
+                .setRxDirection(createRxDirection(serviceAEnd.getRxDirection().values().stream().findFirst().get()))
+                .setServiceFormat(serviceAEnd.getServiceFormat())
+                .setServiceRate(serviceAEnd.getServiceRate())
+                .setTxDirection(createTxDirection(serviceAEnd.getTxDirection().values().stream().findFirst().get()))
+                .build();
+    }
+
     public static ServiceZEnd createServiceZEnd(ServiceEndpoint serviceZEnd) {
         return new ServiceZEndBuilder()
             .setClli(serviceZEnd.getClli())
@@ -270,6 +283,19 @@ public final class ModelMappingUtils {
             .build();
     }
 
+    public static org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808
+            .path.computation.reroute.request.input.ServiceZEnd createServiceZEndReroute(ServiceEndpoint serviceZEnd) {
+        return new org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808
+                .path.computation.reroute.request.input.ServiceZEndBuilder()
+                .setClli(serviceZEnd.getClli())
+                .setNodeId(serviceZEnd.getNodeId().getValue())
+                .setRxDirection(createRxDirection(serviceZEnd.getRxDirection().values().stream().findFirst().get()))
+                .setServiceFormat(serviceZEnd.getServiceFormat())
+                .setServiceRate(serviceZEnd.getServiceRate())
+                .setTxDirection(createTxDirection(serviceZEnd.getTxDirection().values().stream().findFirst().get()))
+                .build();
+    }
+
     public static RxDirection createRxDirection(
             org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210
                 .service.endpoint.RxDirection rxDirection) {
@@ -391,14 +417,16 @@ public final class ModelMappingUtils {
     }
 
     public static ListenableFuture<RpcResult<ServiceRerouteOutput>> createRerouteServiceReply(
-            ServiceRerouteInput input, String finalAckYes, String message) {
+            ServiceRerouteInput input, String finalAckYes, String message, String responseCode) {
         return RpcResultBuilder
             .success(
                 new ServiceRerouteOutputBuilder()
                     .setConfigurationResponseCommon(
                         new ConfigurationResponseCommonBuilder()
-                            .setResponseMessage(message)
-                            .build())
+                             .setAckFinalIndicator(finalAckYes)
+                             .setResponseCode(responseCode)
+                             .setResponseMessage(message)
+                             .build())
                     .setHardConstraints(null)
                     .setSoftConstraints(null)
                     .build())