Search in sources :

Example 1 with LinkAdminService

use of org.onosproject.net.link.LinkAdminService in project onos by opennetworkinglab.

the class WipeOutCommand method wipeOutLinks.

private void wipeOutLinks() {
    print("Wiping links");
    LinkAdminService linkAdminService = get(LinkAdminService.class);
    while (linkAdminService.getLinkCount() > 0) {
        try {
            for (Link link : linkAdminService.getLinks()) {
                linkAdminService.removeLinks(link.src());
                linkAdminService.removeLinks(link.dst());
            }
        } catch (Exception e) {
            log.info("Unable to wipe-out links", e);
        }
    }
}
Also used : LinkAdminService(org.onosproject.net.link.LinkAdminService) Link(org.onosproject.net.Link) TimeoutException(java.util.concurrent.TimeoutException) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 Link (org.onosproject.net.Link)1 LinkAdminService (org.onosproject.net.link.LinkAdminService)1