public abstract class AbstractShellCommand
extends org.apache.karaf.shell.console.OsgiCommandSupport
| Constructor and Description |
|---|
AbstractShellCommand() |
| Modifier and Type | Method and Description |
|---|---|
static String |
annotations(org.onosproject.net.Annotations annotations)
Produces a string image of the specified key/value annotations.
|
static com.fasterxml.jackson.databind.node.ObjectNode |
annotations(com.fasterxml.jackson.databind.ObjectMapper mapper,
org.onosproject.net.Annotations annotations)
Produces a JSON object from the specified key/value annotations.
|
protected org.onosproject.core.ApplicationId |
appId()
Returns application ID for the CLI.
|
protected Object |
doExecute() |
void |
error(String format,
Object... args)
Prints the arguments using the specified format to error stream.
|
protected abstract void |
execute()
Executes this command.
|
static <T> T |
get(Class<T> serviceClass)
Returns the reference to the implementation of the specified service.
|
protected boolean |
outputJson()
Indicates whether JSON format should be output.
|
void |
print(String format,
Object... args)
Prints the arguments using the specified format.
|
public static <T> T get(Class<T> serviceClass)
T - type of serviceserviceClass - service classorg.onlab.osgi.ServiceNotFoundException - if service is unavailableprotected org.onosproject.core.ApplicationId appId()
public void print(String format, Object... args)
format - format string; see String.format(java.lang.String, java.lang.Object...)args - argumentspublic void error(String format, Object... args)
format - format string; see String.format(java.lang.String, java.lang.Object...)args - argumentspublic static String annotations(org.onosproject.net.Annotations annotations)
annotations - key/value annotationspublic static com.fasterxml.jackson.databind.node.ObjectNode annotations(com.fasterxml.jackson.databind.ObjectMapper mapper,
org.onosproject.net.Annotations annotations)
mapper - ObjectMapper to use while converting to JSONannotations - key/value annotationsprotected abstract void execute()
protected boolean outputJson()
Copyright © 2015. All rights reserved.