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 Stringuri- 
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 voiddoExecute()Body of the shell command.protected booleanisIncluded(Port port)com.fasterxml.jackson.databind.JsonNodejsonPorts(DeviceService service, com.fasterxml.jackson.databind.ObjectMapper mapper, Device device)Produces JSON array containing ports of the specified device.com.fasterxml.jackson.databind.JsonNodejsonPorts(DeviceService service, Iterable<Device> devices)Produces JSON array containing ports of the specified devices.protected voidprintPorts(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 
 - 
 
 - 
 
- 
- 
Field Detail
- 
uri
protected String uri
 
 - 
 
- 
Method Detail
- 
doExecute
protected void doExecute()
Description copied from class:AbstractShellCommandBody of the shell command.- Overrides:
 doExecutein classDevicesListCommand
 
- 
jsonPorts
public com.fasterxml.jackson.databind.JsonNode jsonPorts(DeviceService service, 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)
 
 - 
 
 -