Class Action<O,R>

java.lang.Object
com.evolveum.midpoint.ninja.action.Action<O,R>
Type Parameters:
O - options class
Direct Known Subclasses:
DownloadDistributionAction, HelpAction, InitialObjectsAction, ListKeysRepositoryAction, PreUpgradeCheckAction, RepositoryAction, RunSqlAction, UpgradeBaseAction, UpgradeInstallationAction

public abstract class Action<O,R> extends Object
Base implementation class for action, that is Ninja command.
  • Field Details

    • partial

      protected final boolean partial
      Flag, whether action is part of more complex action. This is most often used to determine whether and how to print information to user (or skip some, e.g. next steps messages).
    • log

      protected Log log
    • context

      protected NinjaContext context
    • options

      protected O options
  • Constructor Details

    • Action

      public Action()
    • Action

      public Action(boolean partial)
  • Method Details

    • init

      public void init(NinjaContext context, O options)
    • destroy

      public void destroy()
    • getLogTarget

      public LogTarget getLogTarget()
      Returns:
      target where the log should be printed. In case action result is printed to the standard output, log messages should go to the standard error no to mix the output. Otherwise, log messages should go to the standard output.
    • handleResultOnFinish

      protected void handleResultOnFinish(R consumerResult, OperationStatus operation, String finishMessage)
    • getApplicationContextLevel

      @NotNull public @NotNull NinjaApplicationContextLevel getApplicationContextLevel(List<Object> allOptions)
      Parameters:
      allOptions -
      Returns:
      Level of application context initialization required for this action.
    • getOperationName

      public abstract String getOperationName()
    • execute

      public abstract R execute() throws Exception
      Throws:
      Exception