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()); } } }
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 AutoattachKey getAutoAttachKeyToRemove(Node node, UUID autoAttachUuid) { final List<Autoattach> autoAttachList = node.getAugmentation(OvsdbNodeAugmentation.class).getAutoattach(); if (autoAttachList == null || autoAttachList.isEmpty()) { return null; } for (final Autoattach autoAttach : autoAttachList) { if (autoAttach.getAutoattachUuid() .equals(new Uuid(autoAttachUuid.toString()))) { return autoAttach.getKey(); } } 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(),
final InstanceIdentifier<Autoattach> iid = nodeIId .augmentation(OvsdbNodeAugmentation.class) .child(Autoattach.class, autoAttachEntry.getKey()); transaction.put(LogicalDatastoreType.OPERATIONAL, iid, autoAttachEntry);
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 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)); } } } } }
if (!Objects.equals(_autoattachExternalIds, other.getAutoattachExternalIds())) { return false; if (!Objects.equals(_autoattachId, other.getAutoattachId())) { return false; if (!Objects.equals(_autoattachUuid, other.getAutoattachUuid())) { return false; if (!Objects.equals(_bridgeId, other.getBridgeId())) { return false; if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_mappings, other.getMappings())) { return false; if (!Objects.equals(_systemDescription, other.getSystemDescription())) { return false; if (!Objects.equals(_systemName, other.getSystemName())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;