- }
- }
- if (nbClient == 0 && nbNetw == 2) {
- netwTps.sort(Comparator.comparing(TpId::getValue));
- //TODO compared to above, nested loops are inverted below - does it make really sense ?
- // there is room to rationalize things here
- for (NonBlockingList nbl : new ArrayList<>(node.augmentation(Node1.class).getSwitchingPools()
- .nonnullOduSwitchingPools().values().stream().findFirst().get()
- .getNonBlockingList().values())) {
- for (TpId nwTp : netwTps) {
- if (nbl.getTpList().contains(nwTp)) {
- usableXpdrNWTps.add(nwTp);
- }
- if (usableXpdrNWTps.size() >= 2) {
- //since nbClient == 0 && nbNetw == 2...
- return true;
+ return false;
+
+ 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;
+ }
+ }