@Test public void testUpdateFilter() throws Exception { List<MasterDatabaseBinding> masterDatabaseBindings = new ArrayList<>(); masterDatabaseBindings.add(getMasterDatabaseBinding("1.1.1.1/32", 1)); masterDatabaseBindings.add(getMasterDatabaseBinding("2.2.2.2/32", 2)); masterDatabaseBindings.add(getMasterDatabaseBinding("3.3.3.3/32", 3)); masterDatabaseBindings.add(getMasterDatabaseBinding("4.4.4.4/32", 4)); masterDatabaseBindings.add(getMasterDatabaseBinding("5.5.5.5/32", 5)); masterDatabaseBindings.add(getMasterDatabaseBinding("6.6.6.6/32", 6)); when(masterDatabase.getBindings(eq(BindingOriginsConfig.LOCAL_ORIGIN))).thenReturn(masterDatabaseBindings); SxpDatabaseInf sxpDatabase = mock(SxpDatabaseImpl.class); MasterDatabaseInf masterDatabase = mock(MasterDatabaseImpl.class); ArgumentCaptor<List<MasterDatabaseBinding>> captorAdd = ArgumentCaptor.forClass((Class) List.class), captorDell = ArgumentCaptor.forClass((Class) List.class); when(masterDatabase.addBindings(captorAdd.capture())).thenReturn(new ArrayList<>()); when(masterDatabase.deleteBindings(captorDell.capture())).thenReturn(new ArrayList<>()); domains.add(SxpDomain.createInstance(sxpNode, "testDomain", sxpDatabase, masterDatabase)); when(sxpNode.getDomains()).thenReturn(domains); SxpConnection dummyConnection = getSxpConnection("127.0.0.254"); domain.putConnection(dummyConnection); SxpBindingFilter<?, ? extends SxpDomainFilterFields> bindingFilter = SxpBindingFilter.generateFilter( getDomainFilter(domain.getName(), "testDomain", FilterEntryType.Permit, 1, 2, 3, 4, 5), domain.getName()); domain.addFilter(bindingFilter); assertEquals(5, captorAdd.getAllValues().get(captorAdd.getAllValues().size() - 1).size()); bindingFilter = SxpBindingFilter.generateFilter( getDomainFilter(domain.getName(), "testDomain", FilterEntryType.Permit, 1, 3, 5), domain.getName()); domain.updateFilter(bindingFilter); assertEquals(0, captorAdd.getAllValues().get(captorAdd.getAllValues().size() - 1).size()); assertEquals(2, captorDell.getAllValues().get(captorDell.getAllValues().size() - 1).size()); bindingFilter = SxpBindingFilter.generateFilter( getDomainFilter(domain.getName(), "testDomain", FilterEntryType.Permit, 1, 4), domain.getName()); domain.updateFilter(bindingFilter); assertEquals(1, captorAdd.getAllValues().get(captorAdd.getAllValues().size() - 1).size()); assertEquals(2, captorDell.getAllValues().get(captorDell.getAllValues().size() - 1).size()); bindingFilter = SxpBindingFilter.generateFilter( getDomainFilter(domain.getName(), "anotherDomain", FilterEntryType.Permit, 1, 4), domain.getName()); domain.updateFilter(bindingFilter); assertEquals(0, captorAdd.getAllValues().get(captorAdd.getAllValues().size() - 1).size()); assertEquals(2, captorDell.getAllValues().get(captorDell.getAllValues().size() - 1).size()); bindingFilter = SxpBindingFilter.generateFilter( getDomainFilter(domain.getName(), "testDomain", FilterEntryType.Permit, 1, 4), domain.getName()); domain.updateFilter(bindingFilter); assertEquals(0, captorAdd.getAllValues().get(captorAdd.getAllValues().size() - 1).size()); assertEquals(2, captorDell.getAllValues().get(captorDell.getAllValues().size() - 1).size()); }
public boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter) { checkFilter(newFilter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> oldFilter; synchronized (filters) { oldFilter = filters.get(newFilter.getSxpFilter().getFilterSpecific()) .get(newFilter.getSxpFilter().getFilterName()); if (Objects.nonNull(oldFilter)) { filters.get(newFilter.getSxpFilter().getFilterSpecific()) .put(newFilter.getSxpFilter().getFilterName(), newFilter); } } if (Objects.isNull(oldFilter)) { return addFilter(newFilter); } final List<SxpDomain> domains = node.getDomains().stream().filter(d -> !d.getName().equals(getName())).collect(Collectors.toList()); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); return true; }
SxpDomain implements AutoCloseable { public boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter) { checkFilter(newFilter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> oldFilter; synchronized (filters) { oldFilter = filters.get(newFilter.getSxpFilter().getFilterSpecific()) .get(newFilter.getSxpFilter().getFilterName()); if (Objects.nonNull(oldFilter)) { filters.get(newFilter.getSxpFilter().getFilterSpecific()) .put(newFilter.getSxpFilter().getFilterName(), newFilter); } } if (Objects.isNull(oldFilter)) { return addFilter(newFilter); } final List<SxpDomain> domains = node.getDomains().stream().filter(d -> !d.getName().equals(getName())).collect(Collectors.toList()); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); return true; } }
SxpDomain implements AutoCloseable { public boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter) { checkFilter(newFilter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> oldFilter; synchronized (filters) { oldFilter = filters.get(newFilter.getSxpFilter().getFilterSpecific()) .get(newFilter.getSxpFilter().getFilterName()); if (Objects.nonNull(oldFilter)) { filters.get(newFilter.getSxpFilter().getFilterSpecific()) .put(newFilter.getSxpFilter().getFilterName(), newFilter); } } if (Objects.isNull(oldFilter)) { return addFilter(newFilter); } final List<SxpDomain> domains = node.getDomains().stream().filter(d -> !d.getName().equals(getName())).collect(Collectors.toList()); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); return true; } private  SxpDomain(SxpNode owner, String name, SxpDatabaseInf sxpDatabase, MasterDatabaseInf masterDatabase); }
SxpDomain implements AutoCloseable { public boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter) { checkFilter(newFilter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> oldFilter; synchronized (filters) { oldFilter = filters.get(newFilter.getSxpFilter().getFilterSpecific()) .get(newFilter.getSxpFilter().getFilterName()); if (Objects.nonNull(oldFilter)) { filters.get(newFilter.getSxpFilter().getFilterSpecific()) .put(newFilter.getSxpFilter().getFilterName(), newFilter); } } if (Objects.isNull(oldFilter)) { return addFilter(newFilter); } final List<SxpDomain> domains = node.getDomains().stream().filter(d -> !d.getName().equals(getName())).collect(Collectors.toList()); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); return true; } private  SxpDomain(SxpNode owner, String name, SxpDatabaseInf sxpDatabase, MasterDatabaseInf masterDatabase); static SxpDomain createInstance(SxpNode owner, String name, SxpDatabaseInf sxpDatabase,
            MasterDatabaseInf masterDatabase); static SxpDomain createInstance(SxpNode owner,
                                           org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain,
                                           MasterDatabaseInf masterDB,
                                           SxpDatabaseInf sxpDB); static SxpDomain createInstance(SxpNode owner,
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain); Map<String, SxpBindingFilter<?, ? extends SxpDomainFilterFields>> getFilters(); boolean addFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> filter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> removeFilter(FilterSpecific specific, String name); boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter); void pushToSharedMasterDatabases(final List<T> removed, final List<T> added); void pushToSharedSxpDatabases(NodeId nodeIdRemote, SxpBindingFilter<?, ? extends SxpFilterFields> sxpFilter,
            List<SxpDatabaseBinding> removed, List<SxpDatabaseBinding> added); MasterDatabaseInf getMasterDatabase(); SxpDatabaseInf getSxpDatabase(); String getName(); List<SxpConnection> getConnections(); SxpConnection getConnection(InetSocketAddress address); boolean addConnectionTemplate(T template); SxpConnectionTemplateFields removeConnectionTemplate(IpPrefix templatePrefix); SxpConnectionTemplateFields getTemplate(InetSocketAddress address); Collection<SxpConnectionTemplateFields> getConnectionTemplates(); boolean hasConnection(InetSocketAddress address); SxpConnection putConnection(SxpConnection connection); SxpConnection removeConnection(InetSocketAddress address); @Override void close(); }
