Package org.onosproject.cli.net
Class FlowsListCommand
- java.lang.Object
-
- org.onosproject.cli.AbstractShellCommand
-
- org.onosproject.cli.net.FlowsListCommand
-
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
,CodecContext
public class FlowsListCommand extends AbstractShellCommand
Lists all currently-known flows.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ANY
-
Fields inherited from class org.onosproject.cli.AbstractShellCommand
log
-
-
Constructor Summary
Constructors Constructor Description FlowsListCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute()
Body of the shell command.protected SortedMap<Device,List<FlowEntry>>
getSortedFlows(DeviceService deviceService, FlowRuleService service, CoreService coreService)
Returns the list of devices sorted using the device ID URIs.protected void
printFlows(Device d, List<FlowEntry> flows, CoreService coreService)
Prints flows.void
removeFlowsInteractive(Iterable<FlowEntry> flows, FlowRuleService flowService, CoreService coreService)
Removes the flows passed as argument after confirmation is provided for each of them.-
Methods inherited from class org.onosproject.cli.AbstractShellCommand
annotations, annotations, annotations, appId, codec, error, execute, get, getService, jsonForEntity, mapper, outputJson, print
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onosproject.codec.CodecContext
decode, encode
-
-
-
-
Field Detail
-
ANY
public static final String ANY
- See Also:
- Constant Field Values
-
-
Method Detail
-
doExecute
protected void doExecute()
Description copied from class:AbstractShellCommand
Body of the shell command.- Specified by:
doExecute
in classAbstractShellCommand
-
removeFlowsInteractive
public void removeFlowsInteractive(Iterable<FlowEntry> flows, FlowRuleService flowService, CoreService coreService)
Removes the flows passed as argument after confirmation is provided for each of them. If no explicit confirmation is provided, the flow is not removed.- Parameters:
flows
- list of flows to removeflowService
- FlowRuleService objectcoreService
- CoreService object
-
getSortedFlows
protected SortedMap<Device,List<FlowEntry>> getSortedFlows(DeviceService deviceService, FlowRuleService service, CoreService coreService)
Returns the list of devices sorted using the device ID URIs.- Parameters:
deviceService
- device serviceservice
- flow rule servicecoreService
- core service- Returns:
- sorted device list
-
printFlows
protected void printFlows(Device d, List<FlowEntry> flows, CoreService coreService)
Prints flows.- Parameters:
d
- the deviceflows
- the set of flows for that devicecoreService
- core system service
-
-