private QosEntriesImpl(QosEntriesBuilder base) { if (base.getKey() == null) { this._key = new QosEntriesKey( base.getQosId() ); this._qosId = base.getQosId(); } else { this._key = base.getKey(); this._qosId = _key.getQosId(); } this._qosExternalIds = base.getQosExternalIds(); this._qosOtherConfig = base.getQosOtherConfig(); this._qosType = base.getQosType(); this._qosUuid = base.getQosUuid(); this._queueList = base.getQueueList(); switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
return SouthboundMapper.createInstanceIdentifier(nodeId) .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, new QosEntriesKey(qosEntry.getQosId())); return SouthboundMapper.createInstanceIdentifier(nodeId) .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, new QosEntriesKey( new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString()))); return SouthboundMapper.createInstanceIdentifier(nodeId) .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, new QosEntriesKey( new Uri(SouthboundConstants.QOS_URI_PREFIX + "://" + qosUuid.toString())));
Uri qosId = qosRef.getValue().firstKeyOf(QosEntries.class).getQosId(); OvsdbNodeAugmentation operNode = getOperNode(operBridge); if (operNode != null && operNode.getQosEntries() != null
private static List<QosEntries> createQosEntries(Uni uni) { // Configure queue for best-effort dscp and max rate final List<QosOtherConfig> otherConfig = new ArrayList<>(); QosOtherConfig qosOtherConfig = new QosOtherConfigBuilder() .setKey(new QosOtherConfigKey(UnimgrConstants.QOS_DSCP_ATTRIBUTE)) .setOtherConfigKey(UnimgrConstants.QOS_DSCP_ATTRIBUTE) .setOtherConfigValue(UnimgrConstants.QOS_DSCP_ATTRIBUTE_VALUE) .build(); otherConfig.add(qosOtherConfig); qosOtherConfig = new QosOtherConfigBuilder() .setKey(new QosOtherConfigKey(UnimgrConstants.QOS_MAX_RATE)) .setOtherConfigKey(UnimgrConstants.QOS_MAX_RATE) .setOtherConfigValue(UniUtils.getSpeed(uni.getSpeed().getSpeed())) .build(); otherConfig.add(qosOtherConfig); final Uuid qosUuid = new Uuid(UUID.randomUUID().toString()); final QosEntries qosEntry = new QosEntriesBuilder() .setKey(new QosEntriesKey(new Uri(UnimgrConstants.QOS_PREFIX + qosUuid.getValue()))) .setQosId(new Uri(UnimgrConstants.QOS_PREFIX + qosUuid.getValue())) .setQosOtherConfig(otherConfig) .setQosType(SouthboundMapper.createQosType(SouthboundConstants.QOS_LINUX_HTB)) .build(); final List<QosEntries> qosEntries = new ArrayList<>(); qosEntries.add(qosEntry); return qosEntries; }
@SuppressWarnings("unchecked") private String getQosId(Qos qos) { if (qos.getExternalIdsColumn() != null && qos.getExternalIdsColumn().getData() != null) { if (qos.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) { InstanceIdentifier<QosEntries> qosIid = (InstanceIdentifier<QosEntries>) SouthboundUtil.deserializeInstanceIdentifier( qos.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY)); if (qosIid != null) { QosEntriesKey qosEntriesKey = qosIid.firstKeyOf(QosEntries.class); if (qosEntriesKey != null) { return qosEntriesKey.getQosId().getValue(); } } } else if (qos.getExternalIdsColumn().getData().containsKey(SouthboundConstants.QOS_ID_EXTERNAL_ID_KEY)) { return qos.getExternalIdsColumn().getData().get(SouthboundConstants.QOS_ID_EXTERNAL_ID_KEY); } } return SouthboundConstants.QOS_URI_PREFIX + "://" + qos.getUuid().toString(); }
public QosEntriesBuilder(QosEntries base) { if (base.getKey() == null) { this._key = new QosEntriesKey( base.getQosId() ); this._qosId = base.getQosId(); } else { this._key = base.getKey(); this._qosId = _key.getQosId(); } this._qosExternalIds = base.getQosExternalIds(); this._qosOtherConfig = base.getQosOtherConfig(); this._qosType = base.getQosType(); this._qosUuid = base.getQosUuid(); this._queueList = base.getQueueList(); if (base instanceof QosEntriesImpl) { QosEntriesImpl impl = (QosEntriesImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.QosEntries>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
SouthboundMapper.createInstanceIdentifier(iid.firstKeyOf(Node.class, NodeKey.class).getNodeId()) .augmentation(OvsdbNodeAugmentation.class) .child(QosEntries.class, new QosEntriesKey(qosEntry.getQosId())))); qos.setExternalIds(externalIdsMap);