- if (String.join("+", nodeId, TapiStringConstants.OTSI_MC).equals(keyword)
- || String.join("+", nodeId, TapiStringConstants.PHTNC_MEDIA_OTS).equals(keyword)) {
- //Creating OTS & OTSI_MC NEP specific attributes
- onepBldr.setSupportedPayloadStructure(createSupportedPayloadStructureForPhtncMedia(
- sicColl,operModeList));
- SpectrumCapabilityPacBuilder spectrumPac = new SpectrumCapabilityPacBuilder();
- OccupiedSpectrumBuilder ospecBd = new OccupiedSpectrumBuilder();
- if (freqWidthMap == null || freqWidthMap.isEmpty()) {
- ospecBd
- .setUpperFrequency(Uint64.valueOf(0))
- .setLowerFrequency(Uint64.valueOf(0));
- onepBldr.setAvailablePayloadStructure(createAvailablePayloadStructureForPhtncMedia(
- false, sicColl,operModeList));
- double naz = 0.01;
- AvailableSpectrum aspec = new AvailableSpectrumBuilder()
- .setUpperFrequency(Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09
- + GridConstant.GRANULARITY * GridConstant.EFFECTIVE_BITS * 1E06 + naz)))
- .setLowerFrequency(Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09 + naz)))
- .build();
- Map<AvailableSpectrumKey, AvailableSpectrum> aspecMap = new HashMap<>();
- aspecMap.put(new AvailableSpectrumKey(aspec.getLowerFrequency(),
- aspec.getUpperFrequency()), aspec);
- spectrumPac.setAvailableSpectrum(aspecMap);
- } else {
- onepBldr.setAvailablePayloadStructure(createAvailablePayloadStructureForPhtncMedia(
- true, sicColl,operModeList));
- ospecBd
- .setUpperFrequency(Uint64.valueOf(Math.round(
- freqWidthMap.keySet().iterator().next().doubleValue() * 1E09
- + (freqWidthMap.entrySet().iterator().next().getValue().doubleValue() * 1E06) / 2)))
- .setLowerFrequency(Uint64.valueOf(Math.round(
- freqWidthMap.keySet().iterator().next().doubleValue() * 1E09
- - (freqWidthMap.entrySet().iterator().next().getValue().doubleValue() * 1E06) / 2)));
- }
- OccupiedSpectrum ospec = ospecBd.build();
- Map<OccupiedSpectrumKey, OccupiedSpectrum> ospecMap = new HashMap<>();
- ospecMap.put(new OccupiedSpectrumKey(ospec.getLowerFrequency(),
- ospec.getUpperFrequency()), ospec);
- spectrumPac.setOccupiedSpectrum(ospecMap);
- double nazz = 0.01;
- SupportableSpectrum sspec = new SupportableSpectrumBuilder()
- .setUpperFrequency(Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09
- + GridConstant.GRANULARITY * GridConstant.EFFECTIVE_BITS * 1E06 + nazz)))
- .setLowerFrequency(Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09 + nazz)))
- .build();
- Map<SupportableSpectrumKey, SupportableSpectrum> sspecMap = new HashMap<>();
- sspecMap.put(new SupportableSpectrumKey(sspec.getLowerFrequency(),
- sspec.getUpperFrequency()), sspec);
- spectrumPac.setSupportableSpectrum(sspecMap);
- PhotonicMediaNodeEdgePointSpec pnepSpec = new PhotonicMediaNodeEdgePointSpecBuilder()
- .setSpectrumCapabilityPac(spectrumPac.build())
- .build();
- org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev221121.OwnedNodeEdgePoint1 onep1 =
- new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.photonic.media.rev221121
- .OwnedNodeEdgePoint1Builder()
- .setPhotonicMediaNodeEdgePointSpec(pnepSpec)
- .build();
- onepBldr.addAugmentation(onep1);
+ if (!String.join("+", nodeId, TapiStringConstants.OTSI_MC).equals(keyword)
+ && !String.join("+", nodeId, TapiStringConstants.PHTNC_MEDIA_OTS).equals(keyword)) {
+ return onepBldr;
+ }
+ //Creating OTS & OTSI_MC NEP specific attributes
+ double naz = 0.01;
+ Uint64 supLoFreq = Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09 + naz));
+ Uint64 supUpFreq = Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09
+ + GridConstant.GRANULARITY * GridConstant.EFFECTIVE_BITS * 1E06 + naz));
+ boolean boolParam;
+ Uint64 upFreq;
+ Uint64 loFreq;
+ SpectrumCapabilityPacBuilder spectrumPac = new SpectrumCapabilityPacBuilder();
+ if (freqWidthMap == null || freqWidthMap.isEmpty()) {
+ upFreq = Uint64.valueOf(0);
+ loFreq = Uint64.valueOf(0);
+ boolParam = false;
+ AvailableSpectrum aspec =
+ new AvailableSpectrumBuilder().setUpperFrequency(supUpFreq).setLowerFrequency(supLoFreq).build();
+ spectrumPac.setAvailableSpectrum(new HashMap<>(Map.of(
+ new AvailableSpectrumKey(aspec.getLowerFrequency(), aspec.getUpperFrequency()), aspec)));
+ } else {
+ upFreq = Uint64.valueOf(Math.round(
+ freqWidthMap.keySet().iterator().next().doubleValue() * 1E09
+ + (freqWidthMap.entrySet().iterator().next().getValue().doubleValue() * 1E06) / 2));
+ loFreq = Uint64.valueOf(Math.round(
+ freqWidthMap.keySet().iterator().next().doubleValue() * 1E09
+ - (freqWidthMap.entrySet().iterator().next().getValue().doubleValue() * 1E06) / 2));
+ boolParam = true;