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;
this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.network.topology.rev180226.Node1.class);
List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network
- .node.TerminationPoint> 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;
boolean used = true;
LOG.info("initSrgTpList: SRG-PP tp = {} found", tp.getTpId().getValue());
try {
- List<UsedWavelength> usedWavelengths = nttp1.getPpAttributes().getUsedWavelength();
+ List<UsedWavelength> usedWavelengths =
+ new ArrayList<>(nttp1.getPpAttributes().getUsedWavelength().values());
if (usedWavelengths.isEmpty()) {
used = false;
}
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;
case SRG :
List<org.opendaylight.yang.gen.v1.http.org.openroadm.srg.rev181130.srg.node.attributes
.AvailableWavelengths> 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;
break;
case DEGREE :
List<org.opendaylight.yang.gen.v1.http.org.openroadm.degree.rev181130.degree.node.attributes
- .AvailableWavelengths> 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;
this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
.ietf.network.topology.rev180226.Node1.class);
List<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network
- .node.TerminationPoint> 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;