private Uuid getQueueUuid(List<Queues> operQueues, Uri queueId) { if (operQueues != null && !operQueues.isEmpty()) { for (Queues queueEntry : operQueues) { if (queueEntry.getQueueId().equals(queueId)) { return queueEntry.getQueueUuid(); } } } return null; }
private Uuid getQueueEntryUuid(List<Queues> operQueues, Uri queueId) { if (operQueues != null && !operQueues.isEmpty()) { for (Queues queueEntry : operQueues) { if (queueEntry.getQueueId().equals(queueId)) { return queueEntry.getQueueUuid(); } } } return null; } }
return false; if (!Objects.equals(_queueId, other.getQueueId())) { return false;
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()); } } }
if (updatedQueues != null && !updatedQueues.isEmpty()) { for (Queues updatedQueue : updatedQueues) { if (origQueue.getQueueId().equals(updatedQueue.getQueueId())) { found = true; break; LOG.debug("Received request to delete Queue entry {}", origQueue.getQueueId()); Uuid queueUuid = getQueueUuid(operQueues, origQueue.getQueueId()); if (queueUuid != null) { Queue queue = LOG.warn("Unable to delete Queue{} for node {} because it was not found in the " + "operational store, and thus we cannot retrieve its UUID", ovsdbNodeIid, origQueue.getQueueId());
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()); }
SouthboundMapper.createInstanceIdentifier(iid.firstKeyOf(Node.class, NodeKey.class).getNodeId()) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, new QueuesKey(queueEntry.getQueueId())))); queue.setExternalIds(externalIdsMap); Uuid operQueueUuid = getQueueEntryUuid(operNode.getQueues(), queueEntry.getQueueId()); if (operQueueUuid == null) { UUID namedUuid = new UUID(SouthboundConstants.QUEUE_NAMED_UUID_PREFIX + TransactUtils.bytesToHexString(queueEntry.getQueueId().getValue().getBytes())); transaction.add(op.insert(queue).withId(namedUuid.toString())).build(); LOG.info("Added queue Uuid : {} for Ovsdb Node : {}",
@SuppressWarnings("unchecked") private InstanceIdentifier<Queues> getQueueIid(UUID queueUuid, Node ovsdbNode) { Queue queue = getQueue(queueUuid); if (queue != null && queue.getExternalIdsColumn() != null && queue.getExternalIdsColumn().getData() != null && queue.getExternalIdsColumn().getData().containsKey(SouthboundConstants.IID_EXTERNAL_ID_KEY)) { return (InstanceIdentifier<Queues>) SouthboundUtil.deserializeInstanceIdentifier( queue.getExternalIdsColumn().getData().get(SouthboundConstants.IID_EXTERNAL_ID_KEY)); } else { OvsdbNodeAugmentation node = ovsdbNode.getAugmentation(OvsdbNodeAugmentation.class); if (node.getQueues() != null && !node.getQueues().isEmpty()) { for (Queues q : node.getQueues()) { if (q.getQueueUuid().equals(new Uuid(queueUuid.toString()))) { return SouthboundMapper.createInstanceIdentifier(ovsdbNode.getNodeId()) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, new QueuesKey(q.getQueueId())); } } } LOG.debug("A Queue with UUID {} was not found in Ovsdb Node {}", queueUuid, node); return SouthboundMapper.createInstanceIdentifier(ovsdbNode.getNodeId()) .augmentation(OvsdbNodeAugmentation.class) .child(Queues.class, new QueuesKey( new Uri(SouthboundConstants.QUEUE_URI_PREFIX + "://" + queueUuid.toString()))); } }