-
- if (this.linkType == OpenroadmLinkType.ROADMTOROADM) {
- this.omsAttributesSpan = MapUtils.getOmsAttributesSpan(link);
- this.length = calcLength(link);
- this.srlgList = MapUtils.getSRLG(link);
- this.latency = calcLatency(link);
- this.availableBandwidth = 0L;
- this.usedBandwidth = 0L;
- Map<String, Double> spanLossMap = calcSpanLoss(link);
- this.spanLoss = spanLossMap.get("SpanLoss");
- this.powerCorrection = spanLossMap.get("PoutCorrection");
- Map<String, Double> cdAndPmdMap = calcCDandPMD(link);
- this.cd = cdAndPmdMap.get("CD");
- this.pmd2 = cdAndPmdMap.get("PMD2");
- } else if (this.linkType == OpenroadmLinkType.OTNLINK) {
- this.availableBandwidth = MapUtils.getAvailableBandwidth(link);
- this.usedBandwidth = MapUtils.getUsedBandwidth(link);
- this.srlgList = MapUtils.getSRLGfromLink(link);
- this.latency = 0L;
- this.length = 0.0;
- this.omsAttributesSpan = null;
- this.spanLoss = 0.0;
- this.powerCorrection = 0.0;
- this.cd = 0.0;
- this.pmd2 = 0.0;
- } else {
- this.omsAttributesSpan = null;
- this.srlgList = null;
- this.latency = 0L;
- this.length = 0.0;
- this.availableBandwidth = 0L;
- this.usedBandwidth = 0L;
- this.spanLoss = 0.0;
- this.powerCorrection = 0.0;
- this.cd = 0.0;
- this.pmd2 = 0.0;
+ switch (this.linkType) {
+ case ROADMTOROADM:
+ this.omsAttributesSpan = MapUtils.getOmsAttributesSpan(link);
+ this.length = calcLength(link);
+ this.srlgList = MapUtils.getSRLG(link);
+ this.latency = calcLatency(link);
+ this.availableBandwidth = 0L;
+ this.usedBandwidth = 0L;
+ Map<String, Double> spanLossMap = calcSpanLoss(link);
+ this.spanLoss = spanLossMap.get("SpanLoss");
+ this.powerCorrection = spanLossMap.get("PoutCorrection");
+ Map<String, Double> cdAndPmdMap = calcCDandPMD(link);
+ this.cd = cdAndPmdMap.get("CD");
+ this.pmd2 = cdAndPmdMap.get("PMD2");
+ break;
+ case OTNLINK:
+ this.availableBandwidth = MapUtils.getAvailableBandwidth(link);
+ this.usedBandwidth = MapUtils.getUsedBandwidth(link);
+ this.srlgList = MapUtils.getSRLGfromLink(link);
+ this.latency = 0L;
+ this.length = 0.0;
+ this.omsAttributesSpan = null;
+ this.spanLoss = 0.0;
+ this.powerCorrection = 0.0;
+ this.cd = 0.0;
+ this.pmd2 = 0.0;
+ break;
+ default:
+ this.omsAttributesSpan = null;
+ this.srlgList = null;
+ this.latency = 0L;
+ this.length = 0.0;
+ this.availableBandwidth = 0L;
+ this.usedBandwidth = 0L;
+ this.spanLoss = 0.0;
+ this.powerCorrection = 0.0;
+ this.cd = 0.0;
+ this.pmd2 = 0.0;
+ break;