Class CommandsTask

java.lang.Object
org.nuxeo.connect.update.task.standalone.AbstractTask
org.nuxeo.connect.update.task.standalone.CommandsTask
All Implemented Interfaces:
org.nuxeo.connect.update.task.Task
Direct Known Subclasses:
InstallTask, UninstallTask

public abstract class CommandsTask extends AbstractTask
A command based task.
Author:
Bogdan Stefanescu
  • Field Details

    • commands

      protected final List<org.nuxeo.connect.update.task.Command> commands
    • commandLog

      protected final LinkedList<org.nuxeo.connect.update.task.Command> commandLog
      The log is generated in the inverse order of commands to ensure last command is rollbacked first.
  • Constructor Details

    • CommandsTask

      public CommandsTask(org.nuxeo.connect.update.PackageUpdateService pus)
  • Method Details

    • getCommandsFile

      protected abstract File getCommandsFile() throws org.nuxeo.connect.update.PackageException
      Get the commands file from where to load commands for this task.
      Throws:
      org.nuxeo.connect.update.PackageException
    • initialize

      public void initialize(org.nuxeo.connect.update.LocalPackage pkg, boolean restart) throws org.nuxeo.connect.update.PackageException
      Specified by:
      initialize in interface org.nuxeo.connect.update.task.Task
      Overrides:
      initialize in class AbstractTask
      Throws:
      org.nuxeo.connect.update.PackageException
    • loadCommands

      protected void loadCommands() throws org.nuxeo.connect.update.PackageException
      Load the commands of this task given the user parameters. The parameter map may be null.
      Throws:
      org.nuxeo.connect.update.PackageException
    • getCommands

      public List<org.nuxeo.connect.update.task.Command> getCommands()
      Gets the commands to execute.
    • getCommandLog

      public List<org.nuxeo.connect.update.task.Command> getCommandLog()
      Gets the command log. These are the commands ran so far.
    • addCommand

      public void addCommand(org.nuxeo.connect.update.task.Command command)
      Adds a command to this task.
    • doRun

      protected void doRun(Map<String,String> params) throws org.nuxeo.connect.update.PackageException
      User parameters are not handled by default. You need to implement your own task to do this.
      Specified by:
      doRun in class AbstractTask
      Throws:
      org.nuxeo.connect.update.PackageException
    • flush

      protected abstract void flush() throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
      Since:
      5.6
    • doRollback

      protected void doRollback() throws org.nuxeo.connect.update.PackageException
      Specified by:
      doRollback in class AbstractTask
      Throws:
      org.nuxeo.connect.update.PackageException
    • doValidate

      public void doValidate(org.nuxeo.connect.update.ValidationStatus status) throws org.nuxeo.connect.update.PackageException
      Specified by:
      doValidate in class AbstractTask
      Throws:
      org.nuxeo.connect.update.PackageException
    • writeLog

      public void writeLog(File file) throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException
    • parametrizePaths

      public String parametrizePaths(String content)
    • readLog

      public void readLog(Reader reader) throws org.nuxeo.connect.update.PackageException
      Throws:
      org.nuxeo.connect.update.PackageException