@Test public void testRemoveInterface() throws Exception { ConnectPoint cp = createConnectPoint(1); NetworkConfigEvent event = new NetworkConfigEvent( NetworkConfigEvent.Type.CONFIG_REMOVED, cp, CONFIG_CLASS); assertEquals(NUM_INTERFACES, interfaceManager.getInterfaces().size()); listener.event(event); assertEquals(NUM_INTERFACES - 1, interfaceManager.getInterfaces().size()); }
@Override public Set<Interface> getInterfaces() { return interfaces.values() .stream() .flatMap(set -> set.stream()) .collect(collectingAndThen(toSet(), ImmutableSet::copyOf)); }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfaces() { return interfaces.values() .stream() .flatMap(set -> set.stream()) .collect(collectingAndThen(toSet(), ImmutableSet::copyOf)); } }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfaces() { return interfaces.values() .stream() .flatMap(set -> set.stream()) .collect(collectingAndThen(toSet(), ImmutableSet::copyOf)); }  }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfaces() { return interfaces.values() .stream() .flatMap(set -> set.stream()) .collect(collectingAndThen(toSet(), ImmutableSet::copyOf)); }  @Activate void activate(); @Deactivate void deactivate(); @Override Set<Interface> getInterfaces(); @Override Interface getInterfaceByName(ConnectPoint connectPoint, String name); @Override Set<Interface> getInterfacesByPort(ConnectPoint port); @Override Set<Interface> getInterfacesByIp(IpAddress ip); @Override Interface getMatchingInterface(IpAddress ip); @Override Set<Interface> getInterfacesByVlan(VlanId vlan); @Override void add(Interface intf); @Override boolean remove(ConnectPoint connectPoint, String name); }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfaces() { return interfaces.values() .stream() .flatMap(set -> set.stream()) .collect(collectingAndThen(toSet(), ImmutableSet::copyOf)); }  @Activate void activate(); @Deactivate void deactivate(); @Override Set<Interface> getInterfaces(); @Override Interface getInterfaceByName(ConnectPoint connectPoint, String name); @Override Set<Interface> getInterfacesByPort(ConnectPoint port); @Override Set<Interface> getInterfacesByIp(IpAddress ip); @Override Interface getMatchingInterface(IpAddress ip); @Override Set<Interface> getInterfacesByVlan(VlanId vlan); @Override void add(Interface intf); @Override boolean remove(ConnectPoint connectPoint, String name);  }