use of org.onosproject.ovsdb.controller.OvsdbConstant.CBS in project onos by opennetworkinglab.
the class OvsdbQosConfig method getQoses.
@Override
public Collection<QosDescription> getQoses() {
OvsdbClientService ovsdbClient = getOvsdbClient(handler());
if (ovsdbClient == null) {
return null;
}
Set<OvsdbQos> qoses = ovsdbClient.getQoses();
return qoses.stream().map(qos -> DefaultQosDescription.builder().qosId(QosId.qosId(qos.externalIds().get(QOS_EXTERNAL_ID_KEY))).type(QOS_EGRESS_POLICER.equals(qos.qosType()) ? QosDescription.Type.EGRESS_POLICER : QosDescription.Type.valueOf(qos.qosType().replace(QOS_TYPE_PREFIX, "").toUpperCase())).maxRate(qos.otherConfigs().get(MAX_RATE) != null ? Bandwidth.bps(Long.parseLong(qos.otherConfigs().get(MAX_RATE))) : Bandwidth.bps(0L)).cbs(qos.otherConfigs().get(CBS) != null ? Long.valueOf(qos.otherConfigs().get(CBS)) : null).cir(qos.otherConfigs().get(CIR) != null ? Long.valueOf(qos.otherConfigs().get(CIR)) : null).build()).collect(Collectors.toSet());
}
Aggregations