@Test public void testGetInterfacesByPort() throws Exception { ConnectPoint cp = ConnectPoint.deviceConnectPoint("of:0000000000000001/1"); Set<Interface> byPort = Collections.singleton(createInterface(1)); assertEquals(byPort, interfaceManager.getInterfacesByPort(cp)); }
@Override public Set<Interface> getInterfacesByPort(ConnectPoint port) { Set<Interface> intfs = interfaces.get(port); if (intfs == null) { return Collections.emptySet(); } return ImmutableSet.copyOf(intfs); }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfacesByPort(ConnectPoint port) { Set<Interface> intfs = interfaces.get(port); if (intfs == null) { return Collections.emptySet(); } return ImmutableSet.copyOf(intfs); } }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfacesByPort(ConnectPoint port) { Set<Interface> intfs = interfaces.get(port); if (intfs == null) { return Collections.emptySet(); } return ImmutableSet.copyOf(intfs); }  }
InterfaceManager extends ListenerRegistry<InterfaceEvent, InterfaceListener> implements InterfaceService, InterfaceAdminService { @Override public Set<Interface> getInterfacesByPort(ConnectPoint port) { Set<Interface> intfs = interfaces.get(port); if (intfs == null) { return Collections.emptySet(); } return ImmutableSet.copyOf(intfs); }  @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> getInterfacesByPort(ConnectPoint port) { Set<Interface> intfs = interfaces.get(port); if (intfs == null) { return Collections.emptySet(); } return ImmutableSet.copyOf(intfs); }  @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);  }