X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fnetworkanalyzer%2FPceOtnNode.java;h=2e61eb4bcb01596ec23ad5d7a10daca03fe0b77c;hb=2af24568428a8fdc70c0f56ad71b939c8ce84530;hp=3ef3cf2fbb37a30e4fa7682e21403f9b881b5225;hpb=543d8ae199e9104c4211e9bdaf6804fe3005f064;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java index 3ef3cf2fb..2e61eb4bc 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java @@ -240,39 +240,14 @@ public class PceOtnNode implements PceNode { switch (modeType) { case "intermediate": - for (NonBlockingList nbl: nblList) { - for (TpId nwTp : netwTps) { - if (nbl.getTpList().contains(nwTp)) { - usableXpdrNWTps.add(nwTp); - } - if (usableXpdrNWTps.size() >= 2) { - return true; - } - } - } - return false; + return checkIntermediateSwPool(nblList, netwTps); case "AZ": if (clientTps == null) { return false; } clientTps.sort(Comparator.comparing(TpId::getValue)); - for (NonBlockingList nbl: nblList) { - for (TpId nwTp : netwTps) { - for (TpId clTp : clientTps) { - if (nbl.getTpList().contains(clTp) && nbl.getTpList().contains(nwTp)) { - usableXpdrClientTps.add(clTp); - usableXpdrNWTps.add(nwTp); - } - if (usableXpdrClientTps.size() >= 1 && usableXpdrNWTps.size() >= 1 - && (this.clientPort == null || this.clientPort.equals(clTp.getValue()))) { - clientPerNwTp.put(nwTp.getValue(), clTp.getValue()); - return true; - } - } - } - } - return false; + return checkAzSwPool(nblList, netwTps, clientTps); default: LOG.error("Unsupported mode type {}", modeType); @@ -280,6 +255,41 @@ public class PceOtnNode implements PceNode { } } + + private boolean checkIntermediateSwPool(List nblList, List netwTps) { + for (NonBlockingList nbl: nblList) { + for (TpId nwTp : netwTps) { + if (nbl.getTpList().contains(nwTp)) { + usableXpdrNWTps.add(nwTp); + } + if (usableXpdrNWTps.size() >= 2) { + return true; + } + } + } + return false; + } + + + private boolean checkAzSwPool(List nblList, List netwTps, List clientTps) { + for (NonBlockingList nbl: nblList) { + for (TpId nwTp : netwTps) { + for (TpId clTp : clientTps) { + if (nbl.getTpList().contains(clTp) && nbl.getTpList().contains(nwTp)) { + usableXpdrClientTps.add(clTp); + usableXpdrNWTps.add(nwTp); + } + if (usableXpdrClientTps.size() >= 1 && usableXpdrNWTps.size() >= 1 + && (this.clientPort == null || this.clientPort.equals(clTp.getValue()))) { + clientPerNwTp.put(nwTp.getValue(), clTp.getValue()); + return true; + } + } + } + } + return false; + } + private boolean checkTpForOdtuTermination(TerminationPoint1 ontTp1) { for (SupportedInterfaceCapability sic : ontTp1.getTpSupportedInterfaces().getSupportedInterfaceCapability() .values()) {