- flexGrid = flexGrid.getFlexWaveMapping(centerFrequency.floatValue(), slotWidth.floatValue());
- Mapping portMap = portMapping.getMapping(nodeId, logicalConnPoint);
- if (portMap == null) {
- throw new OpenRoadmInterfaceException(
- String.format("Unable to get mapping from PortMapping for node % and logical connection port %s",
- nodeId, logicalConnPoint));
- }
-
- LOG.info("Freq Start {} and Freq End {} and center-Freq {}", flexGrid.getStart(),
- flexGrid.getStop(),centerFrequency);
- //TODO : Check this method
- InterfaceBuilder nmcInterfaceBldr = createGenericInterfaceBuilder(portMap,
- NetworkMediaChannelConnectionTerminationPoint.class, logicalConnPoint + "-nmc" + "-" + bitmapIndex);
- if (logicalConnPoint.contains("DEG")) {
- nmcInterfaceBldr.setSupportingInterface(logicalConnPoint + "-mc" + "-" + bitmapIndex);
- }
- NmcCtpBuilder nmcCtpIfBuilder;
-
- // From the logicalConnPoint, get the substring and for that associated substring find the mc-cap
- String mcLcp = "";
- if (logicalConnPoint.contains("-PP")) {
- mcLcp = logicalConnPoint.substring(0, logicalConnPoint.indexOf("-")) + "-PP";
- }
- else if (logicalConnPoint.contains("-TTP")) {
- mcLcp = logicalConnPoint.substring(0, logicalConnPoint.indexOf("-")) + "-TTP";
- }
- try {
- double slotWidthGran = portMapping.getMcCapbilities(nodeId, mcLcp)
- .getSlotWidthGranularity().getValue().doubleValue();
-
- // Dead-band is constant (Ref: WP)
- double deadBand = 8; // In GHz
- double guardBand = Math.ceil(deadBand / slotWidthGran) * slotWidthGran;
-
- nmcCtpIfBuilder = new NmcCtpBuilder()
- .setFrequency(FrequencyTHz.getDefaultInstance(String.valueOf(centerFrequency)))
- .setWidth(FrequencyGHz.getDefaultInstance(String.valueOf(slotWidth.doubleValue() - guardBand)));
-
- // Create Interface1 type object required for adding as augmentation
- org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019.Interface1Builder
- nmcCtpI1fBuilder =
- new org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019
- .Interface1Builder().setNmcCtp(nmcCtpIfBuilder.build());
- nmcInterfaceBldr.addAugmentation(
- org.opendaylight.yang.gen.v1.http.org.openroadm.network.media.channel.interfaces.rev181019
- .Interface1.class, nmcCtpI1fBuilder.build());
-
- // Post interface on the device
- openRoadmInterfaces.postInterface(nodeId, nmcInterfaceBldr);
-