blob: 0b3c09c943343b7dfebedea247cb7eb1217dfe86 [file] [log] [blame]
Saurav Das24431192016-03-07 19:13:00 -08001package org.onosproject.cli.net;
2
3import java.util.List;
4
5//import org.apache.karaf.shell.commands.Argument;
6import org.apache.karaf.shell.commands.Command;
7import org.onosproject.cli.AbstractShellCommand;
8import org.onosproject.net.flowobjective.FlowObjectiveService;
9
10/**
11 * Returns a mapping of FlowObjective next-ids to the groups that get created
12 * by a device driver.
13 */
14@Command(scope = "onos", name = "next-ids",
15 description = "flow-objective next-ids to group-ids mapping")
16public class FlowObjectiveNextListCommand extends AbstractShellCommand {
17
18 /*@Argument(index = 1, name = "uri", description = "Device ID",
19 required = false, multiValued = false)
20 String uri = null;
21 */
22 private static final String FORMAT_MAPPING =
23 " %s";
24 @Override
25 protected void execute() {
26 FlowObjectiveService service = get(FlowObjectiveService.class);
27 printNexts(service.getNextMappings());
28 }
29
30 private void printNexts(List<String> nextGroupMappings) {
31 nextGroupMappings.forEach(str -> print(FORMAT_MAPPING, str));
32 }
33}