@Test public final void testGetDeviceIngressLinks() { LinkKey linkId1 = LinkKey.linkKey(new ConnectPoint(DID1, P1), new ConnectPoint(DID2, P2)); LinkKey linkId2 = LinkKey.linkKey(new ConnectPoint(DID2, P2), new ConnectPoint(DID1, P1)); LinkKey linkId3 = LinkKey.linkKey(new ConnectPoint(DID1, P2), new ConnectPoint(DID2, P3)); putLink(linkId1, DIRECT); putLink(linkId2, DIRECT); putLink(linkId3, DIRECT); Set<Link> links1 = linkStore.getDeviceIngressLinks(DID2); assertEquals(2, links1.size()); Set<Link> links2 = linkStore.getDeviceIngressLinks(DID1); assertEquals(1, links2.size()); assertLink(linkId2, DIRECT, links2.iterator().next()); }
@Override public Set<Link> getDeviceIngressLinks(DeviceId deviceId) { return filter(links.values(), link -> deviceId.equals(link.dst().deviceId())); }
ECLinkStore extends AbstractStore<LinkEvent, LinkStoreDelegate> implements LinkStore { @Override public Set<Link> getDeviceIngressLinks(DeviceId deviceId) { return filter(links.values(), link -> deviceId.equals(link.dst().deviceId())); } }
ECLinkStore extends AbstractStore<LinkEvent, LinkStoreDelegate> implements LinkStore { @Override public Set<Link> getDeviceIngressLinks(DeviceId deviceId) { return filter(links.values(), link -> deviceId.equals(link.dst().deviceId())); }  }
ECLinkStore extends AbstractStore<LinkEvent, LinkStoreDelegate> implements LinkStore { @Override public Set<Link> getDeviceIngressLinks(DeviceId deviceId) { return filter(links.values(), link -> deviceId.equals(link.dst().deviceId())); }  @Activate void activate(); @Deactivate void deactivate(); @Override int getLinkCount(); @Override Iterable<Link> getLinks(); @Override Set<Link> getDeviceEgressLinks(DeviceId deviceId); @Override Set<Link> getDeviceIngressLinks(DeviceId deviceId); @Override Link getLink(ConnectPoint src, ConnectPoint dst); @Override Set<Link> getEgressLinks(ConnectPoint src); @Override Set<Link> getIngressLinks(ConnectPoint dst); @Override LinkEvent createOrUpdateLink(ProviderId providerId,
                                        LinkDescription linkDescription); @Override LinkEvent removeOrDownLink(ConnectPoint src, ConnectPoint dst); @Override LinkEvent removeLink(ConnectPoint src, ConnectPoint dst); }
ECLinkStore extends AbstractStore<LinkEvent, LinkStoreDelegate> implements LinkStore { @Override public Set<Link> getDeviceIngressLinks(DeviceId deviceId) { return filter(links.values(), link -> deviceId.equals(link.dst().deviceId())); }  @Activate void activate(); @Deactivate void deactivate(); @Override int getLinkCount(); @Override Iterable<Link> getLinks(); @Override Set<Link> getDeviceEgressLinks(DeviceId deviceId); @Override Set<Link> getDeviceIngressLinks(DeviceId deviceId); @Override Link getLink(ConnectPoint src, ConnectPoint dst); @Override Set<Link> getEgressLinks(ConnectPoint src); @Override Set<Link> getIngressLinks(ConnectPoint dst); @Override LinkEvent createOrUpdateLink(ProviderId providerId,
                                        LinkDescription linkDescription); @Override LinkEvent removeOrDownLink(ConnectPoint src, ConnectPoint dst); @Override LinkEvent removeLink(ConnectPoint src, ConnectPoint dst);  }