+ .setDegreeNumber(Uint32.valueOf(degreeNumber)).setInterfaceName(interfaceName).build();
+ }
+
+ private McCapabilities createMcCapDegreeObject(Degree degree, String nodeId) {
+ String mcNodeName = "DEG" + degree.getDegreeNumber().toString() + "-TTP";
+ McCapabilitiesBuilder mcCapabilitiesBuilder = new McCapabilitiesBuilder()
+ .withKey(new McCapabilitiesKey(mcNodeName))
+ .setMcNodeName(mcNodeName);
+ if (degree.getMcCapabilities() != null) {
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(degree.getMcCapabilities().getCenterFreqGranularity())
+ .setSlotWidthGranularity(degree.getMcCapabilities().getSlotWidthGranularity());
+ }
+ else {
+ LOG.warn("Media channel capabilities are not advertised for degree {} of {}", degree.getDegreeNumber(),
+ nodeId);
+ LOG.info("Assuming the fixed grid capabilities for degree {} of {}", degree.getDegreeNumber(),
+ nodeId);
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(FrequencyGHz.getDefaultInstance("50"))
+ .setSlotWidthGranularity(FrequencyGHz.getDefaultInstance("50"));
+ }
+ return mcCapabilitiesBuilder.build();
+ }
+
+ private McCapabilities createMcCapSrgObject(SharedRiskGroup srg, String nodeId) {
+ String mcNodeName = "SRG" + srg.getSrgNumber().toString() + "-PP";
+ McCapabilitiesBuilder mcCapabilitiesBuilder = new McCapabilitiesBuilder()
+ .withKey(new McCapabilitiesKey(mcNodeName))
+ .setMcNodeName(mcNodeName);
+ if (srg.getMcCapabilities() != null) {
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(srg.getMcCapabilities().getCenterFreqGranularity())
+ .setSlotWidthGranularity(srg.getMcCapabilities().getSlotWidthGranularity());
+ }
+ else {
+ LOG.warn("Media channel capabilities are not advertised for SRG {} of {}", srg.getSrgNumber(),
+ nodeId);
+ LOG.info("Assuming the fixed grid capabilities for SRG {} of {}", srg.getSrgNumber(),
+ nodeId);
+ mcCapabilitiesBuilder
+ .setCenterFreqGranularity(FrequencyGHz.getDefaultInstance("50"))
+ .setSlotWidthGranularity(FrequencyGHz.getDefaultInstance("50"));
+ }
+ return mcCapabilitiesBuilder.build();