private Uuid getAutoAttachUuid(List<Autoattach> currentAutoAttach, Uri autoattachId) { if (currentAutoAttach != null && !currentAutoAttach.isEmpty()) { for (final Autoattach autoAttach : currentAutoAttach) { if (autoAttach.getAutoattachId().equals(autoattachId)) { return autoAttach.getAutoattachUuid(); } } } return null; } }
private Uuid getAutoAttachUuid(List<Autoattach> currentAutoAttach, Uri autoAttachId) { if (currentAutoAttach != null && !currentAutoAttach.isEmpty()) { for (final Autoattach autoAttach : currentAutoAttach) { if (autoAttach.getAutoattachId().equals(autoAttachId)) { return autoAttach.getAutoattachUuid(); } } } return null; }
autoAttach.getAutoattachId().getValue()); final Uuid aaUuid = getAutoAttachUuid(currentAutoAttach, autoAttach.getAutoattachId()); if (aaUuid != null) { final UUID uuid = new UUID(aaUuid.getValue()); bridge.setAutoAttach(Sets.newHashSet(new UUID(namedUuid))); LOG.trace("Create Autoattach table {}, and mutate the bridge {}", autoAttach.getAutoattachId(), getBridge(iid, bridgeUri).getBridgeName().getValue()); transaction.add(op.mutate(bridge) .addMutation(bridge.getAutoAttachColumn().getSchema(),
private void execute(TransactionBuilder transaction, BridgeOperationalState state, Map<InstanceIdentifier<OvsdbNodeAugmentation>, OvsdbNodeAugmentation> original, Map<InstanceIdentifier<OvsdbNodeAugmentation>, OvsdbNodeAugmentation> updated) { for (final Map.Entry<InstanceIdentifier<OvsdbNodeAugmentation>, OvsdbNodeAugmentation> originalEntry : original.entrySet()) { final InstanceIdentifier<OvsdbNodeAugmentation> ovsdbNodeIid = originalEntry.getKey(); final OvsdbNodeAugmentation ovsdbNodeAugmentation = originalEntry.getValue(); final OvsdbNodeAugmentation deletedOvsdbNodeAugmentation = updated.get(ovsdbNodeIid); if (ovsdbNodeAugmentation != null && deletedOvsdbNodeAugmentation != null) { final List<Autoattach> origAutoattachList = ovsdbNodeAugmentation.getAutoattach(); final List<Autoattach> deletedAutoattachList = deletedOvsdbNodeAugmentation.getAutoattach(); if (origAutoattachList != null && !origAutoattachList.isEmpty() && (deletedAutoattachList == null || deletedAutoattachList.isEmpty())) { if (true) { // FIXME: Remove if loop after ovs community supports external_ids column in AutoAttach Table LOG.info("UNSUPPORTED FUNCTIONALITY: Auto Attach related CRUD operations are not supported for" + " this version of OVSDB schema due to missing external_ids column."); return; } final OvsdbNodeAugmentation currentOvsdbNode = state.getBridgeNode(ovsdbNodeIid).get().getAugmentation(OvsdbNodeAugmentation.class); final List<Autoattach> currentAutoAttach = currentOvsdbNode.getAutoattach(); for (final Autoattach origAutoattach : origAutoattachList) { final Uri autoAttachId = origAutoattach.getAutoattachId(); deleteAutoAttach(transaction, ovsdbNodeIid, getAutoAttachUuid(currentAutoAttach, autoAttachId)); } } } } }
return false; if (!Objects.equals(_autoattachId, other.getAutoattachId())) { return false;
public AutoattachBuilder(Autoattach base) { if (base.getKey() == null) { this._key = new AutoattachKey( base.getAutoattachId() ); this._autoattachId = base.getAutoattachId(); } else { this._key = base.getKey(); this._autoattachId = _key.getAutoattachId(); } this._autoattachExternalIds = base.getAutoattachExternalIds(); this._autoattachUuid = base.getAutoattachUuid(); this._bridgeId = base.getBridgeId(); this._mappings = base.getMappings(); this._systemDescription = base.getSystemDescription(); this._systemName = base.getSystemName(); if (base instanceof AutoattachImpl) { AutoattachImpl impl = (AutoattachImpl) 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.Autoattach> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.Autoattach>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }