@Test public void getLinks() { Link l1 = addLink(DID1, P1, DID2, P2, DIRECT); Link l2 = addLink(DID2, P2, DID1, P1, DIRECT); Link l3 = addLink(DID3, P3, DID2, P1, DIRECT); Link l4 = addLink(DID2, P1, DID3, P3, DIRECT); assertEquals("incorrect link count", 4, service.getLinkCount()); Set<Link> links = service.getLinks(cp(DID1, P1)); assertEquals("incorrect links", ImmutableSet.of(l1, l2), links); links = service.getEgressLinks(cp(DID1, P1)); assertEquals("incorrect links", ImmutableSet.of(l1), links); links = service.getIngressLinks(cp(DID1, P1)); assertEquals("incorrect links", ImmutableSet.of(l2), links); links = service.getDeviceLinks(DID2); assertEquals("incorrect links", ImmutableSet.of(l1, l2, l3, l4), links); links = service.getDeviceLinks(DID3); assertEquals("incorrect links", ImmutableSet.of(l3, l4), links); links = service.getDeviceEgressLinks(DID2); assertEquals("incorrect links", ImmutableSet.of(l2, l4), links); links = service.getDeviceIngressLinks(DID2); assertEquals("incorrect links", ImmutableSet.of(l1, l3), links); }
@Override public Iterable<Link> getLinks() { checkPermission(LINK_READ); return store.getLinks(); }
LinkManager extends AbstractListenerProviderRegistry<LinkEvent, LinkListener, LinkProvider, LinkProviderService> implements LinkService, LinkAdminService, LinkProviderRegistry { @Override public Iterable<Link> getLinks() { checkPermission(LINK_READ); return store.getLinks(); } }
LinkManager extends AbstractListenerProviderRegistry<LinkEvent, LinkListener, LinkProvider, LinkProviderService> implements LinkService, LinkAdminService, LinkProviderRegistry { @Override public Iterable<Link> getLinks() { checkPermission(LINK_READ); return store.getLinks(); }  }
LinkManager extends AbstractListenerProviderRegistry<LinkEvent, LinkListener, LinkProvider, LinkProviderService> implements LinkService, LinkAdminService, LinkProviderRegistry { @Override public Iterable<Link> getLinks() { checkPermission(LINK_READ); return store.getLinks(); }  @Activate void activate(); @Deactivate void deactivate(); @Override int getLinkCount(); @Override Iterable<Link> getLinks(); @Override Iterable<Link> getActiveLinks(); @Override Set<Link> getDeviceLinks(DeviceId deviceId); @Override Set<Link> getDeviceEgressLinks(DeviceId deviceId); @Override Set<Link> getDeviceIngressLinks(DeviceId deviceId); @Override Set<Link> getLinks(ConnectPoint connectPoint); @Override Set<Link> getEgressLinks(ConnectPoint connectPoint); @Override Set<Link> getIngressLinks(ConnectPoint connectPoint); @Override Link getLink(ConnectPoint src, ConnectPoint dst); @Override void removeLinks(ConnectPoint connectPoint); @Override void removeLinks(DeviceId deviceId); @Override void removeLink(ConnectPoint src, ConnectPoint dst); }
LinkManager extends AbstractListenerProviderRegistry<LinkEvent, LinkListener, LinkProvider, LinkProviderService> implements LinkService, LinkAdminService, LinkProviderRegistry { @Override public Iterable<Link> getLinks() { checkPermission(LINK_READ); return store.getLinks(); }  @Activate void activate(); @Deactivate void deactivate(); @Override int getLinkCount(); @Override Iterable<Link> getLinks(); @Override Iterable<Link> getActiveLinks(); @Override Set<Link> getDeviceLinks(DeviceId deviceId); @Override Set<Link> getDeviceEgressLinks(DeviceId deviceId); @Override Set<Link> getDeviceIngressLinks(DeviceId deviceId); @Override Set<Link> getLinks(ConnectPoint connectPoint); @Override Set<Link> getEgressLinks(ConnectPoint connectPoint); @Override Set<Link> getIngressLinks(ConnectPoint connectPoint); @Override Link getLink(ConnectPoint src, ConnectPoint dst); @Override void removeLinks(ConnectPoint connectPoint); @Override void removeLinks(DeviceId deviceId); @Override void removeLink(ConnectPoint src, ConnectPoint dst);  }