@Override public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) { delegateWriteTx.put(store, path, data); }
private CheckedFuture<Void, TransactionCommitFailedException> deleteDataViaTransaction( final DOMDataWriteTransaction writeTransaction, final LogicalDatastoreType datastore, final YangInstanceIdentifier path) { LOG.trace("Delete " + datastore.name() + " via Restconf: {}", path); writeTransaction.delete(datastore, path); return writeTransaction.submit(); }
@Override public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) { delegateWriteTx.merge(store, path, data); }
private void markTableUptodated(final TablesKey tableTypes) { final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); final TableContext ctxPre = this.tables.get(tableTypes); tx.merge(LogicalDatastoreType.OPERATIONAL, ctxPre.getTableId().node(BMP_ATTRIBUTES_QNAME).node(ATTRIBUTES_UPTODATE_TRUE.getNodeType()), ATTRIBUTES_UPTODATE_TRUE); tx.submit(); } }
@Override public Set<NetconfOperation> getNetconfOperations() { TransactionProvider transactionProvider = new TransactionProvider(dataBroker, String.valueOf(currentSessionId)); CurrentSchemaContext currentSchemaContext = new CurrentSchemaContext(schemaService); ContainerNode netconf = createNetconfState(); YangInstanceIdentifier yangInstanceIdentifier = YangInstanceIdentifier.builder().node(NetconfState.QNAME) .build(); final DOMDataWriteTransaction tx = dataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.OPERATIONAL, yangInstanceIdentifier, netconf); try { tx.submit().checkedGet(); LOG.debug("Netconf state updated successfully"); } catch (TransactionCommitFailedException e) { LOG.warn("Unable to update netconf state", e); } final Get get = new Get(String.valueOf(currentSessionId), currentSchemaContext, transactionProvider); final EditConfig editConfig = new EditConfig(String.valueOf(currentSessionId), currentSchemaContext, transactionProvider); final GetConfig getConfig = new GetConfig(String.valueOf(currentSessionId), currentSchemaContext, transactionProvider); final Commit commit = new Commit(String.valueOf(currentSessionId), transactionProvider); final Lock lock = new Lock(String.valueOf(currentSessionId)); final Unlock unLock = new Unlock(String.valueOf(currentSessionId)); final DiscardChanges discardChanges = new DiscardChanges(String.valueOf(currentSessionId), transactionProvider); return Sets.<NetconfOperation>newHashSet(get, getConfig, editConfig, commit, lock, unLock, discardChanges); }
case DELETE: LOG.trace("App peer -> AdjRibsIn path delete: {}", childIdentifier); tx.delete(LogicalDatastoreType.OPERATIONAL, tableId); break; case UNMODIFIED: LOG.trace("App peer -> AdjRibsIn path : {}", tableId); LOG.trace("App peer -> AdjRibsIn data : {}", dataAfter); tx.put(LogicalDatastoreType.OPERATIONAL, tableId, dataAfter); tx.submit();
tx.merge(LogicalDatastoreType.CONFIGURATION, yid, men); masterSubMap.put(sub_id, node_name); break; case delete: tx.delete(LogicalDatastoreType.CONFIGURATION, yid); masterSubMap.remove(sub_id, node_name); break; case update: tx.merge(LogicalDatastoreType.CONFIGURATION, yid, men); masterSubMap.put(sub_id, node_name); break; tx.submit().checkedGet(); } catch (TransactionCommitFailedException e) { e.printStackTrace();
@Override public CheckedFuture<Void, TransactionCommitFailedException> submit() { return delegateWriteTx.submit(); }
@Override public void delete(final LogicalDatastoreType store, final YangInstanceIdentifier path) { delegateWriteTx.delete(store, path); }
case DELETE: LOG.trace("App peer -> AdjRibsIn path delete: {}", childIdentifier); tx.delete(LogicalDatastoreType.OPERATIONAL, childIdentifier); break; case UNMODIFIED: LOG.trace("App peer -> AdjRibsIn path : {}", childIdentifier); LOG.trace("App peer -> AdjRibsIn data : {}", dataAfter); tx.put(LogicalDatastoreType.OPERATIONAL, childIdentifier, dataAfter);
@Override public boolean cancel() { return delegateWriteTx.cancel(); }
@Override public void onFailure(Throwable t) { LOG.error("Tx: {} Error during Abort.", transaction.getIdentifier(), t); // Propagate the original exception as that is what caused the Tx to fail and is // what's interesting to the client. clientSubmitFuture.setException(clientException); } }, MoreExecutors.directExecutor());
@Override public ListenableFuture<RpcResult<TransactionStatus>> commit() { return delegateWriteTx.commit(); }
void markTableUptodate(final TablesKey tableTypes) { final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); final TableContext ctx = this.tables.get(tableTypes); tx.merge(LogicalDatastoreType.OPERATIONAL, ctx.getTableId().node(Attributes.QNAME).node(ATTRIBUTES_UPTODATE_TRUE.getNodeType()), ATTRIBUTES_UPTODATE_TRUE); tx.submit(); }
tx.put(LogicalDatastoreType.CONFIGURATION, yid, element); } else { tx.merge(LogicalDatastoreType.CONFIGURATION, yid, element); tx.submit().checkedGet(); txOk++; } catch (TransactionCommitFailedException e) { tx.submit().checkedGet(); } catch (TransactionCommitFailedException e) { LOG.error("Transaction failed", e);
private void createRouterEntry() { Preconditions.checkState(isDatastoreWritable()); final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, this.routerYangIId, Builders.mapEntryBuilder() .withNodeIdentifier(new NodeIdentifierWithPredicates(Router.QNAME, ROUTER_ID_QNAME, this.routerIp)) .withChild(ImmutableNodes.leafNode(ROUTER_ID_QNAME, routerIp)) .withChild(ImmutableNodes.leafNode(ROUTER_STATUS_QNAME, DOWN)) .withChild(ImmutableNodes.mapNodeBuilder(Peer.QNAME).build()).build()); wTx.submit(); }
protected final CheckedFuture<Void,TransactionCommitFailedException> doSubmit() { return getDelegate().submit(); }
void removeTable(final DOMDataWriteTransaction tx) { tx.delete(LogicalDatastoreType.OPERATIONAL, this.tableId); }
case DELETE: case DISAPPEARED: tx.delete(LogicalDatastoreType.OPERATIONAL, routeId); LOG.debug("Route deleted. routeId={}", routeId); case SUBTREE_MODIFIED: case WRITE: tx.put(LogicalDatastoreType.OPERATIONAL, routeId, route.getDataAfter().get()); tx.put(LogicalDatastoreType.OPERATIONAL, routeId.node(ribSupport.routeAttributesIdentifier()), effectiveAttrs); tx.delete(LogicalDatastoreType.OPERATIONAL, routeId);