Search in sources :

Example 6 with ServiceNotFoundException

use of org.onlab.osgi.ServiceNotFoundException in project onos by opennetworkinglab.

the class FlowObjectiveQueueListCommand method doExecute.

@Override
protected void doExecute() {
    try {
        FlowObjectiveService service = get(FlowObjectiveService.class);
        ListMultimap<FilteringObjQueueKey, Objective> filtObjQueue = service.getFilteringObjQueue();
        ListMultimap<ForwardingObjQueueKey, Objective> fwdObjQueue = service.getForwardingObjQueue();
        ListMultimap<NextObjQueueKey, Objective> nextObjQueue = service.getNextObjQueue();
        Map<FilteringObjQueueKey, Objective> filtObjQueueHead = service.getFilteringObjQueueHead();
        Map<ForwardingObjQueueKey, Objective> fwdObjQueueHead = service.getForwardingObjQueueHead();
        Map<NextObjQueueKey, Objective> nextObjQueueHead = service.getNextObjQueueHead();
        if (cache) {
            printMap("Filtering objective cache", filtObjQueueHead, sizeOnly);
            printMap("Forwarding objective cache", fwdObjQueueHead, sizeOnly);
            printMap("Next objective cache", nextObjQueueHead, sizeOnly);
        } else {
            printMap("Filtering objective queue", filtObjQueue.asMap(), sizeOnly);
            printMap("Forwarding objective queue", fwdObjQueue.asMap(), sizeOnly);
            printMap("Next objective queue", nextObjQueue.asMap(), sizeOnly);
        }
    } catch (ServiceNotFoundException e) {
        print("FlowObjectiveService unavailable");
    }
}
Also used : Objective(org.onosproject.net.flowobjective.Objective) ForwardingObjQueueKey(org.onosproject.net.flowobjective.ForwardingObjQueueKey) FilteringObjQueueKey(org.onosproject.net.flowobjective.FilteringObjQueueKey) ServiceNotFoundException(org.onlab.osgi.ServiceNotFoundException) FlowObjectiveService(org.onosproject.net.flowobjective.FlowObjectiveService) NextObjQueueKey(org.onosproject.net.flowobjective.NextObjQueueKey)

Example 7 with ServiceNotFoundException

use of org.onlab.osgi.ServiceNotFoundException in project trellis-control by opennetworkinglab.

the class InvalidateNextCommand method doExecute.

@Override
protected void doExecute() {
    if (please == null || !please.equals(CONFIRM_PHRASE)) {
        print("WARNING: System may enter an unpredictable state if the next ID is force invalidated." + "Enter confirmation phrase to continue.");
        return;
    }
    try {
        SegmentRoutingService srService = AbstractShellCommand.get(SegmentRoutingService.class);
        srService.invalidateNextObj(Integer.parseInt(nextId));
    } catch (ServiceNotFoundException e) {
        print("SegmentRoutingService unavailable");
    }
}
Also used : SegmentRoutingService(org.onosproject.segmentrouting.SegmentRoutingService) ServiceNotFoundException(org.onlab.osgi.ServiceNotFoundException)

Aggregations

ServiceNotFoundException (org.onlab.osgi.ServiceNotFoundException)7 FlowObjectiveService (org.onosproject.net.flowobjective.FlowObjectiveService)4 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStream (java.io.InputStream)2 SequenceInputStream (java.io.SequenceInputStream)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 UiExtensionService (org.onosproject.ui.UiExtensionService)2 UiSessionToken (org.onosproject.ui.UiSessionToken)2 UiTokenService (org.onosproject.ui.UiTokenService)2 FilteringObjQueueKey (org.onosproject.net.flowobjective.FilteringObjQueueKey)1 ForwardingObjQueueKey (org.onosproject.net.flowobjective.ForwardingObjQueueKey)1 NextObjQueueKey (org.onosproject.net.flowobjective.NextObjQueueKey)1 Objective (org.onosproject.net.flowobjective.Objective)1 SegmentRoutingService (org.onosproject.segmentrouting.SegmentRoutingService)1