use of org.onosproject.net.link.LinkService in project onos by opennetworkinglab.
the class TsCheckLoop method doExecute.
@Override
protected void doExecute() {
NetworkDiagnosticService service = getService(NetworkDiagnosticService.class);
DeviceService ds = getService(DeviceService.class);
HostService hs = getService(HostService.class);
FlowRuleService frs = getService(FlowRuleService.class);
LinkService ls = getService(LinkService.class);
service.findAnomalies(NetworkDiagnostic.Type.LOOP).forEach(loop -> print(loop.toString()));
}
use of org.onosproject.net.link.LinkService in project onos by opennetworkinglab.
the class OFSwitchManager method neighbour.
@Override
public ConnectPoint neighbour(NetworkId networkId, DeviceId deviceId, PortNumber portNumber) {
ConnectPoint cp = new ConnectPoint(deviceId, portNumber);
LinkService linkService = virtualNetService.get(networkId, LinkService.class);
Set<Link> links = linkService.getEgressLinks(cp);
log.trace("neighbour cp {} egressLinks {}", cp, links);
if (links != null && links.size() > 0) {
Link link = links.iterator().next();
return link.src();
}
return null;
}
use of org.onosproject.net.link.LinkService in project onos by opennetworkinglab.
the class VirtualNetworkLinkManagerTest method testGetLinkByNullDst.
/**
* Tests the getLink() method using a null dst connect point.
*/
@Test(expected = NullPointerException.class)
public void testGetLinkByNullDst() {
manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
VirtualNetwork virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
VirtualDevice srcVirtualDevice = manager.createVirtualDevice(virtualNetwork.id(), DID1);
VirtualDevice dstVirtualDevice = manager.createVirtualDevice(virtualNetwork.id(), DID2);
ConnectPoint src = new ConnectPoint(srcVirtualDevice.id(), PortNumber.portNumber(1));
ConnectPoint dst = new ConnectPoint(dstVirtualDevice.id(), PortNumber.portNumber(2));
manager.createVirtualLink(virtualNetwork.id(), src, dst);
manager.createVirtualLink(virtualNetwork.id(), dst, src);
LinkService linkService = manager.get(virtualNetwork.id(), LinkService.class);
// test the getLink() method with a null dst connect point.
linkService.getLink(src, null);
}
use of org.onosproject.net.link.LinkService in project onos by opennetworkinglab.
the class VirtualNetworkLinkManagerTest method testGetIngressLinksByNullId.
/**
* Tests querying for ingress links using a null connect point.
*/
@Test(expected = NullPointerException.class)
public void testGetIngressLinksByNullId() {
manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
VirtualNetwork virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
LinkService linkService = manager.get(virtualNetwork.id(), LinkService.class);
// test the getIngressLinks() method with a null connect point.
linkService.getIngressLinks(null);
}
use of org.onosproject.net.link.LinkService in project onos by opennetworkinglab.
the class VirtualNetworkLinkManagerTest method testGetLinkByNullSrc.
/**
* Tests the getLink() method using a null src connect point.
*/
@Test(expected = NullPointerException.class)
public void testGetLinkByNullSrc() {
manager.registerTenantId(TenantId.tenantId(tenantIdValue1));
VirtualNetwork virtualNetwork = manager.createVirtualNetwork(TenantId.tenantId(tenantIdValue1));
VirtualDevice srcVirtualDevice = manager.createVirtualDevice(virtualNetwork.id(), DID1);
VirtualDevice dstVirtualDevice = manager.createVirtualDevice(virtualNetwork.id(), DID2);
ConnectPoint src = new ConnectPoint(srcVirtualDevice.id(), PortNumber.portNumber(1));
ConnectPoint dst = new ConnectPoint(dstVirtualDevice.id(), PortNumber.portNumber(2));
manager.createVirtualLink(virtualNetwork.id(), src, dst);
manager.createVirtualLink(virtualNetwork.id(), dst, src);
LinkService linkService = manager.get(virtualNetwork.id(), LinkService.class);
// test the getLink() method with a null src connect point.
linkService.getLink(null, dst);
}
Aggregations