public abstract class AbstractProfileCommand extends Object implements org.apache.karaf.shell.api.action.Action
ApplicationService
, FeaturesService
, and
BundleService
. Provides console styling and common functions for profile commandsModifier and Type | Field and Description |
---|---|
protected ApplicationService |
applicationService |
protected org.apache.karaf.bundle.core.BundleService |
bundleService |
protected PrintStream |
console |
protected org.apache.karaf.features.FeaturesService |
featuresService |
protected static String |
PROFILE_EXTENSION |
protected Path |
profilePath |
Constructor and Description |
---|
AbstractProfileCommand() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doExecute(ApplicationService applicationService,
org.apache.karaf.features.FeaturesService featuresService,
org.apache.karaf.bundle.core.BundleService bundleService)
Execute profile command operations.
|
Object |
execute() |
void |
printError(String message)
Console output styling for an error message Message will be red
|
void |
printItemStatusFailure(String message,
String item)
Console output styling for a successful operation for a given item formatted as
Message: item Note: : will not be added to the message automatically
Message will be blue, item will be red |
void |
printItemStatusPending(String message,
String item)
Console output styling for a successful operation for a given item formatted as
Message: item Note: : will not be added to the message automatically
Message will be blue, item will be yellow |
void |
printItemStatusSuccess(String message,
String item)
Console output styling for a successful operation for a given item formatted as
Message: item Note: : will not be added to the message automatically
Message will be blue, item will be green |
void |
printSectionHeading(String heading)
Console output styling for a section heading
|
void |
printSuccess(String message)
Console output styling for a success message Message will be green
|
protected static final String PROFILE_EXTENSION
protected ApplicationService applicationService
protected org.apache.karaf.features.FeaturesService featuresService
protected org.apache.karaf.bundle.core.BundleService bundleService
protected PrintStream console
protected Path profilePath
public Object execute() throws Exception
execute
in interface org.apache.karaf.shell.api.action.Action
Exception
protected abstract void doExecute(ApplicationService applicationService, org.apache.karaf.features.FeaturesService featuresService, org.apache.karaf.bundle.core.BundleService bundleService) throws Exception
applicationService
- ApplicationService
used by the command implementationfeaturesService
- FeaturesService
used by the command implementationbundleService
- BundleService
used by the command implementationException
public void printSectionHeading(String heading)
heading
- Section Namepublic void printItemStatusPending(String message, String item)
Message: item
Note: :
will not be added to the message automatically
Message will be blue, item will be yellowmessage
- message associated with the operationitem
- item namepublic void printItemStatusSuccess(String message, String item)
Message: item
Note: :
will not be added to the message automatically
Message will be blue, item will be greenmessage
- message associated with the operationitem
- item namepublic void printItemStatusFailure(String message, String item)
Message: item
Note: :
will not be added to the message automatically
Message will be blue, item will be redmessage
- message associated with the operationitem
- item namepublic void printError(String message)
message
- error messagepublic void printSuccess(String message)
message
- success messageThis work is licensed under a Creative Commons Attribution 4.0 International License.