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 Details

    • PROFILE_EXTENSION

      protected static final String PROFILE_EXTENSION
      See Also:
    • applicationService

      protected ApplicationService applicationService
    • featuresService

      protected org.apache.karaf.features.FeaturesService featuresService
    • bundleService

      protected org.apache.karaf.bundle.core.BundleService bundleService
    • console

      protected PrintStream console
    • profilePath

      protected Path profilePath
  • Constructor Details

    • AbstractProfileCommand

      public AbstractProfileCommand()
  • Method Details

    • execute

      public Object execute() throws Exception
      Specified by:
      execute in interface org.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 - ApplicationService used by the command implementation
      featuresService - FeaturesService used by the command implementation
      bundleService - BundleService used by the command implementation
      Throws:
      Exception
    • printSectionHeading

      public void printSectionHeading(String heading)
      Console output styling for a section heading
      Parameters:
      heading - Section Name
    • printItemStatusPending

      public 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
      Parameters:
      message - message associated with the operation
      item - item name
    • printItemStatusSuccess

      public 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
      Parameters:
      message - message associated with the operation
      item - item name
    • printItemStatusFailure

      public 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
      Parameters:
      message - message associated with the operation
      item - item name
    • printError

      public void printError(String message)
      Console output styling for an error message Message will be red
      Parameters:
      message - error message
    • printSuccess

      public void printSuccess(String message)
      Console output styling for a success message Message will be green
      Parameters:
      message - success message