/** * Wrapper method to executes put as a blocking transaction. * * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified * @param path {@link InstanceIdentifier} for path to read * @param data object of type D * @return the result of the request */ public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean put( final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) { if (NetvirtProvider.isMasterProviderInstance()) { return mdsalUtils.put(logicalDatastoreType,path, data); } return true; }
public boolean addOvsdbNode(final ConnectionInfo connectionInfo, long timeout) { boolean result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, createInstanceIdentifier(connectionInfo), createNode(connectionInfo)); if (timeout != 0) { try { Thread.sleep(timeout); } catch (InterruptedException e) { LOG.warn("Interrupted while waiting after adding OVSDB node {}", connectionInfoToString(connectionInfo), e); } } return result; }
private void updateMdsal(Hostconfig hostConfig, Action action) { boolean result; InstanceIdentifier<Hostconfig> hostConfigId; if (hostConfig == null) { return; } switch (action) { case ADD: case UPDATE: hostConfigId = createInstanceIdentifier(hostConfig); result = mdsalUtils.put(LogicalDatastoreType.OPERATIONAL, hostConfigId, hostConfig); LOG.trace("Add Node: result: {}", result); break; case DELETE: hostConfigId = createInstanceIdentifier(hostConfig); result = mdsalUtils.delete(LogicalDatastoreType.OPERATIONAL, hostConfigId); LOG.trace("Delete Node: result: {}", result); break; } }
tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build()); return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
public Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type, Map<String, String> options) { InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier( bridgeNode, portName); OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder(); tpAugmentationBuilder.setName(portName); if (type != null) { tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type)); } List<Options> optionsList = new ArrayList<>(); for (Map.Entry<String, String> entry : options.entrySet()) { OptionsBuilder optionsBuilder = new OptionsBuilder(); optionsBuilder.setKey(new OptionsKey(entry.getKey())); optionsBuilder.setOption(entry.getKey()); optionsBuilder.setValue(entry.getValue()); optionsList.add(optionsBuilder.build()); } tpAugmentationBuilder.setOptions(optionsList); TerminationPointBuilder tpBuilder = new TerminationPointBuilder(); tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid)); tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build()); /* TODO SB_MIGRATION should this be merge or mdsalUtils.put */ return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build()); }
public Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type) { InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName); OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder(); tpAugmentationBuilder.setName(portName); if (type != null) { tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type)); } TerminationPointBuilder tpBuilder = new TerminationPointBuilder(); tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid)); tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build()); return mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build()); }
result = mdsalUtils.put(LogicalDatastoreType.CONFIGURATION, bridgeIid, node); LOG.info("addBridge: result: {}", result); } else {