Search in sources :

Example 1 with CIR

use of org.onosproject.ovsdb.controller.OvsdbConstant.CIR 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());
}
Also used : OvsdbNodeId(org.onosproject.ovsdb.controller.OvsdbNodeId) QOS_EXTERNAL_ID_KEY(org.onosproject.ovsdb.controller.OvsdbConstant.QOS_EXTERNAL_ID_KEY) QOS_TYPE_PREFIX(org.onosproject.ovsdb.controller.OvsdbConstant.QOS_TYPE_PREFIX) QOS_EGRESS_POLICER(org.onosproject.ovsdb.controller.OvsdbConstant.QOS_EGRESS_POLICER) QosDescription(org.onosproject.net.behaviour.QosDescription) AbstractHandlerBehaviour(org.onosproject.net.driver.AbstractHandlerBehaviour) CBS(org.onosproject.ovsdb.controller.OvsdbConstant.CBS) OvsdbController(org.onosproject.ovsdb.controller.OvsdbController) Map(java.util.Map) QosConfigBehaviour(org.onosproject.net.behaviour.QosConfigBehaviour) IpAddress(org.onlab.packet.IpAddress) QosId(org.onosproject.net.behaviour.QosId) Logger(org.slf4j.Logger) Bandwidth(org.onlab.util.Bandwidth) Collection(java.util.Collection) Set(java.util.Set) Collectors(java.util.stream.Collectors) List(java.util.List) DriverHandler(org.onosproject.net.driver.DriverHandler) DefaultQosDescription(org.onosproject.net.behaviour.DefaultQosDescription) QueueDescription(org.onosproject.net.behaviour.QueueDescription) MAX_RATE(org.onosproject.ovsdb.controller.OvsdbConstant.MAX_RATE) LoggerFactory.getLogger(org.slf4j.LoggerFactory.getLogger) CIR(org.onosproject.ovsdb.controller.OvsdbConstant.CIR) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService) DeviceId(org.onosproject.net.DeviceId) OvsdbQos(org.onosproject.ovsdb.controller.OvsdbQos) OvsdbQos(org.onosproject.ovsdb.controller.OvsdbQos) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService)

Aggregations

Collection (java.util.Collection)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 IpAddress (org.onlab.packet.IpAddress)1 Bandwidth (org.onlab.util.Bandwidth)1 DeviceId (org.onosproject.net.DeviceId)1 DefaultQosDescription (org.onosproject.net.behaviour.DefaultQosDescription)1 QosConfigBehaviour (org.onosproject.net.behaviour.QosConfigBehaviour)1 QosDescription (org.onosproject.net.behaviour.QosDescription)1 QosId (org.onosproject.net.behaviour.QosId)1 QueueDescription (org.onosproject.net.behaviour.QueueDescription)1 AbstractHandlerBehaviour (org.onosproject.net.driver.AbstractHandlerBehaviour)1 DriverHandler (org.onosproject.net.driver.DriverHandler)1 OvsdbClientService (org.onosproject.ovsdb.controller.OvsdbClientService)1 CBS (org.onosproject.ovsdb.controller.OvsdbConstant.CBS)1 CIR (org.onosproject.ovsdb.controller.OvsdbConstant.CIR)1 MAX_RATE (org.onosproject.ovsdb.controller.OvsdbConstant.MAX_RATE)1 QOS_EGRESS_POLICER (org.onosproject.ovsdb.controller.OvsdbConstant.QOS_EGRESS_POLICER)1