Saurav Das | 2443119 | 2016-03-07 19:13:00 -0800 | [diff] [blame] | 1 | package org.onosproject.cli.net; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | //import org.apache.karaf.shell.commands.Argument; |
| 6 | import org.apache.karaf.shell.commands.Command; |
| 7 | import org.onosproject.cli.AbstractShellCommand; |
| 8 | import 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") |
| 16 | public 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 | } |