}
} catch (OpenRoadmInterfaceException e) {
// TODO Auto-generated catch block
- LOG.error("OpenRoadmInterfaceException occured {}",e);
+ LOG.error("OpenRoadmInterfaceException occured: ",e);
} /**catch (InterruptedException e) {
// TODO Auto-generated catch block
} catch (ExecutionException e) {
LOG.info("Executing GetLinkSpanLoss");
BigDecimal spanLoss = new BigDecimal(0);
for (RoadmLinks link : roadmLinks) {
- String sourceNodeId = link.getSrcNodeId().toString();
+ String sourceNodeId = link.getSrcNodeId();
String sourceTpId = link.getSrcTpId();
- String destNodeId = link.getDestNodeId().toString();
+ String destNodeId = link.getDestNodeId();
String destTpId = link.getDestTpid();
OtsPmHolder srcOtsPmHoler = getPmMeasurements(sourceNodeId, sourceTpId, "OpticalPowerOutput");
OtsPmHolder destOtsPmHoler = getPmMeasurements(destNodeId, destTpId, "OpticalPowerInput");
+ if (srcOtsPmHoler.getOtsInterfaceName() == null || destOtsPmHoler.getOtsInterfaceName() == null) {
+ LOG.warn("OTS is not present for the link {}", link);
+ continue;
+ }
spanLoss = new BigDecimal(srcOtsPmHoler.getOtsParameterVal() - destOtsPmHoler.getOtsParameterVal())
.setScale(0, RoundingMode.HALF_UP);
LOG.info("Spanloss Calculated as :{}={}-{}",
try (ReadTransaction readOnlyTransaction = this.dataBroker.newReadOnlyTransaction()) {
realNode = readOnlyTransaction.read(LogicalDatastoreType.CONFIGURATION, mappedNodeII).get();
} catch (InterruptedException | ExecutionException e) {
- LOG.error(e.getMessage(), e);
+ LOG.error("Error on getRealNodeId {} :", mappedNodeId, e);
throw new IllegalStateException(e);
}
if (!realNode.isPresent() || (realNode.get().getSupportingNode() == null)) {