X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fnetworkanalyzer%2FPceOpticalNode.java;h=80574e4cf62170024cf0460107f03c77fe3bf1e7;hb=bc9a08be9d7cdeb30ecffd3c82ddd656a3a23043;hp=38fa7347bb0e02dc668c224f79050bf0cf5d9343;hpb=bed96a4eb1ea59f07a8d7602f792ad70854cb35c;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java index 38fa7347b..80574e4cf 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOpticalNode.java @@ -14,7 +14,6 @@ import java.util.List; import java.util.Map; import java.util.Optional; import java.util.TreeMap; - import org.opendaylight.transportpce.pce.SortPortsByName; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev181130.TerminationPoint1; import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.rev181130.Node1; @@ -72,8 +71,8 @@ public class PceOpticalNode implements PceNode { this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang .ietf.network.topology.rev180226.Node1.class); List allTps = nodeTp.getTerminationPoint(); - if (allTps == null) { + .node.TerminationPoint> allTps = new ArrayList<>(nodeTp.nonnullTerminationPoint().values()); + if (allTps.isEmpty()) { LOG.error("initSrgTpList: ROADM TerminationPoint list is empty for node {}", this); this.valid = false; return; @@ -100,7 +99,8 @@ public class PceOpticalNode implements PceNode { boolean used = true; LOG.info("initSrgTpList: SRG-PP tp = {} found", tp.getTpId().getValue()); try { - List usedWavelengths = nttp1.getPpAttributes().getUsedWavelength(); + List usedWavelengths = + new ArrayList<>(nttp1.getPpAttributes().getUsedWavelength().values()); if (usedWavelengths.isEmpty()) { used = false; } @@ -119,7 +119,7 @@ public class PceOpticalNode implements PceNode { break; } } - if (this.availableSrgPp.isEmpty() && this.availableSrgCp.isEmpty()) { + if (this.availableSrgPp.isEmpty() || this.availableSrgCp.isEmpty()) { LOG.error("initSrgTpList: ROADM SRG TerminationPoint list is empty for node {}", this); this.valid = false; return; @@ -138,8 +138,8 @@ public class PceOpticalNode implements PceNode { case SRG : List srgAvailableWL = - node1.getSrgAttributes().getAvailableWavelengths(); - if (srgAvailableWL == null) { + new ArrayList<>(node1.getSrgAttributes().nonnullAvailableWavelengths().values()); + if (srgAvailableWL.isEmpty()) { this.valid = false; LOG.error("initWLlist: SRG AvailableWavelengths is empty for node {}", this); return; @@ -152,8 +152,9 @@ public class PceOpticalNode implements PceNode { break; case DEGREE : List degAvailableWL = node1.getDegreeAttributes().getAvailableWavelengths(); - if (degAvailableWL == null) { + .AvailableWavelengths> degAvailableWL = + new ArrayList<>(node1.getDegreeAttributes().nonnullAvailableWavelengths().values()); + if (degAvailableWL.isEmpty()) { this.valid = false; LOG.error("initWLlist: DEG AvailableWavelengths is empty for node {}", this); return; @@ -190,8 +191,8 @@ public class PceOpticalNode implements PceNode { this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang .ietf.network.topology.rev180226.Node1.class); List allTps = nodeTp.getTerminationPoint(); - if (allTps == null) { + .node.TerminationPoint> allTps = new ArrayList<>(nodeTp.nonnullTerminationPoint().values()); + if (allTps.isEmpty()) { this.valid = false; LOG.error("initXndrTps: XPONDER TerminationPoint list is empty for node {}", this); return;