private QueuesImpl(QueuesBuilder base) { if (base.getKey() == null) { this._key = new QueuesKey( base.getQueueId() ); this._queueId = base.getQueueId(); } else { this._key = base.getKey(); this._queueId = _key.getQueueId(); } this._dscp = base.getDscp(); this._queueUuid = base.getQueueUuid(); this._queuesExternalIds = base.getQueuesExternalIds(); this._queuesOtherConfig = base.getQueuesOtherConfig(); 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.Queues>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.Queues>> 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.Queues>>, Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.Queues>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
private String getQueueUuid(OvsdbQueueRef queueRef, OvsdbNodeAugmentation operNode) { QueuesKey queueKey = queueRef.getValue().firstKeyOf(Queues.class); if (operNode.getQueues() != null && !operNode.getQueues().isEmpty()) { for (Queues queue : operNode.getQueues()) { if (queue.getQueueId().equals(queueKey.getQueueId())) { return queue.getQueueUuid().getValue(); } } } return SouthboundConstants.QUEUE_NAMED_UUID_PREFIX + TransactUtils.bytesToHexString(queueKey.getQueueId().getValue().getBytes()); }
public QueuesBuilder(Queues base) { if (base.getKey() == null) { this._key = new QueuesKey( base.getQueueId() ); this._queueId = base.getQueueId(); } else { this._key = base.getKey(); this._queueId = _key.getQueueId(); } this._dscp = base.getDscp(); this._queueUuid = base.getQueueUuid(); this._queuesExternalIds = base.getQueuesExternalIds(); this._queuesOtherConfig = base.getQueuesOtherConfig(); if (base instanceof QueuesImpl) { QueuesImpl impl = (QueuesImpl) 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.Queues> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.Queues>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
@SuppressWarnings("unchecked") private String getQueueId(Queue queue) { if (queue.getExternalIdsColumn() != null && queue.getExternalIdsColumn().getData() != null) { if (queue.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) { InstanceIdentifier<Queues> queueIid = (InstanceIdentifier<Queues>) SouthboundUtil.deserializeInstanceIdentifier( queue.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY)); if (queueIid != null) { QueuesKey queuesKey = queueIid.firstKeyOf(Queues.class); if (queuesKey != null) { return queuesKey.getQueueId().getValue(); } } } else if (queue.getExternalIdsColumn().getData() .containsKey(SouthboundConstants.QUEUE_ID_EXTERNAL_ID_KEY)) { return queue.getExternalIdsColumn().getData().get(SouthboundConstants.QUEUE_ID_EXTERNAL_ID_KEY); } } return SouthboundConstants.QUEUE_URI_PREFIX + "://" + queue.getUuid().toString(); }