import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInput;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestInputBuilder;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev171017.PathComputationRequestOutput;
+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.service.rev161014.ServiceCreateInput;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev161014.TempServiceCreateInput;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraints;
import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.SoftConstraints;
}
public PathComputationRequestOutput performPCE(ServiceCreateInput serviceCreateInput, boolean reserveResource) {
- MappingConstraints mappingConstraints = new MappingConstraints(serviceCreateInput.getHardConstraints(),
- serviceCreateInput.getSoftConstraints());
+ return performPCE(serviceCreateInput.getHardConstraints(), serviceCreateInput.getSoftConstraints(),
+ serviceCreateInput.getServiceName(), serviceCreateInput.getSdncRequestHeader(),
+ serviceCreateInput.getServiceAEnd(), serviceCreateInput.getServiceZEnd(), reserveResource);
+ }
+
+ public PathComputationRequestOutput performPCE(TempServiceCreateInput tempServiceCreateInput,
+ boolean reserveResource) {
+ return performPCE(tempServiceCreateInput.getHardConstraints(), tempServiceCreateInput.getSoftConstraints(),
+ tempServiceCreateInput.getCommonId(), tempServiceCreateInput.getSdncRequestHeader(),
+ tempServiceCreateInput.getServiceAEnd(), tempServiceCreateInput.getServiceZEnd(), reserveResource);
+ }
+
+ private PathComputationRequestOutput performPCE(org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains
+ .rev161014.routing.constraints.HardConstraints hardConstraints, org.opendaylight.yang.gen.v1.http.org
+ .openroadm.routing.constrains.rev161014.routing.constraints.SoftConstraints softConstraints,
+ String serviceName, SdncRequestHeader sdncRequestHeader, ServiceEndpoint serviceAEnd,
+ ServiceEndpoint serviceZEnd, boolean reserveResource) {
+ MappingConstraints mappingConstraints = new MappingConstraints(hardConstraints, softConstraints);
mappingConstraints.serviceToServicePathConstarints();
PathComputationRequestInput pathComputationRequestInput =
- createPceRequestInput(serviceCreateInput, mappingConstraints.getServicePathHardConstraints(),
- mappingConstraints.getServicePathSoftConstraints(), reserveResource);
+ createPceRequestInput(serviceName, sdncRequestHeader,mappingConstraints.getServicePathHardConstraints(),
+ mappingConstraints.getServicePathSoftConstraints(), reserveResource, serviceAEnd,
+ serviceZEnd);
LOG.debug("Calling path computation.");
PathComputationRequestOutput pathComputationRequestOutput
= this.pathComputationService.pathComputationRequest(pathComputationRequestInput);
return pathComputationRequestOutput;
}
- private PathComputationRequestInput createPceRequestInput(ServiceCreateInput serviceCreateInput,
- HardConstraints hardConstraints,
- SoftConstraints softConstraints,
- Boolean reserveResource) {
+ private PathComputationRequestInput createPceRequestInput(String serviceName,
+ SdncRequestHeader serviceHandler, HardConstraints hardConstraints,
+ SoftConstraints softConstraints, Boolean reserveResource, ServiceEndpoint serviceAEnd,
+ ServiceEndpoint serviceZEnd) {
LOG.info("Mapping ServiceCreateInput or ServiceFeasibilityCheckInput or serviceReconfigureInput to PCE"
+ "requests");
ServiceHandlerHeaderBuilder serviceHandlerHeader = new ServiceHandlerHeaderBuilder();
- if (serviceCreateInput.getSdncRequestHeader() != null) {
- serviceHandlerHeader.setRequestId(serviceCreateInput.getSdncRequestHeader().getRequestId());
+ if (serviceHandler != null) {
+ serviceHandlerHeader.setRequestId(serviceHandler.getRequestId());
}
return new PathComputationRequestInputBuilder()
- .setServiceName(serviceCreateInput.getServiceName())
- .setResourceReserve(reserveResource)
- .setServiceHandlerHeader(serviceHandlerHeader.build())
- .setHardConstraints(hardConstraints)
- .setSoftConstraints(softConstraints)
- .setPceMetric(PceMetric.TEMetric)
- .setServiceAEnd(ModelMappingUtils.createServiceAEnd(serviceCreateInput.getServiceAEnd()))
- .setServiceZEnd(ModelMappingUtils.createServiceZEnd(serviceCreateInput.getServiceZEnd()))
- .build();
+ .setServiceName(serviceName)
+ .setResourceReserve(reserveResource)
+ .setServiceHandlerHeader(serviceHandlerHeader.build())
+ .setHardConstraints(hardConstraints)
+ .setSoftConstraints(softConstraints)
+ .setPceMetric(PceMetric.TEMetric)
+ .setServiceAEnd(ModelMappingUtils.createServiceAEnd(serviceAEnd))
+ .setServiceZEnd(ModelMappingUtils.createServiceZEnd(serviceZEnd))
+ .build();
}
private CancelResourceReserveInput mappingCancelResourceReserve(String serviceName,