public static void deleteResource(Uuid cid, ResourceId rid, final WriteTransaction wx) { InstanceIdentifier<Resource> iid = getResourceIID(cid, rid); /* DO NOT submit because this might be just one step in a sequence of write operations */ wx.delete(LogicalDatastoreType.OPERATIONAL, iid); }
/** * Remove LSP from the database. * * @param ctx Message Context * @param id Revision-specific LSP identifier */ protected final synchronized void removeLsp(final MessageContext ctx, final L id) { final String name = this.lsps.remove(id); LOG.debug("LSP {} removed", name); ctx.trans.delete(LogicalDatastoreType.OPERATIONAL, lspIdentifier(name)); this.lspData.remove(name); }
@Override public void close() throws Exception { // When we close this service we need to shutdown our executor! executor.shutdown(); if (dataProvider != null) { WriteTransaction tx = dataProvider.newWriteOnlyTransaction(); LOG.info(" Transaction written"); tx.delete(LogicalDatastoreType.CONFIGURATION, alertMessageCountRuleRecordId); } }
@Override public void close() throws Exception { // When we close this service we need to shutdown our executor! executor.shutdown(); if (dataProvider != null) { WriteTransaction tx = dataProvider.newWriteOnlyTransaction(); LOG.info(" Transaction closed CentinelDashboardImpl"); tx.delete(LogicalDatastoreType.OPERATIONAL, dashboardRecordRecordId); } }
private <U extends org.opendaylight.yangtools.yang.binding.DataObject> void deleteTransaction( InstanceIdentifier<U> deleteIID, LogicalDatastoreType logicalDatastoreType, String errMsg) { WriteTransaction writeTx = txChain.newWriteOnlyTransaction(); writeTx.delete(logicalDatastoreType, deleteIID); Futures.addCallback(writeTx.submit(), new FutureCallback<Void>() { public void onSuccess(Void result) { } public void onFailure(Throwable throwable) { LOG.error("Transaction failed:", throwable); } }); }
private <T extends DataObject> void delete(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.delete(datastoreType, path); Futures.addCallback(tx.submit(), DEFAULT_CALLBACK); }
public static <T extends DataObject> void delete(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path, FutureCallback<Void> callback) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.delete(datastoreType, path); Futures.addCallback(tx.submit(), callback); }
private <T extends DataObject> void syncDelete(LogicalDatastoreType datastoreType, InstanceIdentifier<T> path) { WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); tx.delete(datastoreType, path); CheckedFuture<Void, TransactionCommitFailedException> futures = tx.submit(); try { futures.get(); } catch (InterruptedException | ExecutionException e) { LOG.error("Error deleting from datastore (path) : ({})", path); throw new RuntimeException(e.getMessage()); } }
public static <T extends DataObject> CheckedFuture<Void, TransactionCommitFailedException> delete(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> obj) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.delete(datastoreType, obj); CheckedFuture<Void, TransactionCommitFailedException> futures = tx.submit(); return futures; }
@Override public <T extends DataObject> ListenableFuture<Void> removeConfiguration( final InstanceIdentifier<T> identifier) { final WriteTransaction wTx = this.dataBroker.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.CONFIGURATION, identifier); return wTx.submit(); } }
static <T extends DataObject> void delete(DataBroker broker, LogicalDatastoreType datastoreType, InstanceIdentifier<T> path) { WriteTransaction tx = broker.newWriteOnlyTransaction(); tx.delete(datastoreType, path); tx.submit(); }
public void deactivated() { WriteTransaction transaction = dataBroker.newWriteOnlyTransaction(); transaction.delete(LogicalDatastoreType.OPERATIONAL, fcIid); try { transaction.submit().checkedGet(); LOG.debug("Forwarding construct activation state information deleted successfully"); } catch (TransactionCommitFailedException e) { LOG.warn("Error during forwarding construct activation state information deletion", e); } }
public static void removeVpnInstanceToVpnId(DataBroker broker, String vpnName, WriteTransaction writeTxn) { try { if (writeTxn != null) { writeTxn.delete(LogicalDatastoreType.CONFIGURATION, getVpnInstanceToVpnIdIdentifier(vpnName)); } else { delete(broker, LogicalDatastoreType.CONFIGURATION, getVpnInstanceToVpnIdIdentifier(vpnName), DEFAULT_CALLBACK); } } catch (Exception e) { LOG.error("Exception during clean up of VpnInstanceToVpnId for VPN {}", vpnName, e); } }
public static void removeVpnIdToVpnInstance(DataBroker broker, long vpnId, WriteTransaction writeTxn) { try { if (writeTxn != null) { writeTxn.delete(LogicalDatastoreType.CONFIGURATION, getVpnIdToVpnInstanceIdentifier(vpnId)); } else { delete(broker, LogicalDatastoreType.CONFIGURATION, getVpnIdToVpnInstanceIdentifier(vpnId), DEFAULT_CALLBACK); } } catch (Exception e) { LOG.error("Exception during clean up of VpnIdToVpnInstance for VPNID {}", vpnId, e); } }
private void removeMipAdjacency(String fixedip, String vpnName, String interfaceName, WriteTransaction tx) { synchronized (interfaceName.intern()) { InstanceIdentifier<VpnInterface> vpnIfId = VpnUtil.getVpnInterfaceIdentifier(interfaceName); InstanceIdentifier<Adjacencies> path = vpnIfId.augmentation(Adjacencies.class); Optional<Adjacencies> adjacencies = VpnUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, path); if (adjacencies.isPresent()) { InstanceIdentifier<Adjacency> adid = vpnIfId.augmentation(Adjacencies.class).child(Adjacency.class, new AdjacencyKey(iptoprefix(fixedip))); tx.delete(LogicalDatastoreType.CONFIGURATION, adid); LOG.info("deleting the adjacencies for vpn {} interface {}", vpnName, interfaceName); } } }
public static void removeVrfTable(DataBroker broker, String rd, WriteTransaction writeConfigTxn) { LOG.debug("Removing vrf table for rd {}", rd); InstanceIdentifier.InstanceIdentifierBuilder<VrfTables> idBuilder = InstanceIdentifier.builder(FibEntries.class).child(VrfTables.class, new VrfTablesKey(rd)); InstanceIdentifier<VrfTables> vrfTableId = idBuilder.build(); if (writeConfigTxn != null) { writeConfigTxn.delete(LogicalDatastoreType.CONFIGURATION, vrfTableId); } else { delete(broker, LogicalDatastoreType.CONFIGURATION, vrfTableId); } }
public void delData(String secKey) { LowwatermarkKey seclwmKey = new LowwatermarkKey(secKey); InstanceIdentifier<Lowwatermark> secLwmId = InstanceIdentifier.builder(LWM.class).child(Lowwatermark.class, seclwmKey).toInstance(); WriteTransaction writeTransaction = dataBroker.newWriteOnlyTransaction(); writeTransaction.delete(LogicalDatastoreType.OPERATIONAL, secLwmId); writeTransaction.commit(); LOG.debug("Data Store Entry is deleted for key ", secKey); }
@Override public void instructionRemoved() { final WriteTransaction t = ProgrammingServiceImpl.this.dataProvider.newWriteOnlyTransaction(); t.delete(LogicalDatastoreType.OPERATIONAL, ProgrammingServiceImpl.this.qid.child( org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.instruction.queue.Instruction.class, new InstructionKey(this.builder.getId()))); t.submit(); } }
public void removeVrf(int vrf) { WriteTransaction trans = databroker.newWriteOnlyTransaction(); String vrfId = createVrfId(vrf); InstanceIdentifier<Vrf> vrfIId = deviceIId.augmentation(FabricCapableDevice.class) .child(Config.class).child(Vrf.class, new VrfKey(vrfId)); trans.delete(LogicalDatastoreType.OPERATIONAL, vrfIId); MdSalUtils.wrapperSubmit(trans, executor); }
private void removeLink(final WriteTransaction trans, final UriBuilder base, final LinkCase l) { final LinkId id = buildLinkId(base, l); final InstanceIdentifier<?> lid = buildLinkIdentifier(id); trans.delete(LogicalDatastoreType.OPERATIONAL, lid); LOG.debug("Removed link {}", lid); removeTp(trans, buildNodeId(base, l.getLocalNodeDescriptors()), buildLocalTpId(base, l.getLinkDescriptors()), id, false); removeTp(trans, buildNodeId(base, l.getRemoteNodeDescriptors()), buildRemoteTpId(base, l.getLinkDescriptors()), id, true); }