Add service-resiliency handling in service-create
[transportpce.git] / servicehandler / src / main / java / org / opendaylight / transportpce / servicehandler / ServiceInput.java
index 30b3cbf40551dd165b0929e97a6a0919652fa9a5..a818df60cf14fe2b6f52ebb3204cf3b523c73490 100644 (file)
@@ -7,23 +7,24 @@
  */
 package org.opendaylight.transportpce.servicehandler;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ConnectionType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.RpcActions;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.ServiceEndpoint;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeader;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev161014.sdnc.request.header.SdncRequestHeaderBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.HardConstraints;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceCreateInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceFeasibilityCheckInput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.ServiceReconfigureInput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.TempServiceCreateInput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.TempServiceCreateInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.TempServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.create.input.ServiceAEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.service.create.input.ServiceZEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ConnectionType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.RpcActions;
+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.sdnc.request.header.SdncRequestHeader;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.sdnc.request.header.SdncRequestHeaderBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.service.resiliency.ServiceResiliency;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.routing.constraints.HardConstraints;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev211210.routing.constraints.SoftConstraints;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceCreateInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceFeasibilityCheckInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.ServiceReconfigureInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceCreateInputBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.TempServiceDeleteInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.create.input.ServiceAEndBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.create.input.ServiceZEndBuilder;
 
 /**
  * Super class of {@link ServiceCreateInput} and {@link TempServiceCreateInput}.
@@ -43,6 +44,7 @@ public class ServiceInput {
     private ServiceEndpoint serviceZEnd;
     private String customer;
     private String customerContact;
+    private ServiceResiliency serviceResiliency;
     private boolean serviceReconfigure;
 
     public ServiceInput(ServiceCreateInput serviceCreateInput) {
@@ -56,6 +58,7 @@ public class ServiceInput {
         setServiceZEnd(serviceCreateInput.getServiceZEnd());
         setCustomer(serviceCreateInput.getCustomer());
         setCustomerContact(serviceCreateInput.getCustomerContact());
+        setServiceResiliency(serviceCreateInput.getServiceResiliency());
         setServiceReconfigure(false);
     }
 
@@ -73,6 +76,7 @@ public class ServiceInput {
         setServiceZEnd(serviceReconfigureInput.getServiceZEnd());
         setCustomer(serviceReconfigureInput.getCustomer());
         setCustomerContact(serviceReconfigureInput.getCustomerContact());
+        setServiceResiliency(serviceReconfigureInput.getServiceResiliency());
         setServiceReconfigure(true);
     }
 
@@ -93,6 +97,7 @@ public class ServiceInput {
         setServiceZEnd(tempServiceCreateInput.getServiceZEnd());
         setCustomer(tempServiceCreateInput.getCustomer());
         setCustomerContact(tempServiceCreateInput.getCustomerContact());
+        setServiceResiliency(tempServiceCreateInput.getServiceResiliency());
         setServiceReconfigure(false);
     }
 
@@ -107,6 +112,7 @@ public class ServiceInput {
         setServiceZEnd(serviceFeasibilityCheckInput.getServiceZEnd());
         setCustomer(serviceFeasibilityCheckInput.getCustomer());
         setCustomerContact(serviceFeasibilityCheckInput.getCustomerContact());
+        setServiceResiliency(serviceFeasibilityCheckInput.getServiceResiliency());
         setServiceReconfigure(false);
     }
 
@@ -128,7 +134,8 @@ public class ServiceInput {
                 .setServiceAEnd(new ServiceAEndBuilder(serviceAEnd).build())
                 .setServiceZEnd(new ServiceZEndBuilder(serviceZEnd).build())
                 .setCustomer(customer)
-                .setCustomerContact(customerContact);
+                .setCustomerContact(customerContact)
+                .setServiceResiliency(serviceResiliency);
         if (isServiceReconfigure()) {
             serviceCreateInputBuilder.setServiceName(newServiceName);
         } else {
@@ -138,14 +145,20 @@ public class ServiceInput {
     }
 
     public TempServiceCreateInput getTempServiceCreateInput() {
-        return new TempServiceCreateInputBuilder().setCommonId(commonId)
-                .setConnectionType(connectionType).setSdncRequestHeader(sdncRequestHeader)
-                .setHardConstraints(hardConstraints).setSoftConstraints(softConstraints)
-                .setServiceAEnd(new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service
+        return new TempServiceCreateInputBuilder()
+                .setCommonId(commonId)
+                .setConnectionType(connectionType)
+                .setSdncRequestHeader(sdncRequestHeader)
+                .setHardConstraints(hardConstraints)
+                .setSoftConstraints(softConstraints)
+                .setServiceAEnd(new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.temp.service
                         .create.input.ServiceAEndBuilder(serviceAEnd).build())
-                .setServiceZEnd(new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.temp.service
-                        .create.input.ServiceZEndBuilder(serviceZEnd).build()).setCustomer(customer)
-                .setCustomerContact(customerContact).build();
+                .setServiceZEnd(new org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.temp.service
+                        .create.input.ServiceZEndBuilder(serviceZEnd).build())
+                .setCustomer(customer)
+                .setCustomerContact(customerContact)
+                .setServiceResiliency(serviceResiliency)
+                .build();
     }
 
     public String getServiceName() {
@@ -236,6 +249,14 @@ public class ServiceInput {
         this.newServiceName = newServiceName;
     }
 
+    public void setServiceResiliency(ServiceResiliency serviceResiliency) {
+        this.serviceResiliency = serviceResiliency;
+    }
+
+    public ServiceResiliency getServiceResiliency() {
+        return serviceResiliency;
+    }
+
     public boolean isServiceReconfigure() {
         return serviceReconfigure;
     }