private void setNewOtherConfigs(QueuesBuilder queuesBuilder, Map<String, String> otherConfig) { Set<String> otherConfigKeys = otherConfig.keySet(); List<QueuesOtherConfig> otherConfigList = new ArrayList<>(); String otherConfigValue; for (String otherConfigKey : otherConfigKeys) { otherConfigValue = otherConfig.get(otherConfigKey); if (otherConfigKey != null && otherConfigValue != null) { otherConfigList.add(new QueuesOtherConfigBuilder().setQueueOtherConfigKey(otherConfigKey) .setQueueOtherConfigValue(otherConfigValue).build()); } } queuesBuilder.setQueuesOtherConfig(otherConfigList); }
private static List<Queues> createQueues(Uni uni) { final List<QueuesOtherConfig> otherConfig = new ArrayList<>(); QueuesOtherConfig queuesOtherConfig = new QueuesOtherConfigBuilder() .setKey(new QueuesOtherConfigKey(UnimgrConstants.QOS_DSCP_ATTRIBUTE)) .setQueueOtherConfigKey(UnimgrConstants.QOS_DSCP_ATTRIBUTE) .setQueueOtherConfigValue(UnimgrConstants.QOS_DSCP_ATTRIBUTE_VALUE) .build(); otherConfig.add(queuesOtherConfig); queuesOtherConfig = new QueuesOtherConfigBuilder() .setKey(new QueuesOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)) .setQueueOtherConfigKey(UnimgrConstants.QOS_MAX_RATE) .setQueueOtherConfigValue(UniUtils.getSpeed(uni.getSpeed().getSpeed())) .build(); otherConfig.add(queuesOtherConfig); // Configure dscp value for best-effort final Uuid queueUuid = new Uuid(UUID.randomUUID().toString()); final Queues queues = new QueuesBuilder() .setDscp(Short.parseShort(UnimgrConstants.QOS_DSCP_ATTRIBUTE_VALUE)) .setKey(new QueuesKey(new Uri(UnimgrConstants.QUEUE_PREFIX + queueUuid.getValue()))) .setQueueId(new Uri(UnimgrConstants.QUEUE_PREFIX + queueUuid.getValue())) .setQueuesOtherConfig(otherConfig) .build(); final List<Queues> queuesList = new ArrayList<>(); queuesList.add(queues); return queuesList; }