*/
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.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.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.ServiceRerouteInput;
+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}.
*
* @author Martial Coulibaly ( martial.coulibaly@gfi.com ) on behalf of Orange
- *
*/
public class ServiceInput {
private String serviceName;
+ private String newServiceName;
private String commonId;
private ConnectionType connectionType;
private SdncRequestHeader sdncRequestHeader;
private ServiceEndpoint serviceZEnd;
private String customer;
private String customerContact;
+ private ServiceResiliency serviceResiliency;
+ private boolean serviceReconfigure;
public ServiceInput(ServiceCreateInput serviceCreateInput) {
setServiceName(serviceCreateInput.getServiceName());
setServiceZEnd(serviceCreateInput.getServiceZEnd());
setCustomer(serviceCreateInput.getCustomer());
setCustomerContact(serviceCreateInput.getCustomerContact());
+ setServiceResiliency(serviceCreateInput.getServiceResiliency());
+ setServiceReconfigure(false);
+ }
+
+ public ServiceInput(ServiceReconfigureInput serviceReconfigureInput) {
+ setServiceName(serviceReconfigureInput.getServiceName());
+ setNewServiceName(serviceReconfigureInput.getNewServiceName());
+ setSdncRequestHeader(new SdncRequestHeaderBuilder()
+ .setRequestId(serviceReconfigureInput.getServiceName() + "-reconfigure")
+ .setRpcAction(RpcActions.ServiceReconfigure).build());
+ setCommonId(serviceReconfigureInput.getCommonId());
+ setConnectionType(serviceReconfigureInput.getConnectionType());
+ setHardConstraints(serviceReconfigureInput.getHardConstraints());
+ setSoftConstraints(serviceReconfigureInput.getSoftConstraints());
+ setServiceAEnd(serviceReconfigureInput.getServiceAEnd());
+ setServiceZEnd(serviceReconfigureInput.getServiceZEnd());
+ setCustomer(serviceReconfigureInput.getCustomer());
+ setCustomerContact(serviceReconfigureInput.getCustomerContact());
+ setServiceResiliency(serviceReconfigureInput.getServiceResiliency());
+ setServiceReconfigure(true);
}
public ServiceInput(ServiceDeleteInput serviceDeleteInput) {
setServiceName(serviceDeleteInput.getServiceDeleteReqInfo().getServiceName());
setSdncRequestHeader(serviceDeleteInput.getSdncRequestHeader());
+ setServiceReconfigure(false);
}
public ServiceInput(TempServiceCreateInput tempServiceCreateInput) {
setServiceZEnd(tempServiceCreateInput.getServiceZEnd());
setCustomer(tempServiceCreateInput.getCustomer());
setCustomerContact(tempServiceCreateInput.getCustomerContact());
+ setServiceResiliency(tempServiceCreateInput.getServiceResiliency());
+ setServiceReconfigure(false);
+ }
+
+ public ServiceInput(ServiceFeasibilityCheckInput serviceFeasibilityCheckInput) {
+ setServiceName(serviceFeasibilityCheckInput.getCommonId());
+ setCommonId(serviceFeasibilityCheckInput.getCommonId());
+ setConnectionType(serviceFeasibilityCheckInput.getConnectionType());
+ setSdncRequestHeader(serviceFeasibilityCheckInput.getSdncRequestHeader());
+ setHardConstraints(serviceFeasibilityCheckInput.getHardConstraints());
+ setSoftConstraints(serviceFeasibilityCheckInput.getSoftConstraints());
+ setServiceAEnd(serviceFeasibilityCheckInput.getServiceAEnd());
+ setServiceZEnd(serviceFeasibilityCheckInput.getServiceZEnd());
+ setCustomer(serviceFeasibilityCheckInput.getCustomer());
+ setCustomerContact(serviceFeasibilityCheckInput.getCustomerContact());
+ setServiceResiliency(serviceFeasibilityCheckInput.getServiceResiliency());
+ setServiceReconfigure(false);
}
public ServiceInput(TempServiceDeleteInput tempServiceDeleteInput) {
setServiceName(comId);
setCommonId(comId);
setSdncRequestHeader(new SdncRequestHeaderBuilder().setRequestId(comId).build());
+ setServiceReconfigure(false);
+ }
+
+ public ServiceInput(ServiceRerouteInput serviceRerouteInput) {
+ setServiceName(serviceRerouteInput.getServiceName());
+ setSdncRequestHeader(serviceRerouteInput.getSdncRequestHeader());
+ setServiceResiliency(serviceRerouteInput.getServiceResiliency());
+ setServiceReconfigure(false);
}
public ServiceCreateInput getServiceCreateInput() {
- return new ServiceCreateInputBuilder().setServiceName(serviceName)
+ ServiceCreateInputBuilder serviceCreateInputBuilder = new ServiceCreateInputBuilder()
.setCommonId(commonId)
.setConnectionType(connectionType)
.setSdncRequestHeader(sdncRequestHeader)
.setServiceAEnd(new ServiceAEndBuilder(serviceAEnd).build())
.setServiceZEnd(new ServiceZEndBuilder(serviceZEnd).build())
.setCustomer(customer)
- .setCustomerContact(customerContact).build();
+ .setCustomerContact(customerContact)
+ .setServiceResiliency(serviceResiliency);
+ if (isServiceReconfigure()) {
+ serviceCreateInputBuilder.setServiceName(newServiceName);
+ } else {
+ serviceCreateInputBuilder.setServiceName(serviceName);
+ }
+ return serviceCreateInputBuilder.build();
}
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() {
public void setCustomerContact(String customerContact) {
this.customerContact = customerContact;
}
+
+ public String getNewServiceName() {
+ return newServiceName;
+ }
+
+ public void setNewServiceName(String newServiceName) {
+ this.newServiceName = newServiceName;
+ }
+
+ public void setServiceResiliency(ServiceResiliency serviceResiliency) {
+ this.serviceResiliency = serviceResiliency;
+ }
+
+ public ServiceResiliency getServiceResiliency() {
+ return serviceResiliency;
+ }
+
+ public boolean isServiceReconfigure() {
+ return serviceReconfigure;
+ }
+
+ public void setServiceReconfigure(boolean serviceReconfigure) {
+ this.serviceReconfigure = serviceReconfigure;
+ }
}