@Override public <T extends DataObject> void merge(LogicalDatastoreType store, InstanceIdentifier<T> path, T data, boolean createMissingParents) { delegate.merge(store, path, data, createMissingParents); }
/** * Update * @param addIID iid * @param data new value * @param logicalDatastoreType op vs config * @param <U> return value */ public <U extends org.opendaylight.yangtools.yang.binding.DataObject> void update // writeMerge (InstanceIdentifier<U> addIID, U data, LogicalDatastoreType logicalDatastoreType) { writeTx.merge(logicalDatastoreType, addIID, data, true); }
public void update(WriteTransaction tx, LogicalDatastoreType datastoreType, final InstanceIdentifier identifier, final Object original, final Object update) { if ((update != null) && !(update instanceof DataObject)) { return; } if (datastoreType != getDatastoreType()) { return; } tx.merge(datastoreType, identifier, (DataObject) update, true); }
@Override public void merge(LogicalDatastoreType type, InstanceIdentifier<DataObject> id, DataObject data, FutureCallback<Object> callback) { if (dataProvider == null) { LOG.error("Data Service is not initialized!"); return; } writeTransaction = dataProvider.newWriteOnlyTransaction(); writeTransaction.merge(type, id, data); Futures.addCallback(writeTransaction.submit(), callback); }
static <T extends DataObject> void asyncWrite(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data, FutureCallback<Void> callback) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.merge(datastoreType, path, data, true); Futures.addCallback(tx.submit(), callback); }
static <T extends DataObject> void asyncUpdate(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data, FutureCallback<Void> callback) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.merge(datastoreType, path, data, true); Futures.addCallback(tx.submit(), callback); }
public static <T extends DataObject> void asyncUpdate(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data, DataBroker broker, FutureCallback<Void> callback) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.merge(datastoreType, path, data, true); Futures.addCallback(tx.submit(), callback); }
private <T extends DataObject> void asyncWrite(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data, FutureCallback<Void> callback) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.merge(datastoreType, path, data, true); Futures.addCallback(tx.submit(), callback); }
public static <T extends DataObject> void syncUpdate(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.merge(datastoreType, path, data, true); CheckedFuture<Void, TransactionCommitFailedException> futures = tx.submit(); try { futures.get(); } catch (InterruptedException | ExecutionException e) { LOG.error("Error writing to datastore (path, data) : ({}, {})", path, data); throw new RuntimeException(e.getMessage()); } }
private void createNetworkTopologyIfNotPresent(final WriteTransaction writeTx) { final NetworkTopology networkTopology = new NetworkTopologyBuilder().build(); logger.trace("{}: Merging {} container to ensure its presence", id, networkTopology.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, networkTopologyPath, networkTopology); writeTx.merge(LogicalDatastoreType.OPERATIONAL, networkTopologyPath, networkTopology); final Topology topology = new TopologyBuilder().setTopologyId(new TopologyId(TopologyNetconf.QNAME.getLocalName())).build(); logger.trace("{}: Merging {} container to ensure its presence", id, topology.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, topologyListPath, topology); writeTx.merge(LogicalDatastoreType.OPERATIONAL, topologyListPath, topology); }
private ListenableFuture<Void> writeTableOffset(OfOverlayConfig ofc) { WriteTransaction wTx = dataBroker.newWriteOnlyTransaction(); wTx.merge(LogicalDatastoreType.CONFIGURATION, configIid, ofc, true); return wTx.submit(); }
static <T extends DataObject> void update(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, T data) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.merge(datastoreType, path, data, true); tx.submit(); }
private void createNodesListIfNotPresent(final WriteTransaction writeTx) { final Nodes nodes = new NodesBuilder().build(); final InstanceIdentifier<Nodes> path = InstanceIdentifier.builder(Nodes.class).build(); logger.trace("{}: Merging {} container to ensure its presence", id, Nodes.QNAME, writeTx.getIdentifier()); writeTx.merge(LogicalDatastoreType.CONFIGURATION, path, nodes); writeTx.merge(LogicalDatastoreType.OPERATIONAL, path, nodes); }
private void cpAcls(List<FabricAcl> acls, InstanceIdentifier<BdPort> bdPortIid, WriteTransaction trans) { BdPortBuilder bdportBuilder = new BdPortBuilder(); bdportBuilder.setFabricAcl(acls); trans.merge(LogicalDatastoreType.OPERATIONAL, bdPortIid, bdportBuilder.build()); }
private void createNetworkTopologyIfNotPresent(final WriteTransaction writeTx, final LogicalDatastoreType datastoreType) { final NetworkTopology networkTopology = new NetworkTopologyBuilder().build(); LOG.trace("{}: Merging {} container to ensure its presence", topologyId, NetworkTopology.QNAME, writeTx.getIdentifier()); writeTx.merge(datastoreType, networkTopologyPath, networkTopology); final Topology topology = new TopologyBuilder().setTopologyId(new TopologyId(topologyId)).build(); LOG.trace("{}: Merging {} container to ensure its presence", topologyId, Topology.QNAME, writeTx.getIdentifier()); writeTx.merge(datastoreType, topologyListPath, topology); } }
public static void lispUpdateServiceFunctionForwarder(ServiceFunctionForwarder sff) { LOG.debug("\n####### Start: {}", Thread.currentThread().getStackTrace()[1]); if (OpendaylightSfc.getOpendaylightSfcObj().getDataProvider() != null) { sff = LispUpdater.getLispUpdaterObj().updateLispData(sff); InstanceIdentifier<ServiceFunctionForwarder> sffEntryIID = InstanceIdentifier.builder(ServiceFunctionForwarders.class) .child(ServiceFunctionForwarder.class, sff.getKey()).build(); WriteTransaction writeTx = OpendaylightSfc.getOpendaylightSfcObj().getDataProvider().newWriteOnlyTransaction(); writeTx.merge(LogicalDatastoreType.CONFIGURATION, sffEntryIID, sff, true); writeTx.submit(); } LOG.debug("\n########## Stop: {}", Thread.currentThread().getStackTrace()[1]); }
public static void putNodeConnector(final InstanceIdentifier<Node> instance, final NodeConnector nodeConnector) { WriteTransaction transaction = OFSessionUtil.getSessionManager().getDataBroker().newWriteOnlyTransaction(); InstanceIdentifier<NodeConnector> nodeConnectorID = instance.child(NodeConnector.class, nodeConnector.getKey()); transaction.merge(LogicalDatastoreType.OPERATIONAL, nodeConnectorID, nodeConnector); transaction.submit(); }
private void initTopology(final WriteTransaction wtx, final LogicalDatastoreType datastoreType) { final NetworkTopology networkTopology = new NetworkTopologyBuilder().build(); final InstanceIdentifier<NetworkTopology> networkTopologyId = InstanceIdentifier.builder(NetworkTopology.class).build(); wtx.merge(datastoreType, networkTopologyId, networkTopology); final Topology topology = new TopologyBuilder().setTopologyId(new TopologyId(topologyId)).build(); wtx.merge(datastoreType, networkTopologyId.child(Topology.class, new TopologyKey(new TopologyId(topologyId))), topology); }
public static void scheduleVpnInterfaceForRemoval(DataBroker broker,String interfaceName, BigInteger dpnId, String vpnInstanceName, Boolean isScheduledToRemove, WriteTransaction writeOperTxn){ InstanceIdentifier<VpnInterface> interfaceId = VpnUtil.getVpnInterfaceIdentifier(interfaceName); VpnInterface interfaceToUpdate = new VpnInterfaceBuilder().setKey(new VpnInterfaceKey(interfaceName)).setName(interfaceName) .setDpnId(dpnId).setVpnInstanceName(vpnInstanceName).setScheduledForRemove(isScheduledToRemove).build(); if (writeOperTxn != null) { writeOperTxn.merge(LogicalDatastoreType.OPERATIONAL, interfaceId, interfaceToUpdate, true); } else { VpnUtil.syncUpdate(broker, LogicalDatastoreType.OPERATIONAL, interfaceId, interfaceToUpdate); } }
private static CheckedFuture<Void, TransactionCommitFailedException> initializeNetworkInstance(final DataBroker dataBroker, final InstanceIdentifier<NetworkInstance> networkInstance) { final WriteTransaction wTx = dataBroker.newWriteOnlyTransaction(); wTx.merge(LogicalDatastoreType.CONFIGURATION, networkInstance, new NetworkInstanceBuilder().setName(networkInstance.firstKeyOf(NetworkInstance.class).getName()).setProtocols(new ProtocolsBuilder().build()).build()); return wTx.submit(); }