@Test public void testUpdateFilterInPeerGroup() throws Exception { assertFalse(node.addPeerGroup(null)); assertTrue(node.getPeerGroups().isEmpty()); node.addPeerGroup(getGroup("TEST", null, null)); SxpFilter filter = getFilter(FilterType.Inbound); node.addFilterToPeerGroup("TEST", filter); assertEquals(1, node.getPeerGroup("TEST").getSxpFilter().size()); assertNull(node.updateFilterInPeerGroup(null, getFilter(FilterType.Outbound))); assertNull(node.updateFilterInPeerGroup("TEST", getFilter(FilterType.Outbound))); assertEquals(filter, node.updateFilterInPeerGroup("TEST", getFilter(FilterType.Inbound))); assertEquals(1, node.getPeerGroup("TEST").getSxpFilter().size()); }
public SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter) { synchronized (peerGroupMap) { SxpPeerGroupBuilder peerGroup = peerGroupMap.get(peerGroupName); if (peerGroup == null || newFilter == null) { LOG.warn("{} Cannot update Filter | Due to null parameters", this); return null; } List<SxpFilter> sxpFilters = peerGroup.getSxpFilter(); SxpFilter oldFilter = null; for (SxpFilter filter : sxpFilters) { if (SxpBindingFilter.checkInCompatibility(filter, newFilter)) { oldFilter = filter; break; } } if (oldFilter == null) { LOG.warn("{} Cannot update Filter | No previous filter with type {} found", this, newFilter.getFilterType()); return null; } sxpFilters.remove(oldFilter); sxpFilters.add(newFilter); SxpBindingFilter bindingFilter = SxpBindingFilter.generateFilter(newFilter, peerGroupName); List<SxpConnection> connections = getConnections(peerGroup); for (SxpConnection connection : connections) { connection.putFilter(bindingFilter); } return oldFilter; } }
SxpNode { public SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter) { synchronized (peerGroupMap) { SxpPeerGroupBuilder peerGroup = peerGroupMap.get(peerGroupName); if (peerGroup == null || newFilter == null) { LOG.warn("{} Cannot update Filter | Due to null parameters", this); return null; } List<SxpFilter> sxpFilters = peerGroup.getSxpFilter(); SxpFilter oldFilter = null; for (SxpFilter filter : sxpFilters) { if (SxpBindingFilter.checkInCompatibility(filter, newFilter)) { oldFilter = filter; break; } } if (oldFilter == null) { LOG.warn("{} Cannot update Filter | No previous filter with type {} found", this, newFilter.getFilterType()); return null; } sxpFilters.remove(oldFilter); sxpFilters.add(newFilter); SxpBindingFilter bindingFilter = SxpBindingFilter.generateFilter(newFilter, peerGroupName); List<SxpConnection> connections = getConnections(peerGroup); for (SxpConnection connection : connections) { connection.putFilter(bindingFilter); } return oldFilter; } } }
SxpNode { public SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter) { synchronized (peerGroupMap) { SxpPeerGroupBuilder peerGroup = peerGroupMap.get(peerGroupName); if (peerGroup == null || newFilter == null) { LOG.warn("{} Cannot update Filter | Due to null parameters", this); return null; } List<SxpFilter> sxpFilters = peerGroup.getSxpFilter(); SxpFilter oldFilter = null; for (SxpFilter filter : sxpFilters) { if (SxpBindingFilter.checkInCompatibility(filter, newFilter)) { oldFilter = filter; break; } } if (oldFilter == null) { LOG.warn("{} Cannot update Filter | No previous filter with type {} found", this, newFilter.getFilterType()); return null; } sxpFilters.remove(oldFilter); sxpFilters.add(newFilter); SxpBindingFilter bindingFilter = SxpBindingFilter.generateFilter(newFilter, peerGroupName); List<SxpConnection> connections = getConnections(peerGroup); for (SxpConnection connection : connections) { connection.putFilter(bindingFilter); } return oldFilter; } } protected  SxpNode(NodeId nodeId, SxpNodeIdentity node, ThreadsWorker worker); }
SxpNode { public SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter) { synchronized (peerGroupMap) { SxpPeerGroupBuilder peerGroup = peerGroupMap.get(peerGroupName); if (peerGroup == null || newFilter == null) { LOG.warn("{} Cannot update Filter | Due to null parameters", this); return null; } List<SxpFilter> sxpFilters = peerGroup.getSxpFilter(); SxpFilter oldFilter = null; for (SxpFilter filter : sxpFilters) { if (SxpBindingFilter.checkInCompatibility(filter, newFilter)) { oldFilter = filter; break; } } if (oldFilter == null) { LOG.warn("{} Cannot update Filter | No previous filter with type {} found", this, newFilter.getFilterType()); return null; } sxpFilters.remove(oldFilter); sxpFilters.add(newFilter); SxpBindingFilter bindingFilter = SxpBindingFilter.generateFilter(newFilter, peerGroupName); List<SxpConnection> connections = getConnections(peerGroup); for (SxpConnection connection : connections) { connection.putFilter(bindingFilter); } return oldFilter; } } protected  SxpNode(NodeId nodeId, SxpNodeIdentity node, ThreadsWorker worker); static SxpNode createInstance(NodeId nodeId, SxpNodeIdentity node); static SxpNode createInstance(NodeId nodeId, SxpNodeIdentity node, MasterDatabaseInf masterDatabase,
            SxpDatabaseInf sxpDatabase); static SxpNode createInstance(NodeId nodeId, SxpNodeIdentity node, MasterDatabaseInf masterDatabase,
            SxpDatabaseInf sxpDatabase, ThreadsWorker worker); SxpConnection addConnection(SxpConnection connection); boolean addPeerGroup(SxpPeerGroup peerGroup); SxpPeerGroup getPeerGroup(String peerGroupName); SxpPeerGroup removePeerGroup(String peerGroupName); Collection<SxpPeerGroup> getPeerGroups(); boolean addFilterToPeerGroup(String peerGroupName, SxpFilter sxpFilter); SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter); boolean removeFilterFromPeerGroup(String peerGroupName, FilterType filterType, FilterSpecific specific); boolean addDomain(
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain); boolean addDomain(
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain,
            MasterDatabaseInf masterDB,
            SxpDatabaseInf sxpDB); SxpDomain removeDomain(String domainName); SxpDomain getDomain(String name); Collection<SxpDomain> getDomains(); boolean addFilterToDomain(String domain, DomainFilter filter); SxpBindingFilter removeFilterFromDomain(String domain, FilterSpecific specific, String filterName); boolean updateDomainFilter(String domain, DomainFilter newFilter); @Deprecated void addConnection(Connection connection); SxpConnection addConnection(Connection connection, String domain); @Deprecated void addConnections(Connections connections); void addConnections(Connections connections, String domain); List<SxpConnection> getAllConnections(); List<SxpConnection> getAllConnections(String domain); InetAddress getSourceIp(); List<SxpConnection> getAllDeleteHoldDownConnections(); List<SxpConnection> getAllDeleteHoldDownConnections(String domain); List<SxpConnection> getAllOffConnections(); List<SxpConnection> getAllOffConnections(String domain); List<SxpConnection> getAllOnConnections(); List<SxpConnection> getAllOnConnections(String domain); @Deprecated List<SxpConnection> getAllOnListenerConnections(); List<SxpConnection> getAllOnListenerConnections(String domain); @Deprecated List<SxpConnection> getAllOnSpeakerConnections(); List<SxpConnection> getAllOnSpeakerConnections(String domain); @Deprecated MasterDatabaseInf getBindingMasterDatabase(); @Deprecated SxpDatabaseInf getBindingSxpDatabase(); MasterDatabaseInf getBindingMasterDatabase(String domainName); SxpDatabaseInf getBindingSxpDatabase(String domainName); SxpConnection getByAddress(final InetSocketAddress inetSocketAddress); @Deprecated SxpConnection getByPort(final int port); SxpConnection getConnection(SocketAddress socketAddress); int getExpansionQuantity(); int getHoldTime(); int getHoldTimeMax(); int getHoldTimeMin(); int getHoldTimeMinAcceptable(); int getKeepAliveTime(); String getName(); NodeId getNodeId(); String getPassword(); int getRetryOpenTime(); int getServerPort(); ListenableScheduledFuture<?> getTimer(TimerType timerType); Version getVersion(); boolean isEnabled(); synchronized ListenableFuture openConnections(); BindingDispatcher getSvcBindingDispatcher(); BindingHandler getSvcBindingHandler(); List<MasterDatabaseBinding> putBindingsMasterDatabase(List<MasterDatabaseBinding> bindings,
            String domainName); List<MasterDatabaseBinding> removeBindingsMasterDatabase(List<MasterDatabaseBinding> bindings,
            String domainName); SxpConnection removeConnection(InetSocketAddress destination); void setSecurity(
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.sxp.node.fields.Security security); void setRetryOpenTimerPeriod(int retryOpenTimerPeriod); void setMessagePartitionSize(int size); void setMessageMergeSize(int size); ThreadsWorker getWorker(); void shutdownConnections(); synchronized ListenableFuture<Boolean> shutdown(); synchronized ListenableFuture<Boolean> start(); void updateMD5keys(); SslContextFactory getSslContextFactory(); @Override String toString(); }
SxpNode { public SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter) { synchronized (peerGroupMap) { SxpPeerGroupBuilder peerGroup = peerGroupMap.get(peerGroupName); if (peerGroup == null || newFilter == null) { LOG.warn("{} Cannot update Filter | Due to null parameters", this); return null; } List<SxpFilter> sxpFilters = peerGroup.getSxpFilter(); SxpFilter oldFilter = null; for (SxpFilter filter : sxpFilters) { if (SxpBindingFilter.checkInCompatibility(filter, newFilter)) { oldFilter = filter; break; } } if (oldFilter == null) { LOG.warn("{} Cannot update Filter | No previous filter with type {} found", this, newFilter.getFilterType()); return null; } sxpFilters.remove(oldFilter); sxpFilters.add(newFilter); SxpBindingFilter bindingFilter = SxpBindingFilter.generateFilter(newFilter, peerGroupName); List<SxpConnection> connections = getConnections(peerGroup); for (SxpConnection connection : connections) { connection.putFilter(bindingFilter); } return oldFilter; } } protected  SxpNode(NodeId nodeId, SxpNodeIdentity node, ThreadsWorker worker); static SxpNode createInstance(NodeId nodeId, SxpNodeIdentity node); static SxpNode createInstance(NodeId nodeId, SxpNodeIdentity node, MasterDatabaseInf masterDatabase,
            SxpDatabaseInf sxpDatabase); static SxpNode createInstance(NodeId nodeId, SxpNodeIdentity node, MasterDatabaseInf masterDatabase,
            SxpDatabaseInf sxpDatabase, ThreadsWorker worker); SxpConnection addConnection(SxpConnection connection); boolean addPeerGroup(SxpPeerGroup peerGroup); SxpPeerGroup getPeerGroup(String peerGroupName); SxpPeerGroup removePeerGroup(String peerGroupName); Collection<SxpPeerGroup> getPeerGroups(); boolean addFilterToPeerGroup(String peerGroupName, SxpFilter sxpFilter); SxpFilter updateFilterInPeerGroup(String peerGroupName, SxpFilter newFilter); boolean removeFilterFromPeerGroup(String peerGroupName, FilterType filterType, FilterSpecific specific); boolean addDomain(
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain); boolean addDomain(
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.network.topology.topology.node.sxp.domains.SxpDomain domain,
            MasterDatabaseInf masterDB,
            SxpDatabaseInf sxpDB); SxpDomain removeDomain(String domainName); SxpDomain getDomain(String name); Collection<SxpDomain> getDomains(); boolean addFilterToDomain(String domain, DomainFilter filter); SxpBindingFilter removeFilterFromDomain(String domain, FilterSpecific specific, String filterName); boolean updateDomainFilter(String domain, DomainFilter newFilter); @Deprecated void addConnection(Connection connection); SxpConnection addConnection(Connection connection, String domain); @Deprecated void addConnections(Connections connections); void addConnections(Connections connections, String domain); List<SxpConnection> getAllConnections(); List<SxpConnection> getAllConnections(String domain); InetAddress getSourceIp(); List<SxpConnection> getAllDeleteHoldDownConnections(); List<SxpConnection> getAllDeleteHoldDownConnections(String domain); List<SxpConnection> getAllOffConnections(); List<SxpConnection> getAllOffConnections(String domain); List<SxpConnection> getAllOnConnections(); List<SxpConnection> getAllOnConnections(String domain); @Deprecated List<SxpConnection> getAllOnListenerConnections(); List<SxpConnection> getAllOnListenerConnections(String domain); @Deprecated List<SxpConnection> getAllOnSpeakerConnections(); List<SxpConnection> getAllOnSpeakerConnections(String domain); @Deprecated MasterDatabaseInf getBindingMasterDatabase(); @Deprecated SxpDatabaseInf getBindingSxpDatabase(); MasterDatabaseInf getBindingMasterDatabase(String domainName); SxpDatabaseInf getBindingSxpDatabase(String domainName); SxpConnection getByAddress(final InetSocketAddress inetSocketAddress); @Deprecated SxpConnection getByPort(final int port); SxpConnection getConnection(SocketAddress socketAddress); int getExpansionQuantity(); int getHoldTime(); int getHoldTimeMax(); int getHoldTimeMin(); int getHoldTimeMinAcceptable(); int getKeepAliveTime(); String getName(); NodeId getNodeId(); String getPassword(); int getRetryOpenTime(); int getServerPort(); ListenableScheduledFuture<?> getTimer(TimerType timerType); Version getVersion(); boolean isEnabled(); synchronized ListenableFuture openConnections(); BindingDispatcher getSvcBindingDispatcher(); BindingHandler getSvcBindingHandler(); List<MasterDatabaseBinding> putBindingsMasterDatabase(List<MasterDatabaseBinding> bindings,
            String domainName); List<MasterDatabaseBinding> removeBindingsMasterDatabase(List<MasterDatabaseBinding> bindings,
            String domainName); SxpConnection removeConnection(InetSocketAddress destination); void setSecurity(
            org.opendaylight.yang.gen.v1.urn.opendaylight.sxp.node.rev160308.sxp.node.fields.Security security); void setRetryOpenTimerPeriod(int retryOpenTimerPeriod); void setMessagePartitionSize(int size); void setMessageMergeSize(int size); ThreadsWorker getWorker(); void shutdownConnections(); synchronized ListenableFuture<Boolean> shutdown(); synchronized ListenableFuture<Boolean> start(); void updateMD5keys(); SslContextFactory getSslContextFactory(); @Override String toString(); static final String DEFAULT_DOMAIN; }