Package org.onosproject.cli.net
Class LinksListCommand
- java.lang.Object
-
- org.onosproject.cli.AbstractShellCommand
-
- org.onosproject.cli.net.LinksListCommand
-
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
,CodecContext
public class LinksListCommand extends AbstractShellCommand
Lists all infrastructure links.
-
-
Field Summary
-
Fields inherited from class org.onosproject.cli.AbstractShellCommand
log
-
-
Constructor Summary
Constructors Constructor Description LinksListCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
compactLinkString(Link link)
Returns a compact string representing the given link.protected void
doExecute()
Body of the shell command.static com.fasterxml.jackson.databind.JsonNode
json(AbstractShellCommand context, java.lang.Iterable<Link> links)
Produces a JSON array containing the specified links.static com.fasterxml.jackson.databind.node.ObjectNode
json(AbstractShellCommand context, Link link)
Produces a JSON object for the specified link.static java.lang.String
linkString(Link link)
Returns a formatted string representing the given link.-
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.- Specified by:
doExecute
in classAbstractShellCommand
-
json
public static com.fasterxml.jackson.databind.JsonNode json(AbstractShellCommand context, java.lang.Iterable<Link> links)
Produces a JSON array containing the specified links.- Parameters:
context
- context to use for looking up codecslinks
- collection of links- Returns:
- JSON array
-
json
public static com.fasterxml.jackson.databind.node.ObjectNode json(AbstractShellCommand context, Link link)
Produces a JSON object for the specified link.- Parameters:
context
- context to use for looking up codecslink
- link to encode- Returns:
- JSON object
-
linkString
public static java.lang.String linkString(Link link)
Returns a formatted string representing the given link.- Parameters:
link
- infrastructure link- Returns:
- formatted link string
-
compactLinkString
public static java.lang.String compactLinkString(Link link)
Returns a compact string representing the given link.- Parameters:
link
- infrastructure link- Returns:
- formatted link string
-
-