@Test public void testGetReplaceForBindings() throws Exception { 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"))); sxpConnections.add(mockConnection("10.10.10.10")); sxpConnections.add(mockConnection("20.20.20.20")); sxpConnections.add(mockConnection("30.30.30.30")); database.deleteBindings(NodeId.getDefaultInstance("10.10.10.10"), mergeBindings(getBinding("2.2.2.2/32", 200))); assertBindings(SxpDatabase.getReplaceForBindings(mergeBindings(), database, SxpDatabase.getInboundFilters(node, "global")), mergeBindings()); assertBindings(SxpDatabase.getReplaceForBindings(mergeBindings(getBinding("2.2.2.2/32", 200)), database, SxpDatabase.getInboundFilters(node, "global")), mergeBindings(getBinding("2.2.2.2/32", 20))); database.deleteBindings(NodeId.getDefaultInstance("20.20.20.20"), mergeBindings(getBinding("2.2.2.2/32", 20))); assertBindings(SxpDatabase.getReplaceForBindings(mergeBindings(getBinding("2.2.2.2/32", 20)), database, SxpDatabase.getInboundFilters(node, "global")), mergeBindings(getBinding("2.2.2.2/32", 200))); assertBindings(SxpDatabase.getReplaceForBindings(mergeBindings(getBinding("2.2.2.2/32", 254)), database, SxpDatabase.getInboundFilters(node, "global")), mergeBindings(getBinding("2.2.2.2/32", 200))); assertBindings(SxpDatabase.getReplaceForBindings(mergeBindings(getBinding("25.2.2.2/32", 20)), database, SxpDatabase.getInboundFilters(node, "global")), mergeBindings()); }
@Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return this.bindings.get(bindingType).remove(nodeId) != null; }
SxpDatabaseImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return this.bindings.get(bindingType).remove(nodeId) != null; } }
SxpDatabaseImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return this.bindings.get(bindingType).remove(nodeId) != null; } SxpDatabaseImpl(); }
SxpDatabaseImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return this.bindings.get(bindingType).remove(nodeId) != null; } SxpDatabaseImpl(); @Override void close(); }
SxpDatabaseImpl extends org.opendaylight.sxp.util.database.SxpDatabase { @Override protected boolean deleteBindings(NodeId nodeId, BindingDatabase.BindingType bindingType) { return this.bindings.get(bindingType).remove(nodeId) != null; } SxpDatabaseImpl(); @Override void close();  }