X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2FPceSendingPceRPCs.java;h=f819daad548d89ed89883ced69c4566dc999a3ec;hb=73d098bc499661df6ef0044b62de4d46062ecfe9;hp=c2e9a909a1767ebad8d1b5abac841762d709723b;hpb=f327d205217ec8eefa4326881f8d06f1378db37a;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java b/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java index c2e9a909a..f819daad5 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java @@ -20,10 +20,11 @@ import org.opendaylight.transportpce.pce.gnpy.consumer.GnpyConsumer; import org.opendaylight.transportpce.pce.graph.PceGraph; import org.opendaylight.transportpce.pce.networkanalyzer.PceCalculation; import org.opendaylight.transportpce.pce.networkanalyzer.PceResult; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestInput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.PathComputationRequestInputBuilder; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.path.computation.reroute.request.input.Endpoints; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220808.service.path.rpc.result.PathDescriptionBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev230925.PathComputationRequestInput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev230925.PathComputationRequestInputBuilder; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev230925.PceConstraintMode; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev230925.path.computation.reroute.request.input.Endpoints; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev230925.service.path.rpc.result.PathDescriptionBuilder; import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.routing.constraints.HardConstraints; import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirection; import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ZToADirection; @@ -108,7 +109,8 @@ public class PceSendingPceRPCs { LOG.info("cancelResourceReserve ..."); } - public void pathComputationWithConstraints(PceConstraints hardConstraints, PceConstraints softConstraints) { + private void pathComputationWithConstraints(PceConstraints hardConstraints, PceConstraints softConstraints, + PceConstraintMode mode) { PceCalculation nwAnalizer = new PceCalculation(input, networkTransaction, hardConstraints, softConstraints, rc, portMapping, endpoints); @@ -121,8 +123,8 @@ public class PceSendingPceRPCs { } LOG.info("PceGraph ..."); PceGraph graph = new PceGraph(nwAnalizer.getaendPceNode(), nwAnalizer.getzendPceNode(), - nwAnalizer.getAllPceNodes(), nwAnalizer.getAllPceLinks(), hardConstraints, softConstraints, - rc, serviceType, networkTransaction); + nwAnalizer.getAllPceNodes(), nwAnalizer.getAllPceLinks(), hardConstraints, + rc, serviceType, networkTransaction, mode); graph.calcPath(); rc = graph.getReturnStructure(); if (!rc.getStatus()) { @@ -159,7 +161,7 @@ public class PceSendingPceRPCs { PceConstraintsCalc constraints = new PceConstraintsCalc(input, networkTransaction); pceHardConstraints = constraints.getPceHardConstraints(); pceSoftConstraints = constraints.getPceSoftConstraints(); - pathComputationWithConstraints(pceHardConstraints, pceSoftConstraints); + pathComputationWithConstraints(pceHardConstraints, pceSoftConstraints, PceConstraintMode.Loose); this.success = rc.getStatus(); this.message = rc.getMessage(); this.responseCode = rc.getResponseCode(); @@ -233,7 +235,7 @@ public class PceSendingPceRPCs { PceConstraintsCalc constraintsGnpy = new PceConstraintsCalc(inputFromGnpy, networkTransaction); PceConstraints gnpyHardConstraints = constraintsGnpy.getPceHardConstraints(); PceConstraints gnpySoftConstraints = constraintsGnpy.getPceSoftConstraints(); - pathComputationWithConstraints(gnpyHardConstraints, gnpySoftConstraints); + pathComputationWithConstraints(gnpyHardConstraints, gnpySoftConstraints, PceConstraintMode.Strict); AToZDirection atoz = rc.getAtoZDirection(); ZToADirection ztoa = rc.getZtoADirection(); if (gnpyToCheckFeasiblity(atoz, ztoa,gnpy)) { @@ -253,7 +255,7 @@ public class PceSendingPceRPCs { private PceGraph patchRerunGraph(PceGraph graph) { LOG.info("In pathComputation patchRerunGraph : rerun Graph with metric = PROPAGATION-DELAY "); - graph.setConstrains(pceHardConstraints, pceSoftConstraints); + graph.setConstrains(pceHardConstraints); graph.calcPath(); return graph; }