@Test public void testDeleteBindings() throws Exception { assertEquals(0, database.deleteBindings(NodeId.getDefaultInstance("10.10.10.10")).size()); assertEquals(0, database.deleteBindings(NodeId.getDefaultInstance("10.10.10.10"), new ArrayList<>()).size()); database.addBinding(NodeId.getDefaultInstance("10.10.10.10"), mergeBindings(getBinding("0.0.0.0/0", 5, "10.10.10.10"), getBinding("2.2.2.2/32", 200, "10.10.10.10"), getBinding("1.1.1.1/32", 100, "10.10.10.10"))); database.addBinding(NodeId.getDefaultInstance("20.20.20.20"), mergeBindings(getBinding("2.2.2.2/32", 20, "20.20.20.20", "10.10.10.10"), getBinding("1.1.1.1/32", 10, "20.20.20.20"))); database.addBinding(NodeId.getDefaultInstance("30.30.30.30"), mergeBindings(getBinding("25.2.2.6/32", 20, "30.30.30.30", "20.20.20.20", "10.10.10.10"), getBinding("1.1.1.1/32", 10, "30.30.30.30"))); assertEquals(0, database.deleteBindings(NodeId.getDefaultInstance("10.10.10.10"), new ArrayList<>()).size()); assertEquals(2, database.deleteBindings(NodeId.getDefaultInstance("10.10.10.10")).size()); assertEquals(0, database.getBindings(NodeId.getDefaultInstance("10.10.10.10")).size()); assertEquals(1, database.deleteBindings(NodeId.getDefaultInstance("20.20.20.20"), mergeBindings(getBinding("1.1.1.1/32", 10, "20.20.20.20"))).size()); assertBindings(database.getBindings(NodeId.getDefaultInstance("20.20.20.20")), mergeBindings(getBinding("2.2.2.2/32", 20, "20.20.20.20", "10.10.10.10"))); assertBindings(database.getBindings(NodeId.getDefaultInstance("30.30.30.30")), mergeBindings(getBinding("25.2.2.6/32", 20, "30.30.30.30", "20.20.20.20", "10.10.10.10"), getBinding("1.1.1.1/32", 10, "30.30.30.30"))); }
@Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return datastoreAccess.checkAndDelete(getIdentifierBuilder(bindingType, nodeId).build(), LogicalDatastoreType.OPERATIONAL); }
SxpDatastoreImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return datastoreAccess.checkAndDelete(getIdentifierBuilder(bindingType, nodeId).build(), LogicalDatastoreType.OPERATIONAL); } }
SxpDatastoreImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return datastoreAccess.checkAndDelete(getIdentifierBuilder(bindingType, nodeId).build(), LogicalDatastoreType.OPERATIONAL); } SxpDatastoreImpl(DatastoreAccess datastoreAccess, String nodeId, String domain); }
SxpDatastoreImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return datastoreAccess.checkAndDelete(getIdentifierBuilder(bindingType, nodeId).build(), LogicalDatastoreType.OPERATIONAL); } SxpDatastoreImpl(DatastoreAccess datastoreAccess, String nodeId, String domain); DatastoreAccess getDatastoreAccess(); @Override void close(); }
SxpDatastoreImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return datastoreAccess.checkAndDelete(getIdentifierBuilder(bindingType, nodeId).build(), LogicalDatastoreType.OPERATIONAL); } SxpDatastoreImpl(DatastoreAccess datastoreAccess, String nodeId, String domain); DatastoreAccess getDatastoreAccess(); @Override void close();  }