Package org.onosproject.cli.net
Class DevicePortsListCommand
- java.lang.Object
-
- org.onosproject.cli.AbstractShellCommand
-
- org.onosproject.cli.net.DevicesListCommand
-
- org.onosproject.cli.net.DevicePortsListCommand
-
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
,CodecContext
public class DevicePortsListCommand extends DevicesListCommand
Lists all ports or all ports of a device.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
uri
-
Fields inherited from class org.onosproject.cli.AbstractShellCommand
log
-
-
Constructor Summary
Constructors Constructor Description DevicePortsListCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doExecute()
Body of the shell command.protected boolean
isIncluded(Port port)
com.fasterxml.jackson.databind.JsonNode
jsonPorts(DeviceService service, com.fasterxml.jackson.databind.ObjectMapper mapper, Device device)
Produces JSON array containing ports of the specified device.com.fasterxml.jackson.databind.JsonNode
jsonPorts(DeviceService service, java.lang.Iterable<Device> devices)
Produces JSON array containing ports of the specified devices.protected void
printPorts(DeviceService service, Device device)
-
Methods inherited from class org.onosproject.cli.net.DevicesListCommand
getSortedDevices, printDevice
-
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
-
-
-
-
Method Detail
-
doExecute
protected void doExecute()
Description copied from class:AbstractShellCommand
Body of the shell command.- Overrides:
doExecute
in classDevicesListCommand
-
jsonPorts
public com.fasterxml.jackson.databind.JsonNode jsonPorts(DeviceService service, java.lang.Iterable<Device> devices)
Produces JSON array containing ports of the specified devices.- Parameters:
service
- device servicedevices
- collection of devices- Returns:
- JSON array
-
jsonPorts
public com.fasterxml.jackson.databind.JsonNode jsonPorts(DeviceService service, com.fasterxml.jackson.databind.ObjectMapper mapper, Device device)
Produces JSON array containing ports of the specified device.- Parameters:
service
- device servicemapper
- object mapperdevice
- infrastructure devices- Returns:
- JSON array
-
isIncluded
protected boolean isIncluded(Port port)
-
printPorts
protected void printPorts(DeviceService service, Device device)
-
-