@Test public void testOnDelete() throws Exception { ForwardingByTenant forwardingByTenant = new ForwardingByTenantBuilder().setTenantId(TENANT_ID_1).build(); InstanceIdentifier<ForwardingByTenant> forwardingByTenantIid = IidFactory.forwardingByTenantIid(TENANT_ID_1); WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, forwardingByTenantIid, forwardingByTenant); wTx.submit().get(); ReadOnlyTransaction rTx = getDataBroker().newReadOnlyTransaction(); Optional<ForwardingByTenant> potenatialFwdByTenant = rTx.read(LogicalDatastoreType.OPERATIONAL, forwardingByTenantIid).get(); Assert.assertTrue(potenatialFwdByTenant.isPresent()); fwdResolver.onDelete(null, forwardingByTenantIid); rTx = getDataBroker().newReadOnlyTransaction(); potenatialFwdByTenant = rTx.read(LogicalDatastoreType.OPERATIONAL, forwardingByTenantIid).get(); Assert.assertFalse(potenatialFwdByTenant.isPresent()); }
@Override protected void onDelete(DataObjectModification<ForwardingByTenant> rootNode, InstanceIdentifier<ForwardingByTenant> rootIdentifier) { WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, rootIdentifier); wTx.submit(); }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @Override protected void onDelete(DataObjectModification<ForwardingByTenant> rootNode, InstanceIdentifier<ForwardingByTenant> rootIdentifier) { WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, rootIdentifier); wTx.submit(); } }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @Override protected void onDelete(DataObjectModification<ForwardingByTenant> rootNode, InstanceIdentifier<ForwardingByTenant> rootIdentifier) { WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, rootIdentifier); wTx.submit(); } ForwardingResolver(DataBroker dataProvider); }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @Override protected void onDelete(DataObjectModification<ForwardingByTenant> rootNode, InstanceIdentifier<ForwardingByTenant> rootIdentifier) { WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, rootIdentifier); wTx.submit(); } ForwardingResolver(DataBroker dataProvider);  }
ForwardingResolver extends DataTreeChangeHandler<ForwardingByTenant> { @Override protected void onDelete(DataObjectModification<ForwardingByTenant> rootNode, InstanceIdentifier<ForwardingByTenant> rootIdentifier) { WriteTransaction wTx = dataProvider.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, rootIdentifier); wTx.submit(); } ForwardingResolver(DataBroker dataProvider);   }