+ .setModulationFormat(modulationFormat);
+
+ // Set the Flexo values
+ FlexoBuilder flexoBuilder = new FlexoBuilder();
+ boolean rateNotFound = false;
+ // Use the rate to switch rather than modulation format
+ int serviceRate = getServiceRate(modulationFormat, spectrumInformation);
+ switch (serviceRate) {
+ case 200:
+ LOG.info("Given modulation format is {} and thus rate is 200G", modulationFormat);
+ if (modulationFormat == ModulationFormat.DpQam16) {
+ LOG.info("FOIC is 2.8 for 31.6 Gbaud and rate is 200");
+ // FOIC rate is different
+ flexoBuilder.setFoicType(Foic28.class)
+ .setIid(new ArrayList<>(Arrays.asList(Uint8.valueOf(1), Uint8.valueOf(2),
+ Uint8.valueOf(3), Uint8.valueOf(4))));
+ } else {
+ // default is dp-qpsk for 200G under 63.1 GBaud
+ flexoBuilder.setFoicType(Foic24.class)
+ .setIid(new ArrayList<>(Arrays.asList(Uint8.valueOf(1), Uint8.valueOf(2))));
+ }
+ otsiBuilder.setOtsiRate(R200GOtsi.class)
+ .setFlexo(flexoBuilder.build());
+ break;
+ case 300:
+ LOG.info("Given modulation format is {} and thus rate is 300G", modulationFormat);
+ flexoBuilder.setFoicType(Foic36.class)
+ .setIid(new ArrayList<>(Arrays.asList(Uint8.valueOf(1), Uint8.valueOf(2),
+ Uint8.valueOf(3))));
+ otsiBuilder.setOtsiRate(R300GOtsi.class)
+ .setFlexo(flexoBuilder.build());
+ break;
+ case 400:
+ // Default baud-rate is 63.1 Gbaud
+ LOG.info("Given modulation format is {} and thus rate is 400G", modulationFormat);
+ flexoBuilder.setFoicType(Foic48.class)
+ .setIid(new ArrayList<>(Arrays.asList(Uint8.valueOf(1), Uint8.valueOf(2),
+ Uint8.valueOf(3), Uint8.valueOf(4))));
+ otsiBuilder.setModulationFormat(modulationFormat)
+ .setOtsiRate(R400GOtsi.class)
+ .setFlexo(flexoBuilder.build());
+ break;
+ default:
+ LOG.error("Rate {} is unsupported", serviceRate);
+ rateNotFound = true;
+ break;
+ }
+
+ if (rateNotFound) {
+ throw new OpenRoadmInterfaceException(
+ String.format(RATE_EXCEPTION_MESSAGE));
+ }
+