+ public OwnedNodeEdgePointBuilder addPayloadStructureAndPhotSpecToOnep(String nodeId,
+ Map<Double, Double> freqWidthMap, List<OperationalModeKey> operModeList,
+ Collection<SupportedInterfaceCapability> sicColl, OwnedNodeEdgePointBuilder onepBldr, String keyword) {
+ 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 + naz)))
+ .setLowerFrequency(Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09
+ + GridConstant.GRANULARITY * GridConstant.EFFECTIVE_BITS * 1E06 + 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 + nazz)))
+ .setLowerFrequency(Uint64.valueOf(Math.round(GridConstant.START_EDGE_FREQUENCY * 1E09
+ + GridConstant.GRANULARITY * GridConstant.EFFECTIVE_BITS * 1E06 + 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);
+ }
+ return onepBldr;
+ }
+