public Where where(Condition condition) { this.where.add(condition); return new Where(this); }
public Where and(Condition condition) { condition(condition); return this; }
transaction.add(op.delete(qos.getSchema()) .where(qos.getUuidColumn().getSchema().opEqual(new UUID(qosUuid.getValue()))) .build()); LOG.info("Removed QoS Uuid : {} for node : {} ", origQosEntry.getQosId(), ovsdbNodeIid);
Mutator.INSERT,bridge.getProtocolsColumn().getData()) .where(bridge.getNameColumn().getSchema().opEqual(bridge.getNameColumn().getData())) .build()); LOG.info("Updated ProtocolEntry : {} for OVSDB Bridge : {} ", protocolString, bridge.getName());
.where(queue.getUuidColumn().getSchema().opEqual( new UUID(queueUuid.getValue()))) .build()); LOG.info("Deleted queue Uuid : {} for the Ovsdb Node : {}", queueUuid, operNode); } else {
public Where where(Condition condition) { where.add(condition); return new Where(this); }
public Where and(ColumnSchema column, Function function, Object value) { condition(column, function, value); return this; }
public static void stampInstanceIdentifier(TransactionBuilder transaction, InstanceIdentifier <OvsdbTerminationPointAugmentation> iid, String interfaceName) { Port port = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Port.class); port.setName(interfaceName); port.setExternalIds(Collections.<String,String>emptyMap()); Mutate mutate = TransactUtils.stampInstanceIdentifierMutation(transaction, iid, port.getSchema(), port.getExternalIdsColumn().getSchema()); transaction.add(mutate .where(port.getNameColumn().getSchema().opEqual(interfaceName)) .build()); }
public Where where(Condition condition) { where.add(condition); return new Where(this); }
public Where condition(ColumnSchema column, Function function, Object value) { this.condition(new Condition(column.getName(), function, value)); return this; }
transactionBuilder.add(op.update(tableSchema, row) .where(_uuid.opEqual(rowUuid)) .build());
public Where where(Condition condition) { where.add(condition); return new Where(this); }
private void stampInstanceIdentifier(TransactionBuilder transaction,InstanceIdentifier<Node> iid, String bridgeName) { Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class); bridge.setName(bridgeName); bridge.setExternalIds(Collections.<String,String>emptyMap()); Mutate mutate = TransactUtils.stampInstanceIdentifierMutation(transaction, iid, bridge.getSchema(), bridge.getExternalIdsColumn().getSchema()); transaction.add(mutate .where(bridge.getNameColumn().getSchema().opEqual(bridgeName)) .build()); }
private void execute(TransactionBuilder transaction, BridgeOperationalState state, Set<InstanceIdentifier<OvsdbBridgeAugmentation>> removed, Map<InstanceIdentifier<OvsdbBridgeAugmentation>, OvsdbBridgeAugmentation> originals) { for (InstanceIdentifier<OvsdbBridgeAugmentation> ovsdbManagedNodeIid: removed) { LOG.debug("Received request to delete ovsdb node : {}", ovsdbManagedNodeIid); OvsdbBridgeAugmentation original = originals.get(ovsdbManagedNodeIid); Bridge bridge = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), Bridge.class,null); Optional<OvsdbBridgeAugmentation> ovsdbAugmentationOptional = state .getOvsdbBridgeAugmentation(ovsdbManagedNodeIid); if (ovsdbAugmentationOptional.isPresent() && ovsdbAugmentationOptional.get().getBridgeUuid() != null) { UUID bridgeUuid = new UUID(ovsdbAugmentationOptional.get().getBridgeUuid().getValue()); OpenVSwitch ovs = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), OpenVSwitch.class,null); transaction.add(op.delete(bridge.getSchema()) .where(bridge.getUuidColumn().getSchema().opEqual(bridgeUuid)).build()); transaction.add(op.comment("Bridge: Deleting " + original.getBridgeName())); transaction.add(op.mutate(ovs.getSchema()) .addMutation(ovs.getBridgesColumn().getSchema(), Mutator.DELETE, Sets.newHashSet(bridgeUuid))); transaction.add(op.comment("Open_vSwitch: Mutating " + original.getBridgeName() + " " + bridgeUuid)); LOG.info("Bridge Deleted: {}", ovsdbManagedNodeIid); } else { LOG.warn("Unable to delete bridge {} because it was not found in the operational store, " + "and thus we cannot retrieve its UUID", ovsdbManagedNodeIid); } } } }
bridge.getControllerColumn().getData()) .where(bridge.getNameColumn().getSchema().opEqual(bridge.getNameColumn().getData())) .build());
private void processDeleteTransaction(OvsdbClient client, String databaseName, String childTable, String parentTable, String parentColumn, String uuid, TransactionBuilder transactionBuilder) { DatabaseSchema dbSchema = client.getDatabaseSchema(databaseName); TableSchema<GenericTableSchema> childTableSchema = dbSchema.table(childTable, GenericTableSchema.class); if (parentColumn != null) { TableSchema<GenericTableSchema> parentTableSchema = dbSchema.table(parentTable, GenericTableSchema.class); ColumnSchema<GenericTableSchema, UUID> parentColumnSchema = parentTableSchema.column(parentColumn, UUID.class); transactionBuilder .add(op.mutate(parentTableSchema) .addMutation(parentColumnSchema, Mutator.DELETE, new UUID(uuid)) .where(parentColumnSchema.opIncludes(new UUID(uuid))) .build()); } ColumnSchema<GenericTableSchema, UUID> _uuid = childTableSchema.column("_uuid", UUID.class); transactionBuilder.add(op.delete(childTableSchema) .where(_uuid.opEqual(new UUID(uuid))) .build()); }
.where(port.getUuidColumn().getSchema().opEqual(portUuid)).build()); transaction.add(op.comment("Port: Deleting " + original.getName() + " attached to " + bridgeName)); .addMutation(bridge.getPortsColumn().getSchema(), Mutator.DELETE, Sets.newHashSet(portUuid)) .where(bridge.getNameColumn().getSchema().opEqual(bridgeName)).build());
extraQueue.getUuidColumn().setData(uuid); transaction.add(op.update(queue) .where(extraQueue.getUuidColumn().getSchema().opEqual(uuid)).build()); LOG.info("Updated queue entries: {} for Ovsdb Node : {}", queue, operNode);
transaction.add(op.update(ovsInterface) .where(extraInterface.getNameColumn().getSchema().opEqual(terminationPoint.getName())) .build()); transaction.add(op.update(port) .where(extraPort.getNameColumn().getSchema().opEqual(terminationPoint.getName())) .build()); LOG.info("Updated Termination Point : {} with Uuid : {}", terminationPoint.getName(), terminationPoint.getPortUuid());
Mutator.INSERT, bridge.getPortsColumn().getData()) .where(bridge.getNameColumn().getSchema() .opEqual(bridge.getNameColumn().getData())).build());