Class AbstractProfileCommand
java.lang.Object
org.codice.ddf.admin.application.service.command.AbstractProfileCommand
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action
- Direct Known Subclasses:
ProfileInstallCommand,ProfileListCommand
public abstract class AbstractProfileCommand
extends Object
implements org.apache.karaf.shell.api.action.Action
Abstract Profile Command retrieves the
ApplicationService, FeaturesService, and
BundleService. Provides console styling and common functions for profile commands-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ApplicationServiceprotected org.apache.karaf.bundle.core.BundleServiceprotected PrintStreamprotected org.apache.karaf.features.FeaturesServiceprotected static final Stringprotected Path -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoExecute(ApplicationService applicationService, org.apache.karaf.features.FeaturesService featuresService, org.apache.karaf.bundle.core.BundleService bundleService) Execute profile command operations.execute()voidprintError(String message) Console output styling for an error message Message will be redvoidprintItemStatusFailure(String message, String item) Console output styling for a successful operation for a given item formatted asMessage: itemNote::will not be added to the message automatically Message will be blue, item will be redvoidprintItemStatusPending(String message, String item) Console output styling for a successful operation for a given item formatted asMessage: itemNote::will not be added to the message automatically Message will be blue, item will be yellowvoidprintItemStatusSuccess(String message, String item) Console output styling for a successful operation for a given item formatted asMessage: itemNote::will not be added to the message automatically Message will be blue, item will be greenvoidprintSectionHeading(String heading) Console output styling for a section headingvoidprintSuccess(String message) Console output styling for a success message Message will be green
-
Field Details
-
PROFILE_EXTENSION
- See Also:
-
applicationService
-
featuresService
protected org.apache.karaf.features.FeaturesService featuresService -
bundleService
protected org.apache.karaf.bundle.core.BundleService bundleService -
console
-
profilePath
-
-
Constructor Details
-
AbstractProfileCommand
public AbstractProfileCommand()
-
-
Method Details
-
execute
- Specified by:
executein interfaceorg.apache.karaf.shell.api.action.Action- Throws:
Exception
-
doExecute
protected abstract void doExecute(ApplicationService applicationService, org.apache.karaf.features.FeaturesService featuresService, org.apache.karaf.bundle.core.BundleService bundleService) throws Exception Execute profile command operations. This should be extended to provide functionality for any of the profile commands- Parameters:
applicationService-ApplicationServiceused by the command implementationfeaturesService-FeaturesServiceused by the command implementationbundleService-BundleServiceused by the command implementation- Throws:
Exception
-
printSectionHeading
Console output styling for a section heading- Parameters:
heading- Section Name
-
printItemStatusPending
Console output styling for a successful operation for a given item formatted asMessage: itemNote::will not be added to the message automatically Message will be blue, item will be yellow- Parameters:
message- message associated with the operationitem- item name
-
printItemStatusSuccess
Console output styling for a successful operation for a given item formatted asMessage: itemNote::will not be added to the message automatically Message will be blue, item will be green- Parameters:
message- message associated with the operationitem- item name
-
printItemStatusFailure
Console output styling for a successful operation for a given item formatted asMessage: itemNote::will not be added to the message automatically Message will be blue, item will be red- Parameters:
message- message associated with the operationitem- item name
-
printError
Console output styling for an error message Message will be red- Parameters:
message- error message
-
printSuccess
Console output styling for a success message Message will be green- Parameters:
message- success message
-