SxpDomain implements AutoCloseable { public boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter) { checkFilter(newFilter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> oldFilter; synchronized (filters) { oldFilter = filters.get(newFilter.getSxpFilter().getFilterSpecific()) .get(newFilter.getSxpFilter().getFilterName()); if (Objects.nonNull(oldFilter)) { filters.get(newFilter.getSxpFilter().getFilterSpecific()) .put(newFilter.getSxpFilter().getFilterName(), newFilter); } } if (Objects.isNull(oldFilter)) { return addFilter(newFilter); } final List<SxpDomain> domains = node.getDomains().stream().filter(d -> !d.getName().equals(getName())).collect(Collectors.toList()); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> oldFilter.test(b) && !newFilter.test(b)) .collect(Collectors.toList()), getSxpDatabase().getBindings(c.getId()) .stream() .filter(b -> !oldFilter.test(b) && newFilter.test(b)) .collect(Collectors.toList()), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); domains.stream() .filter(d -> oldFilter.getSxpFilter() .getDomains() .getDomain() .stream() .noneMatch(filter_d -> filter_d.getName().equals(d.getName())) && newFilter.getSxpFilter() .getDomains() .getDomain() .stream() .anyMatch(filter_d -> filter_d.getName().equals(d.getName()))) .forEach(domain -> { propagateToSharedMasterDatabases(getMasterDatabase().getBindings(BindingOriginsConfig.LOCAL_ORIGIN) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain); getConnections().stream().filter(SxpConnection::isModeListener).forEach(c -> { propagateToSharedSxpDatabases(getSxpDatabase().getBindings(c.getId()) .stream() .filter(oldFilter) .collect(Collectors.toList()), Collections.emptyList(), domain, c.getId(), c.getFilter(FilterType.Inbound)); }); }); return true; } private  SxpDomain(SxpNode owner, String name, SxpDatabaseInf sxpDatabase, MasterDatabaseInf masterDatabase); static SxpDomain createInstance(SxpNode owner, String name, SxpDatabaseInf sxpDatabase,
            MasterDatabaseInf masterDatabase); static SxpDomain createInstance(SxpNode owner,
                                           org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain,
                                           MasterDatabaseInf masterDB,
                                           SxpDatabaseInf sxpDB); static SxpDomain createInstance(SxpNode owner,
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain); Map<String, SxpBindingFilter<?, ? extends SxpDomainFilterFields>> getFilters(); boolean addFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> filter); SxpBindingFilter<?, ? extends SxpDomainFilterFields> removeFilter(FilterSpecific specific, String name); boolean updateFilter(SxpBindingFilter<?, ? extends SxpDomainFilterFields> newFilter); void pushToSharedMasterDatabases(final List<T> removed, final List<T> added); void pushToSharedSxpDatabases(NodeId nodeIdRemote, SxpBindingFilter<?, ? extends SxpFilterFields> sxpFilter,
            List<SxpDatabaseBinding> removed, List<SxpDatabaseBinding> added); MasterDatabaseInf getMasterDatabase(); SxpDatabaseInf getSxpDatabase(); String getName(); List<SxpConnection> getConnections(); SxpConnection getConnection(InetSocketAddress address); boolean addConnectionTemplate(T template); SxpConnectionTemplateFields removeConnectionTemplate(IpPrefix templatePrefix); SxpConnectionTemplateFields getTemplate(InetSocketAddress address); Collection<SxpConnectionTemplateFields> getConnectionTemplates(); boolean hasConnection(InetSocketAddress address); SxpConnection putConnection(SxpConnection connection); SxpConnection removeConnection(InetSocketAddress address); @Override void close();  }