Search in sources :

Example 6 with OvsdbQos

use of org.onosproject.ovsdb.controller.OvsdbQos in project onos by opennetworkinglab.

the class OvsdbQosConfig method getQos.

@Override
public QosDescription getQos(QosDescription qosDesc) {
    OvsdbClientService ovsdbClient = getOvsdbClient(handler());
    if (ovsdbClient == null) {
        return null;
    }
    OvsdbQos qos = ovsdbClient.getQos(qosDesc.qosId());
    if (qos == null) {
        return null;
    }
    return 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();
}
Also used : OvsdbQos(org.onosproject.ovsdb.controller.OvsdbQos) OvsdbClientService(org.onosproject.ovsdb.controller.OvsdbClientService)

Aggregations

OvsdbQos (org.onosproject.ovsdb.controller.OvsdbQos)6 OvsdbClientService (org.onosproject.ovsdb.controller.OvsdbClientService)3 Map (java.util.Map)2 OvsdbRowStore (org.onosproject.ovsdb.controller.OvsdbRowStore)2 Row (org.onosproject.ovsdb.rfc.notation.Row)2 DatabaseSchema (org.onosproject.ovsdb.rfc.schema.DatabaseSchema)2 Qos (org.onosproject.ovsdb.rfc.table.Qos)2 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Objects (java.util.Objects)1 Set (java.util.Set)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 ExecutionException (java.util.concurrent.ExecutionException)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