@Test public void testDeleteNullBindings() { assertTrue(database.deleteBindings(null).isEmpty()); }
@Override public synchronized <T extends SxpBindingFields> List<MasterDatabaseBinding> deleteBindings(List<T> bindings) { List<MasterDatabaseBinding> removed = new ArrayList<>(); if (bindings == null) { return removed; } bindings.forEach(inputBinding -> { MasterDatabaseBinding storedBinding = bindingMap.get(inputBinding.getIpPrefix()); if (storedBinding != null && equalsBySgt(storedBinding, inputBinding)) { removed.add(bindingMap.remove(inputBinding.getIpPrefix())); } }); dbListener.onBindingsRemoved(removed); return removed; }
MasterDatabaseImpl extends MasterDatabase { @Override public synchronized <T extends SxpBindingFields> List<MasterDatabaseBinding> deleteBindings(List<T> bindings) { List<MasterDatabaseBinding> removed = new ArrayList<>(); if (bindings == null) { return removed; } bindings.forEach(inputBinding -> { MasterDatabaseBinding storedBinding = bindingMap.get(inputBinding.getIpPrefix()); if (storedBinding != null && equalsBySgt(storedBinding, inputBinding)) { removed.add(bindingMap.remove(inputBinding.getIpPrefix())); } }); dbListener.onBindingsRemoved(removed); return removed; } }
MasterDatabaseImpl extends MasterDatabase { @Override public synchronized <T extends SxpBindingFields> List<MasterDatabaseBinding> deleteBindings(List<T> bindings) { List<MasterDatabaseBinding> removed = new ArrayList<>(); if (bindings == null) { return removed; } bindings.forEach(inputBinding -> { MasterDatabaseBinding storedBinding = bindingMap.get(inputBinding.getIpPrefix()); if (storedBinding != null && equalsBySgt(storedBinding, inputBinding)) { removed.add(bindingMap.remove(inputBinding.getIpPrefix())); } }); dbListener.onBindingsRemoved(removed); return removed; }  }
MasterDatabaseImpl extends MasterDatabase { @Override public synchronized <T extends SxpBindingFields> List<MasterDatabaseBinding> deleteBindings(List<T> bindings) { List<MasterDatabaseBinding> removed = new ArrayList<>(); if (bindings == null) { return removed; } bindings.forEach(inputBinding -> { MasterDatabaseBinding storedBinding = bindingMap.get(inputBinding.getIpPrefix()); if (storedBinding != null && equalsBySgt(storedBinding, inputBinding)) { removed.add(bindingMap.remove(inputBinding.getIpPrefix())); } }); dbListener.onBindingsRemoved(removed); return removed; }  @Override void initDBPropagatingListener(BindingDispatcher dispatcher, SxpDomain domain); @Override synchronized List<MasterDatabaseBinding> addBindings(List<T> bindings); @Override synchronized List<MasterDatabaseBinding> getBindings(); @Override synchronized List<MasterDatabaseBinding> getBindings(OriginType origin); @Override synchronized List<MasterDatabaseBinding> deleteBindings(List<T> bindings); @Override void close(); }
MasterDatabaseImpl extends MasterDatabase { @Override public synchronized <T extends SxpBindingFields> List<MasterDatabaseBinding> deleteBindings(List<T> bindings) { List<MasterDatabaseBinding> removed = new ArrayList<>(); if (bindings == null) { return removed; } bindings.forEach(inputBinding -> { MasterDatabaseBinding storedBinding = bindingMap.get(inputBinding.getIpPrefix()); if (storedBinding != null && equalsBySgt(storedBinding, inputBinding)) { removed.add(bindingMap.remove(inputBinding.getIpPrefix())); } }); dbListener.onBindingsRemoved(removed); return removed; }  @Override void initDBPropagatingListener(BindingDispatcher dispatcher, SxpDomain domain); @Override synchronized List<MasterDatabaseBinding> addBindings(List<T> bindings); @Override synchronized List<MasterDatabaseBinding> getBindings(); @Override synchronized List<MasterDatabaseBinding> getBindings(OriginType origin); @Override synchronized List<MasterDatabaseBinding> deleteBindings(List<T> bindings); @Override void close();  }