X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fnetworkanalyzer%2FPceLink.java;h=2d05a3e0989691eb4d65f8fd5cd54443c1fd3703;hp=9e28aa9bdec02f9acb68469af2dab6d777e16b9e;hb=21e44f9673e03245340291298869b27bf671497f;hpb=d5d2a9e9756c2dc6a296c0ee37cb67ae2f05fae2 diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java index 9e28aa9bd..2d05a3e09 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceLink.java @@ -173,6 +173,10 @@ public class PceLink implements Serializable { if (!linkConcatenationiterator.hasNext()) { return 0L; } + if (this.omsAttributesSpan.getSpanlossCurrent() == null) { + LOG.error("in PceLink : Spanloss is null"); + return 0L; + } // power on the output of the previous ROADM (dBm) double pout = retrievePower(linkConcatenationiterator.next().augmentation(LinkConcatenation1.class) .getFiberType()); @@ -300,9 +304,14 @@ public class PceLink implements Serializable { LOG.error("PceLink: No Link type or opposite link is available. Link is ignored {}", linkId); } isValid = checkParams(); - if ((this.omsAttributesSpan == null) && (this.linkType == OpenroadmLinkType.ROADMTOROADM)) { - isValid = false; - LOG.error("PceLink: Error reading Span for OMS link. Link is ignored {}", linkId); + if (this.linkType == OpenroadmLinkType.ROADMTOROADM) { + if (this.omsAttributesSpan == null) { + isValid = false; + LOG.error("PceLink: Error reading Span for OMS link. Link is ignored {}", linkId); + } else if (this.omsAttributesSpan.getSpanlossCurrent() == null) { + isValid = false; + LOG.error("PceLink: Error reading Spanloss for OMS link. Link is ignored {}", linkId); + } } if ((this.srlgList != null) && (this.srlgList.isEmpty())) { isValid = false;