@Override public CheckedFuture<Void, TransactionCommitFailedException> submit() { return delegateWriteTx.submit(); }
protected final CheckedFuture<Void,TransactionCommitFailedException> doSubmit() { return getDelegate().submit(); }
@Override public CheckedFuture<Void, TransactionCommitFailedException> submit() { return delegate().submit(); }
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(); }
private BmpRibInWriter(final YangInstanceIdentifier tablesRoot, final DOMTransactionChain chain, final RIBExtensionConsumerContext ribExtensions, final Set<TablesKey> tableTypes, final BindingCodecTree tree) { this.chain = chain; final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); this.tables = createTableInstance(tableTypes, tablesRoot, tx, ribExtensions, tree).build(); LOG.debug("New RIB table {} structure installed.", tablesRoot.toString()); tx.submit(); }
void removePeer() { if(this.peerPath != null) { final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); tx.delete(LogicalDatastoreType.OPERATIONAL, this.peerPath); try { tx.submit().checkedGet(); } catch (final TransactionCommitFailedException e) { LOG.debug("Failed to remove Peer {}", this.peerPath, e); } } }
void updateRoutes(final MpReachNlri nlri, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.path.attributes.Attributes attributes) { final TablesKey key = new TablesKey(nlri.getAfi(), nlri.getSafi()); final TableContext ctx = this.tables.get(key); if (ctx == null) { LOG.debug("No table for {}, not accepting NLRI {}", key, nlri); return; } final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); ctx.writeRoutes(tx, nlri, attributes); LOG.trace("Write routes {}", nlri); tx.submit(); }
private void removeRoutes(final MpUnreachNlri nlri) { final TablesKey key = new TablesKey(nlri.getAfi(), nlri.getSafi()); final TableContext ctx = this.tables.get(key); if (ctx == null) { LOG.debug("No table for {}, not accepting NLRI {}", key, nlri); return; } LOG.trace("Removing routes {}", nlri); final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); ctx.removeRoutes(tx, nlri); tx.submit(); }
void removeRoutes(final MpUnreachNlri nlri) { final TablesKey key = new TablesKey(nlri.getAfi(), nlri.getSafi()); final TableContext ctx = this.tables.get(key); if (ctx == null) { LOG.debug("No table for {}, not accepting NLRI {}", key, nlri); return; } LOG.trace("Removing routes {}", nlri); final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); ctx.removeRoutes(tx, nlri); tx.submit(); }
@Override public void close() throws Exception { this.channel.close().addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture channelFuture) throws Exception { BmpMonitoringStationImpl.this.sessionManager.close(); } }).await(); final DOMDataWriteTransaction wTx = this.domDataBroker.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, this.yangMonitorId); wTx.submit().checkedGet(); LOG.info("BMP monitoring station {} closed.", this.monitorId.getValue()); }
private void addRoutes(final MpReachNlri nlri, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang .bgp.message.rev130919.path.attributes.Attributes attributes) { final TablesKey key = new TablesKey(nlri.getAfi(), nlri.getSafi()); final TableContext ctx = this.tables.get(key); if (ctx == null) { LOG.debug("No table for {}, not accepting NLRI {}", key, nlri); return; } final DOMDataWriteTransaction tx = this.chain.newWriteOnlyTransaction(); ctx.writeRoutes(tx, nlri, attributes); LOG.trace("Write routes {}", nlri); tx.submit(); }
@Override public CheckedFuture<Void, TransactionCommitFailedException> submit() { if (AuthzServiceImpl.isAuthorized(ActionType.Submit)) { return domDataWriteTransaction.submit(); } TransactionCommitFailedException e = new TransactionCommitFailedException( "Unauthorized User"); return Futures.immediateFailedCheckedFuture(e); }
private void onPeerDown() { final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, this.peerYangIId); wTx.submit(); close(); }
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(); } }
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(); }
private void onRouteMirror(final RouteMirroringMessage mirror) { final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction(); wTx.merge(LogicalDatastoreType.OPERATIONAL, this.peerYangIId.node(Mirrors.QNAME), createMirrors(mirror, mirror.getPeerHeader().getTimestampSec())); wTx.submit(); }
private void onStatsReports(final StatsReportsMessage statsReports) { if (this.up) { final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction(); wTx.merge(LogicalDatastoreType.OPERATIONAL, this.peerYangIId.node(Stats.QNAME), createStats(statsReports, statsReports.getPeerHeader().getTimestampSec())); wTx.submit(); } }
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(); }
private void onInitiate(final InitiationMessage initiation) { Preconditions.checkState(isDatastoreWritable()); final DOMDataWriteTransaction wTx = this.domTxChain.newWriteOnlyTransaction(); wTx.merge(LogicalDatastoreType.OPERATIONAL, this.routerYangIId, Builders.mapEntryBuilder() .withNodeIdentifier(new NodeIdentifierWithPredicates(Router.QNAME, ROUTER_ID_QNAME, this.routerIp)) .withChild(ImmutableNodes.leafNode(ROUTER_NAME_QNAME, initiation.getTlvs().getNameTlv().getName())) .withChild(ImmutableNodes.leafNode(ROUTER_DESCRIPTION_QNAME, initiation.getTlvs().getDescriptionTlv().getDescription())) .withChild(ImmutableNodes.leafNode(ROUTER_INFO_QNAME, getStringInfo(initiation.getTlvs().getStringInformation()))) .withChild(ImmutableNodes.leafNode(ROUTER_STATUS_QNAME, UP)).build()); wTx.submit(); }
private void createEmptyMonitor() { final DOMDataWriteTransaction wTx = this.domDataBroker.newWriteOnlyTransaction(); ensureParentExists(wTx, YangInstanceIdentifier.of(BmpMonitor.QNAME)); wTx.put(LogicalDatastoreType.OPERATIONAL, YangInstanceIdentifier.builder().node(BmpMonitor.QNAME).node(Monitor.QNAME) .nodeWithKey(Monitor.QNAME, MONITOR_ID_QNAME, this.monitorId.getValue()).build(), ImmutableNodes.mapEntryBuilder(Monitor.QNAME, MONITOR_ID_QNAME, this.monitorId.getValue()) .addChild(ImmutableNodes.leafNode(MONITOR_ID_QNAME, this.monitorId.getValue())) .addChild(ImmutableNodes.mapNodeBuilder(Router.QNAME).build()) .build()); try { wTx.submit().checkedGet(); } catch (final TransactionCommitFailedException e) { LOG.error("Failed to initiate BMP Monitor {}.", this.monitorId.getValue(), e); } }