X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2FPceSendingPceRPCs.java;h=af8a7f5803efa1f811b01b68d9307d563c784ad3;hb=0779ad5796bb645690874959c9a891c42e2f7175;hp=843aebfab947dfbcf181f15188121d21c1bfc0be;hpb=f1333ba85fbbe086ab540d759a3b6a898c52a135;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 843aebfab..af8a7f580 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java @@ -10,11 +10,11 @@ package org.opendaylight.transportpce.pce; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.transportpce.pce.PceResult.LocalCause; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev170426.PathComputationRequestInput; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.AToZDirection; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev170426.path.description.ZToADirection; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev170426.RoutingConstraintsSp.PceMetric; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev170426.response.parameters.sp.response.parameters.PathDescriptionBuilder; +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.service.path.rpc.result.PathDescriptionBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirection; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -89,6 +89,7 @@ public class PceSendingPceRPCs { } LOG.info("PceGraph ..."); + LOG.warn("PathComputation: aPceNode '{}' - zPceNode '{}'", nwAnalizer.getaPceNode(), nwAnalizer.getzPceNode()); PceGraph graph = new PceGraph( nwAnalizer.getaPceNode(), nwAnalizer.getzPceNode(), @@ -103,7 +104,7 @@ public class PceSendingPceRPCs { // TODO fix. This is quick workaround for algorithm problem if ((rc.getLocalCause() == LocalCause.TOO_HIGH_LATENCY) && (pceHardConstraints.getPceMetrics() == PceMetric.HopCount) - && (pceHardConstraints.getMaxLatency() != (long) -1)) { + && (pceHardConstraints.getMaxLatency() != -1)) { pceHardConstraints.setPceMetrics(PceMetric.PropagationDelay); graph = patchRerunGraph(graph, pceHardConstraints, pceSoftConstraints); @@ -129,12 +130,12 @@ public class PceSendingPceRPCs { LOG.info("setPathDescription ..."); AToZDirection atoz = rc.getAtoZDirection(); ZToADirection ztoa = rc.getZtoADirection(); - if (atoz == null || atoz.getAToZ() == null) { + if ((atoz == null) || (atoz.getAToZ() == null)) { rc.setRC("400"); LOG.error("In pathComputation empty atoz path after description: result = {}", rc.toString()); return; } - if (ztoa == null || ztoa.getZToA() == null) { + if ((ztoa == null) || (ztoa.getZToA() == null)) { rc.setRC("400"); LOG.error("In pathComputation empty ztoa path after description: result = {}", rc.toString()); return; @@ -145,11 +146,10 @@ public class PceSendingPceRPCs { LOG.info("In pathComputation Graph is Found"); } - private PceGraph patchRerunGraph(PceGraph graph, PceConstraints pceHardConstraints, - PceConstraints pceSoftConstraints) { + private PceGraph patchRerunGraph(PceGraph graph, PceConstraints pceHardCons, PceConstraints pceSoftCons) { LOG.info("In pathComputation patchRerunGraph : rerun Graph with metric = PROPAGATION-DELAY "); - graph.setConstrains(pceHardConstraints, pceSoftConstraints); + graph.setConstrains(pceHardCons, pceSoftCons); graph.calcPath(); return graph;